diff --git a/0001-fix_spelling.patch b/0001-fix_spelling.patch new file mode 100644 index 0000000000000000000000000000000000000000..ad8cb2bd8f952eae882ad33cfc408a3eae378c11 --- /dev/null +++ b/0001-fix_spelling.patch @@ -0,0 +1,65 @@ +diff --git a/src/abundances.cpp b/src/abundances.cpp +index 2c386d4..c95c2ca 100644 +--- a/src/abundances.cpp ++++ b/src/abundances.cpp +@@ -3132,7 +3132,7 @@ bool AbundanceGroup::calculate_gammas(const vector& nr_alignments, + + vector gammas; + +- verbose_msg( "Calculating intial MLE\n"); ++ verbose_msg( "Calculating initial MLE\n"); + + AbundanceStatus mle_success = gamma_mle(mapped_transcripts, + nr_alignments, +diff --git a/src/locfit/arith.c b/src/locfit/arith.c +index 536a78c..2a6c66c 100644 +--- a/src/locfit/arith.c ++++ b/src/locfit/arith.c +@@ -410,7 +410,7 @@ double (*f)(); + INT i; + if (l==NULL) + { +- ERROR(("vvec1 recieved NULL variable\n")); ++ ERROR(("vvec1 received NULL variable\n")); + return NULL; + } + v = createvar("_vvec1",STHIDDEN,l->n,VDOUBLE); +diff --git a/src/locfit/cmd.c b/src/locfit/cmd.c +index ec19da6..3f36703 100644 +--- a/src/locfit/cmd.c ++++ b/src/locfit/cmd.c +@@ -593,7 +593,7 @@ vari *v; + vari *vd; + + if (argarg(v,0)==NULL) +- { ERROR(("Unnamed Defintion")); ++ { ERROR(("Unnamed Definition")); + return; + } + n = vlength(v)-1; +diff --git a/src/locfit/lfd.c b/src/locfit/lfd.c +index 4a6b74b..912670a 100644 +--- a/src/locfit/lfd.c ++++ b/src/locfit/lfd.c +@@ -78,7 +78,7 @@ INT fp; + } + } + if (access("LFData",W_OK)==-1) +- { ERROR(("LFData directory not writeable")); ++ { ERROR(("LFData directory not writable")); + return(0); + } + } +diff --git a/src/locfit/pout.c b/src/locfit/pout.c +index 04eab50..bd52de3 100644 +--- a/src/locfit/pout.c ++++ b/src/locfit/pout.c +@@ -537,7 +537,7 @@ INT wn, w, h, rd; + points3d(xyz,theta,phi,dev,'q'); + break; + case 's': +- if (i==0) { ERROR(("invalid segements")); } ++ if (i==0) { ERROR(("invalid segments")); } + else + segments(viptr(pl->xyzs,i-1),xyz,theta,phi,dev); + break; diff --git a/0002-fix_includes_path.patch b/0002-fix_includes_path.patch new file mode 100644 index 0000000000000000000000000000000000000000..8c7ba0274c881fa40b99ef5c00eab8ba09f5b3b9 --- /dev/null +++ b/0002-fix_includes_path.patch @@ -0,0 +1,65 @@ +diff --git a/ax_check_eigen.m4 b/ax_check_eigen.m4 +index 02234d8..a7d070a 100644 +--- a/ax_check_eigen.m4 ++++ b/ax_check_eigen.m4 +@@ -66,7 +66,7 @@ export EIGEN_CPPFLAGS + + AC_LANG_PUSH(C++) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +-@%:@include ++@%:@include + ]], [[ + ]])],[ + AC_MSG_RESULT(yes) +diff --git a/src/abundances.cpp b/src/abundances.cpp +index c95c2ca..cb8073f 100644 +--- a/src/abundances.cpp ++++ b/src/abundances.cpp +@@ -50,7 +50,7 @@ + #include "negative_binomial_distribution.h" + + +-#include ++#include + //using Eigen::MatrixXd; + + //#ifdef __USE_ISOC99 +diff --git a/src/abundances.h b/src/abundances.h +index a3f8469..fd45821 100644 +--- a/src/abundances.h ++++ b/src/abundances.h +@@ -18,7 +18,7 @@ + #include + #include + +-#include ++#include + + #include "hits.h" + #include "scaffolds.h" +diff --git a/src/jensen_shannon.h b/src/jensen_shannon.h +index 96d6132..038a88a 100644 +--- a/src/jensen_shannon.h ++++ b/src/jensen_shannon.h +@@ -14,7 +14,7 @@ + #include + + #include +-#include ++#include + + namespace ublas = boost::numeric::ublas; + +diff --git a/src/sampling.h b/src/sampling.h +index d430a34..368b9af 100644 +--- a/src/sampling.h ++++ b/src/sampling.h +@@ -35,7 +35,7 @@ + #include + #include + +-#include ++#include + + // Boost Cholesky factorizations in the spirit of lu.hpp + // Written by Robbie Vogt, found at: diff --git a/0003-fix_boost_tr1_path.patch b/0003-fix_boost_tr1_path.patch new file mode 100644 index 0000000000000000000000000000000000000000..76bee7ae0941f15f13734bc578ec2881fafb877a --- /dev/null +++ b/0003-fix_boost_tr1_path.patch @@ -0,0 +1,13 @@ +diff --git a/src/biascorrection.h b/src/biascorrection.h +index 962426d..c332667 100644 +--- a/src/biascorrection.h ++++ b/src/biascorrection.h +@@ -15,7 +15,7 @@ + #include + #include + #include +-#include ++#include + #include + #include "common.h" + diff --git a/0004-return_with_novalue.patch b/0004-return_with_novalue.patch new file mode 100644 index 0000000000000000000000000000000000000000..4db273506f02b23a51925c45e0b55407dc7abad1 --- /dev/null +++ b/0004-return_with_novalue.patch @@ -0,0 +1,16 @@ +diff --git a/src/lemon/error.h b/src/lemon/error.h +index 01931d8..ffcd46c 100644 +--- a/src/lemon/error.h ++++ b/src/lemon/error.h +@@ -67,9 +67,9 @@ namespace lemon { + } + + ExceptionMember& operator=(const ExceptionMember& copy) { +- if (ptr.get() == 0) return; ++ if (ptr.get() == 0) return *this; + try { +- if (!copy.valid()) return; ++ if (!copy.valid()) return *this; + *ptr = copy.get(); + } catch (...) {} + } diff --git a/0005-fix_no_hash_member.patch b/0005-fix_no_hash_member.patch new file mode 100644 index 0000000000000000000000000000000000000000..e845c236681a5c4b6d958bfe250fe20b0dd18041 --- /dev/null +++ b/0005-fix_no_hash_member.patch @@ -0,0 +1,265 @@ +diff --git a/src/GHash.hh b/src/GHash.hh +index 5122e1d..df613d0 100644 +--- a/src/GHash.hh ++++ b/src/GHash.hh +@@ -88,7 +88,7 @@ public: + //nextkey is SET to the corresponding key + GHashEntry* NextEntry() { //returns a pointer to a GHashEntry + register int pos=fCurrentEntry; +- while (pos GHash::GHash(GFreeProc* freeProc) { + fFreeProc=freeProc; + lastkeyptr=NULL; + for (uint i=0; i GHash::GHash(bool doFree) { + lastkeyptr=NULL; + fFreeProc = (doFree)?&DefaultFreeProc : NULL; + for (uint i=0; i void GHash::Resize(int m){ + if(n!=fCapacity){ + GASSERT(m<=n); + GMALLOC(k, sizeof(GHashEntry)*n); +- for(i=0; i const OBJ* GHash::Add(const char* ky, + GASSERT(1<=x && x const OBJ* GHash::Add(const char* ky, + GTRACE(("GHash::insert: key=\"%s\"\n",ky)); + //GMessage("GHash::insert: key=\"%s\"\n",ky); + GASSERT(0<=i && i const OBJ* GHash::shkAdd(const char* ky, + GASSERT(1<=x && x const OBJ* GHash::shkAdd(const char* ky, + GTRACE(("GHash::insert: key=\"%s\"\n",ky)); + //GMessage("GHash::insert: key=\"%s\"\n",ky); + GASSERT(0<=i && i OBJ* GHash::Replace(const char* ky,const OBJ* pdata, + GASSERT(1<=x && x OBJ* GHash::Replace(const char* ky,const OBJ* pdata, + if(i==-1) i=p; + GTRACE(("GHash::replace: %08x: inserting: \"%s\"\n",this,ky)); + GASSERT(0<=i && i OBJ* GHash::Remove(const char* ky){ + GASSERT(1<=x && x bool GHash::hasKey(const char* ky) { + GASSERT(1<=x && x OBJ* GHash::Find(const char* ky, char** keyptr){ + GASSERT(1<=x && x void GHash::startIterate() {// initialize a key iterat + + template char* GHash::NextKey() { + register int pos=fCurrentEntry; +- while (pos char* GHash::NextKey() { + + template OBJ* GHash::NextData() { + register int pos=fCurrentEntry; +- while (pos OBJ* GHash::NextData() { + + template OBJ* GHash::NextData(char* &nextkey) { + register int pos=fCurrentEntry; +- while (pos OBJ* GHash::NextData(char* &nextkey) { + // Get first non-empty entry + template int GHash::First() const { + register int pos=0; +- while(pos int GHash::Last() const { + // Find next valid entry + template int GHash::Next(int pos) const { + GASSERT(0<=pos && pos int GHash::Next(int pos) const { + // Find previous valid entry + template int GHash::Prev(int pos) const { + GASSERT(0<=pos && pos= 0){ if(0<=hash[pos].hash) break; } +- GASSERT(pos<0 || 0<=hash[pos].hash); ++ while(--pos >= 0){ if(0<=(hash[pos].hash)) break; } ++ GASSERT(pos<0 || 0<=(hash[pos].hash)); + return pos; + } + +@@ -493,7 +493,7 @@ template int GHash::Prev(int pos) const { + template void GHash::Clear(){ + register int i; + for(i=0; i=0){ ++ if((hash[i].hash)>=0){ + if (hash[i].keyalloc) GFREE((hash[i].key)); + if (FREEDATA) + (*fFreeProc)(hash[i].data); +@@ -503,7 +503,7 @@ template void GHash::Clear(){ + GMALLOC(hash, sizeof(GHashEntry)*DEF_HASH_SIZE); + //reinitialize it + for (i=0; i=0){ ++ if((hash[i].hash)>=0){ + uint len=strlen(hash[i].key); + store << len; + store << hash[i].mark; +@@ -534,7 +534,7 @@ void GHash::Load(Stream& store){ + store >> fCount; + for(int i=0; i> hash[i].hash; +- if(hash[i].hash>=0){ ++ if((hash[i].hash)>=0){ + uint len; + store >> len; + store >> hash[i].mark; +@@ -550,7 +550,7 @@ void GHash::Load(Stream& store){ + template GHash::~GHash(){ + register int i; + for(i=0; i=0){ ++ if((hash[i].hash)>=0){ + if (hash[i].keyalloc) GFREE((hash[i].key)); + if (FREEDATA) (*fFreeProc)(hash[i].data); + } diff --git a/0006-format-security.patch b/0006-format-security.patch new file mode 100644 index 0000000000000000000000000000000000000000..2cc568ae395135264c65841051a3a75d1cf42c36 --- /dev/null +++ b/0006-format-security.patch @@ -0,0 +1,13 @@ +diff --git a/src/locfit/makecmd.c b/src/locfit/makecmd.c +index 12ced82..c712843 100644 +--- a/src/locfit/makecmd.c ++++ b/src/locfit/makecmd.c +@@ -200,7 +200,7 @@ char *cmdline; + /* vs is used to store the command line string. */ + sprintf(vn,"=clstr%d",clcount); + vs = createvar(vn,STSYSTEM,1+strlen(cmdline),VCHAR); +- sprintf((char *)vdptr(vs),cmdline); ++ sprintf((char *)vdptr(vs),"%s",cmdline); + + /* va is used to store pointers to the command line fields. */ + sprintf(vn,"=cline%d",clcount); diff --git a/0007-py2to3.patch b/0007-py2to3.patch new file mode 100644 index 0000000000000000000000000000000000000000..6c430945abc318dc1dcbd3ea5f8ee973d4e7ffcb --- /dev/null +++ b/0007-py2to3.patch @@ -0,0 +1,399 @@ +diff --git a/src/cuffmerge b/src/cuffmerge +index e12f232..452df65 100755 +--- a/src/cuffmerge ++++ b/src/cuffmerge +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python3 + # encoding: utf-8 + """ + cuffmerge.py +@@ -6,6 +6,8 @@ cuffmerge.py + Created by Cole Trapnell on 2011-03-17. + Copyright (c) 2011 Cole Trapnell. All rights reserved. + """ ++from __future__ import print_function ++from __future__ import absolute_import + + import sys + import getopt +@@ -17,6 +19,9 @@ import os + import tempfile + import warnings + import types ++from operator import itemgetter ++from tempfile import mktemp ++ + + help_message = ''' + cuffmerge takes two or more Cufflinks GTF files and merges them into a +@@ -92,7 +97,7 @@ class TestParams: + "num-threads=", + "keep-tmp", + "min-isoform-fraction="]) +- except getopt.error, msg: ++ except getopt.error as msg: + raise Usage(msg) + + self.system_params.parse_options(opts) +@@ -104,7 +109,7 @@ class TestParams: + # option processing + for option, value in opts: + if option in ("-v", "--version"): +- print "merge_cuff_asms v%s" % (get_version()) ++ print("merge_cuff_asms v%s" % (get_version())) + exit(0) + if option in ("-h", "--help"): + raise Usage(help_message) +@@ -128,17 +133,17 @@ def right_now(): + + def prepare_output_dir(): + +- print >> sys.stderr, "[%s] Preparing output location %s" % (right_now(), output_dir) ++ print("[%s] Preparing output location %s" % (right_now(), output_dir), file=sys.stderr) + if os.path.exists(output_dir): + pass + else: + os.makedirs(output_dir) + +- #print >> sys.stderr, "Checking for %s", logging_dir ++ #print("Checking for %s", logging_dir, file=sys.stderr) + if os.path.exists(logging_dir): + pass + else: +- #print >> sys.stderr, "Creating %s", logging_dir ++ #print("Creating %s", logging_dir, file=sys.stderr) + os.makedirs(logging_dir) + + if os.path.exists(tmp_dir): +@@ -158,7 +163,7 @@ def tmp_name(prefix): + pass + else: + os.mkdir(tmp_root) +- return tmp_root + prefix + os.tmpnam().split('/')[-1] ++ return tmp_root + prefix + mktemp().split(os.sep)[-1] + + def cufflinks(out_dir, + sam_file, +@@ -168,9 +173,9 @@ def cufflinks(out_dir, + lsf=False, + curr_queue=None): + if gtf_file != None: +- print >> sys.stderr, "[%s] Quantitating transcripts" % (right_now()) ++ print("[%s] Quantitating transcripts" % (right_now()), file=sys.stderr) + else: +- print >> sys.stderr, "[%s] Assembling transcripts" % (right_now()) ++ print("[%s] Assembling transcripts" % (right_now()), file=sys.stderr) + + cmd = ["cufflinks"] + +@@ -191,20 +196,20 @@ def cufflinks(out_dir, + cmd.append(sam_file) + + try: +- print >> run_log, " ".join(cmd) ++ print(" ".join(cmd), file=run_log) + ret = subprocess.call(cmd) + if ret != 0: +- print >> sys.stderr, fail_str, "Error: could not execute cufflinks" ++ print(fail_str, "Error: could not execute cufflinks", file=sys.stderr) + exit(1) + # cufflinks not found +- except OSError, o: ++ except OSError as o: + if o.errno == errno.ENOTDIR or o.errno == errno.ENOENT: +- print >> sys.stderr, fail_str, "Error: cufflinks not found on this system. Did you forget to include it in your PATH?" ++ print(fail_str, "Error: cufflinks not found on this system. Did you forget to include it in your PATH?", file=sys.stderr) + exit(1) + + def cuffcompare(prefix, ref_gtf, fasta, cuff_gtf): + +- print >> sys.stderr, "[%s] Comparing reference %s to assembly %s" % (right_now(), ref_gtf, cuff_gtf) ++ print("[%s] Comparing reference %s to assembly %s" % (right_now(), ref_gtf, cuff_gtf), file=sys.stderr) + cmd = ["cuffcompare"] + + if prefix != None: +@@ -213,22 +218,22 @@ def cuffcompare(prefix, ref_gtf, fasta, cuff_gtf): + cmd.extend(["-r", ref_gtf]) + if fasta != None: + cmd.extend(["-s", fasta]) +- if type(cuff_gtf) == types.ListType: ++ if isinstance(cuff_gtf, list): + for g in cuff_gtf: + cmd.extend([g]) + else: + cmd.extend([cuff_gtf]) + + try: +- print >> run_log, " ".join(cmd) ++ print(" ".join(cmd), file=run_log) + ret = subprocess.call(cmd) + if ret != 0: +- print >> sys.stderr, fail_str, "Error: could not execute cuffcompare" ++ print(fail_str, "Error: could not execute cuffcompare", file=sys.stderr) + exit(1) + # cuffcompare not found +- except OSError, o: ++ except OSError as o: + if o.errno == errno.ENOTDIR or o.errno == errno.ENOENT: +- print >> sys.stderr, fail_str, "Error: cuffcompare not found on this system. Did you forget to include it in your PATH?" ++ print(fail_str, "Error: cuffcompare not found on this system. Did you forget to include it in your PATH?", file=sys.stderr) + exit(1) + + def gtf_to_sam(gtf_filename): +@@ -240,15 +245,15 @@ def gtf_to_sam(gtf_filename): + cmd.append(gtf_filename) + cmd.append(sam_out) + try: +- print >> run_log, " ".join(cmd) ++ print(" ".join(cmd), file=run_log) + ret = subprocess.call(cmd) + if ret != 0: +- print >> sys.stderr, fail_str, "Error: could not execute gtf_to_sam" ++ print(fail_str, "Error: could not execute gtf_to_sam", file=sys.stderr) + exit(1) + # gtf_to_sam not found +- except OSError, o: ++ except OSError as o: + if o.errno == errno.ENOTDIR or o.errno == errno.ENOENT: +- print >> sys.stderr, fail_str, "Error: gtf_to_sam not found on this system. Did you forget to include it in your PATH?" ++ print(fail_str, "Error: gtf_to_sam not found on this system. Did you forget to include it in your PATH?", file=sys.stderr) + exit(1) + return sam_out + +@@ -268,9 +273,9 @@ def test_input_files(filename_list): + g = open(line,"r") + input_files.append(line) + +- except OSError, o: ++ except OSError as o: + if o.errno == errno.ENOTDIR or o.errno == errno.ENOENT: +- print >> sys.stderr, fail_str, "Error: could not open %s" % line ++ print(fail_str, "Error: could not open %s" % line, file=sys.stderr) + OK = False + if not OK: + sys.exit(1) +@@ -279,16 +284,16 @@ def test_input_files(filename_list): + def convert_gtf_to_sam(gtf_filename_list): + """This function takes a list of GTF files, converts them all to + temporary SAM files, and returns the list of temporary file names.""" +- print >> sys.stderr, "[%s] Converting GTF files to SAM" % (right_now()) ++ print("[%s] Converting GTF files to SAM" % (right_now()), file=sys.stderr) + OK = True + sam_input_filenames = [] + for line in gtf_filename_list: + try: + sam_out = gtf_to_sam(line) + sam_input_filenames.append(sam_out) +- except OSError, o: ++ except OSError as o: + if o.errno == errno.ENOTDIR or o.errno == errno.ENOENT: +- print >> sys.stderr, fail_str, "Error: could not open %s" % line ++ print(fail_str, "Error: could not open %s" % line, file=sys.stderr) + OK = False + if not OK: + sys.exit(1) +@@ -299,12 +304,12 @@ def merge_sam_inputs(sam_input_list, header): + + sorted_map = open(sorted_map_name, "w") + +- #print header ++ #print(header) + + # The header was built from a dict keyed by chrom, so + # the records will be lexicographically ordered and + # should match the BAM after the sort below. +- print >> sorted_map, header, ++ print(header, end=' ', file=sorted_map) + + sorted_map.close() + sort_cmd =["sort", +@@ -315,48 +320,49 @@ def merge_sam_inputs(sam_input_list, header): + "--temporary-directory="+tmp_dir] + sort_cmd.extend(sam_input_list) + +- print >> run_log, " ".join(sort_cmd), ">", sorted_map_name ++ print(" ".join(sort_cmd), ">", sorted_map_name, file=run_log) + subprocess.call(sort_cmd, + stdout=open(sorted_map_name, "a")) + return sorted_map_name + + def compare_to_reference(meta_asm_gtf, ref_gtf, fasta): +- print >> sys.stderr, "[%s] Comparing against reference file %s" % (right_now(), ref_gtf) ++ global tmp_dir ++ print("[%s] Comparing against reference file %s" % (right_now(), ref_gtf), file=sys.stderr) + ref_str = "" + if ref_gtf != None: + ref_str = " -r %s " % ref_gtf + + if fasta != None: +- comp_cmd = '''cuffcompare -o tmp_meta_asm -C -G %s -s %s %s''' % (ref_str, fasta, meta_asm_gtf) ++ comp_cmd = '''cuffcompare -o %s -C -G %s -s %s %s''' % (tmp_dir, ref_str, fasta, meta_asm_gtf) + else: +- comp_cmd = '''cuffcompare -o tmp_meta_asm -C -G %s %s''' % (ref_str, meta_asm_gtf) ++ comp_cmd = '''cuffcompare -o %s -C -G %s %s''' % (tmp_dir, ref_str, meta_asm_gtf) + + #cmd = bsub_cmd(comp_cmd, "/gencode_cmp", True, job_mem=8) + cmd = comp_cmd + + try: +- print >> run_log, cmd ++ print(cmd, file=run_log) + ret = subprocess.call(cmd,shell=True) + if ret != 0: +- print >> sys.stderr, fail_str, "Error: could not execute cuffcompare" ++ print(fail_str, "Error: could not execute cuffcompare", file=sys.stderr) + exit(1) + #tmap_out = meta_asm_gtf.split("/")[-1] + ".tmap" + tfpath, tfname = os.path.split(meta_asm_gtf) + if tfpath: tfpath+='/' +- tmap_out = tfpath+'tmp_meta_asm.'+tfname+".tmap" ++ tmap_out = tfpath+'.'+tfname+".tmap" + return tmap_out + # cuffcompare not found +- except OSError, o: ++ except OSError as o: + if o.errno == errno.ENOTDIR or o.errno == errno.ENOENT: +- print >> sys.stderr, fail_str, "Error: cuffcompare not found on this system. Did you forget to include it in your PATH?" ++ print(fail_str, "Error: cuffcompare not found on this system. Did you forget to include it in your PATH?", file=sys.stderr) + exit(1) + + def select_gtf(gtf_in_filename, ids, gtf_out_filename): + f_gtf = open(gtf_in_filename) +- #print >> sys.stderr, "Select GTF: Ids are: " +- #print >> sys.stderr, ids +- #print >> sys.stderr, "reference gtf file name:" +- #print >> sys.stderr, gtf_in_filename ++ #print("Select GTF: Ids are: ", file=sys.stderr) ++ #print(ids, file=sys.stderr) ++ #print("reference gtf file name:", file=sys.stderr) ++ #print(gtf_in_filename, file=sys.stderr) + out_gtf = open(gtf_out_filename, "w") + for line in f_gtf: + line = line.strip() +@@ -370,13 +376,13 @@ def select_gtf(gtf_in_filename, ids, gtf_out_filename): + first_quote = col.find('"') + last_quote = col.find('"', first_quote + 1) + transcript = col[first_quote + 1:last_quote] +- #print >> sys.stderr, transcript ++ #print(transcript, file=sys.stderr) + if transcript in ids: +- print >> out_gtf, line ++ print(line, file=out_gtf) + + + def merge_gtfs(gtf_filenames, merged_gtf, ref_gtf=None): +- print >> sys.stderr, "[%s] Merging linc gtf files with cuffcompare" % (right_now()) ++ print("[%s] Merging linc gtf files with cuffcompare" % (right_now()), file=sys.stderr) + cmd = ["cuffcompare"] + + cmd.extend(["-o", merged_gtf]) +@@ -388,24 +394,24 @@ def merge_gtfs(gtf_filenames, merged_gtf, ref_gtf=None): + #cmd = bsub_cmd(cmd, "/merge_gtf", True, job_mem=8) + + try: +- print >> run_log, cmd ++ print(cmd, file=run_log) + ret = subprocess.call(cmd, shell=True) + if ret != 0: +- print >> sys.stderr, fail_str, "Error: could not execute cuffcompare" ++ print(fail_str, "Error: could not execute cuffcompare", file=sys.stderr) + exit(1) + return merged_gtf + ".combined.gtf" + # cuffcompare not found +- except OSError, o: ++ except OSError as o: + if o.errno == errno.ENOTDIR or o.errno == errno.ENOENT: +- print >> sys.stderr, fail_str, "Error: cuffcompare not found on this system. Did you forget to include it in your PATH?" ++ print(fail_str, "Error: cuffcompare not found on this system. Did you forget to include it in your PATH?", file=sys.stderr) + exit(1) + + def compare_meta_asm_against_ref(ref_gtf, fasta_file, gtf_input_file, class_codes=["c", "i", "r", "p", "e"]): +- #print >> sys.stderr, "Cuffcmpare all assemblies GTFs" ++ #print("Cuffcmpare all assemblies GTFs", file=sys.stderr) + + tmap = compare_to_reference(gtf_input_file, ref_gtf, fasta_file) + +- #print >> sys.stderr, "Cuffcmpare all assemblies GTFs : filter %s" % ",".join(class_codes) ++ #print("Cuffcmpare all assemblies GTFs : filter %s" % ",".join(class_codes), file=sys.stderr) + selected_ids= set([]) + f_tmap = open(tmap) + #out = open("tmp_meta_asm_selectedIds.txt", "w") +@@ -434,15 +440,10 @@ def compare_meta_asm_against_ref(ref_gtf, fasta_file, gtf_input_file, class_code + if os.path.exists(mtmap.split(".tmap")[0]+".refmap"): + os.remove(mtmap.split(".tmap")[0]+".refmap") + +- shutil.move("tmp_meta_asm.combined.gtf", output_dir + "/merged.gtf") ++ global tmp_dir ++ shutil.move(tmp_dir+".combined.gtf", output_dir + "/merged.gtf") + + # os.remove("tmp_meta_asm.combined.gtf") +- if os.path.exists("tmp_meta_asm.loci"): +- os.remove("tmp_meta_asm.loci") +- if os.path.exists("tmp_meta_asm.tracking"): +- os.remove("tmp_meta_asm.tracking") +- if os.path.exists("tmp_meta_asm.stats"): +- os.remove("tmp_meta_asm.stats") + if os.path.exists(tmap): + os.remove(tmap) + if os.path.exists(tmap.split(".tmap")[0]+".refmap"): +@@ -484,9 +485,8 @@ def get_gtf_chrom_info(gtf_filename, known_chrom_info=None): + + def header_for_chrom_info(chrom_info): + header_strs = ["""@HD\tVN:1.0\tSO:coordinate"""] +- chrom_list = [(chrom, limits) for chrom, limits in chrom_info.iteritems()] +- chrom_list.sort(lambda x,y: cmp(x[0],y[0])) +- #print chrom_list ++ chrom_list = sorted(chrom_info.items(), key=itemgetter(0)) ++ #print(chrom_list) + for chrom, limits in chrom_list: + line = "@SQ\tSN:%s\tLN:\t%d" % (chrom, limits[1]) + header_strs.append(line) +@@ -510,29 +510,29 @@ def main(argv=None): + params.check() + + if len(args) < 1: +- raise(Usage(help_message)) ++ raise Usage(help_message) + + global run_log + global run_cmd + +- print >> sys.stderr +- print >> sys.stderr, "[%s] Beginning transcriptome assembly merge" % (right_now()) +- print >> sys.stderr, "-------------------------------------------" +- print >> sys.stderr ++ print(file=sys.stderr) ++ print("[%s] Beginning transcriptome assembly merge" % (right_now()), file=sys.stderr) ++ print("-------------------------------------------", file=sys.stderr) ++ print(file=sys.stderr) + + start_time = datetime.now() + prepare_output_dir() + + run_log = open(logging_dir + "run.log", "w", 0) + run_cmd = " ".join(argv) +- print >> run_log, run_cmd ++ print(run_cmd, file=run_log) + + transfrag_list_file = open(args[0], "r") + + if params.ref_gtf != None: + test_input_files([params.ref_gtf]) + else: +- print >> sys.stderr, "Warning: no reference GTF provided!" ++ print("Warning: no reference GTF provided!", file=sys.stderr) + + # Check that all the primary assemblies are accessible before starting the time consuming stuff + gtf_input_files = test_input_files(transfrag_list_file) +@@ -571,8 +571,8 @@ def main(argv=None): + os.remove(output_dir + "/skipped.gtf") + os.remove(output_dir + "/genes.fpkm_tracking") + os.remove(output_dir + "/isoforms.fpkm_tracking") +- except Usage, err: +- print >> sys.stderr, sys.argv[0].split("/")[-1] + ": " + str(err.msg) ++ except Usage as err: ++ print(sys.argv[0].split("/")[-1] + ": " + str(err.msg), file=sys.stderr) + return 2 + + diff --git a/0008-boost_bind_header.patch b/0008-boost_bind_header.patch new file mode 100644 index 0000000000000000000000000000000000000000..f0929d9a738c3867b62244d66d1fe66af73a2e0a --- /dev/null +++ b/0008-boost_bind_header.patch @@ -0,0 +1,46 @@ +diff --git a/src/bundles.h b/src/bundles.h +index e7caf06..6fb8681 100644 +--- a/src/bundles.h ++++ b/src/bundles.h +@@ -12,7 +12,7 @@ + #ifdef HAVE_CONFIG_H + #include + #endif +-#include ++#include + #include + #include + #include +diff --git a/src/cuffquant.cpp b/src/cuffquant.cpp +index 2634e98..5c5ffd2 100644 +--- a/src/cuffquant.cpp ++++ b/src/cuffquant.cpp +@@ -43,6 +43,7 @@ vector sample_labels; + + using namespace std; + using namespace boost; ++using namespace boost::placeholders; + + // We leave out the short codes for options that don't take an argument + #if ENABLE_THREADS +diff --git a/src/transitive_closure.h b/src/transitive_closure.h +index fc23976..d982396 100644 +--- a/src/transitive_closure.h ++++ b/src/transitive_closure.h +@@ -27,7 +27,7 @@ + #include // for std::min and std::max + #include + #include +-#include ++#include + #include + #include + #include +@@ -35,6 +35,7 @@ + #include + + using namespace boost; ++using namespace boost::placeholders; + + typedef uint16_t v_id_size_type; + diff --git a/cufflinks-2.2.1.tar.gz b/cufflinks-2.2.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..ac218d1b55bc295ae1882ea0b70d48f2f265d7f8 Binary files /dev/null and b/cufflinks-2.2.1.tar.gz differ diff --git a/cufflinks.spec b/cufflinks.spec new file mode 100644 index 0000000000000000000000000000000000000000..9a3ad176c1683c15822e771b608facf41b2d50b3 --- /dev/null +++ b/cufflinks.spec @@ -0,0 +1,65 @@ +Name: cufflinks +Version: 2.2.1 +Release: 1 +Summary: Transcriptome assembly and differential expression analysis for RNA-Seq. + +License: GPL-3.0-only and BSL-1.0 +URL: http://cole-trapnell-lab.github.io/%{name}/ +Source0: https://github.com/cole-trapnell-lab/%{name}/archive/refs/tags/%{name}-%{version}.tar.gz + +Patch0: 0001-fix_spelling.patch +Patch1: 0002-fix_includes_path.patch +Patch2: 0003-fix_boost_tr1_path.patch +Patch3: 0004-return_with_novalue.patch +Patch4: 0005-fix_no_hash_member.patch +Patch5: 0006-format-security.patch +Patch6: 0007-py2to3.patch +Patch7: 0008-boost_bind_header.patch + +BuildRequires: boost boost-serialization boost-system boost-thread boost-devel samtools samtools-devel htslib htslib-devel +BuildRequires: gcc gcc-c++ gcc-gfortran make autoconf gmp mpfr openmpi java-1.8.0-openjdk-headless +BuildRequires: python3 ncurses-devel eigen3-devel xz-devel bzip2-devel zlib-devel + +Recommends: gffread + +%description +Cufflinks assembles transcripts, estimates their abundances, and tests for +differential expression and regulation in RNA-Seq samples. It accepts aligned +RNA-Seq reads and assembles the alignments into a parsimonious set of transcripts. +Cufflinks then estimates the relative abundances of these transcripts based on +how many reads support each one, taking into account biases in library +preparation protocols. + +%prep +%autosetup -p1 + +%build +autoreconf --install >/dev/null 2>&1 +if ! ./configure \ + --prefix=%{_prefix} \ +%ifarch aarch64 + --build=arm \ +%endif + --with-boost --with-eigen --with-bam \ + LIBS="-lboost_system -lboost_thread -lboost_serialization" \ + PYTHON="$(command -v python3)"; then + : cat log + cat config.log +fi + +%make_build CXXFLAGS="-I/usr/include/eigen3 -lhts -L%{_libdir} -lpthread" + +%install +%make_install +# skip gffread binary provided by gffread package +find %{buildroot}/%{_bindir}/ -type f -name gffread -delete + +%files +%license LICENSE +%doc README AUTHORS doc +%{_bindir}/* + + +%changelog +* Wed Mar 24 2021 He Rengui - 2.2.1-1 +- Package init