This commit is contained in:
He Rengui 2021-03-30 16:17:39 +08:00
parent b6046bf2c8
commit 3f22db1fe6
10 changed files with 947 additions and 0 deletions

65
0001-fix_spelling.patch Normal file
View File

@ -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<MateHit>& nr_alignments,
vector<double> 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;

View File

@ -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 <Eigen/Dense>
+@%:@include <eigen3/Eigen/Dense>
]], [[
]])],[
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 <Eigen/Dense>
+#include <eigen3/Eigen/Dense>
//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 <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/vector.hpp>
-#include <Eigen/Dense>
+#include <eigen3/Eigen/Dense>
#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 <boost/numeric/ublas/io.hpp>
#include <vector>
-#include <Eigen/Dense>
+#include <eigen3/Eigen/Dense>
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 <boost/random/variate_generator.hpp>
#include <boost/math/constants/constants.hpp>
-#include <Eigen/Dense>
+#include <eigen3/Eigen/Dense>
// Boost Cholesky factorizations in the spirit of lu.hpp
// Written by Robbie Vogt, found at:

View File

@ -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 <vector>
#include <list>
#include <string>
-#include <boost/tr1/unordered_map.hpp>
+#include <boost/unordered_map.hpp>
#include <boost/thread.hpp>
#include "common.h"

View File

@ -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 (...) {}
}

View File

@ -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<fCapacity && hash[pos].hash<0) pos++;
+ while (pos<fCapacity && (hash[pos].hash)<0) pos++;
if (pos==fCapacity) {
fCurrentEntry=fCapacity;
return NULL;
@@ -146,7 +146,7 @@ template <class OBJ> GHash<OBJ>::GHash(GFreeProc* freeProc) {
fFreeProc=freeProc;
lastkeyptr=NULL;
for (uint i=0; i<DEF_HASH_SIZE; i++)
- hash[i].hash=-1; //this will be an indicator for 'empty' entries
+ (hash[i].hash)=-1; //this will be an indicator for 'empty' entries
fCapacity=DEF_HASH_SIZE;
fCount=0;
}
@@ -157,7 +157,7 @@ template <class OBJ> GHash<OBJ>::GHash(bool doFree) {
lastkeyptr=NULL;
fFreeProc = (doFree)?&DefaultFreeProc : NULL;
for (uint i=0; i<DEF_HASH_SIZE; i++)
- hash[i].hash=-1; //this will be an indicator for 'empty' entries
+ (hash[i].hash)=-1; //this will be an indicator for 'empty' entries
fCapacity=DEF_HASH_SIZE;
fCount=0;
}
@@ -177,16 +177,16 @@ template <class OBJ> void GHash<OBJ>::Resize(int m){
if(n!=fCapacity){
GASSERT(m<=n);
GMALLOC(k, sizeof(GHashEntry)*n);
- for(i=0; i<n; i++) k[i].hash=-1;
+ for(i=0; i<n; i++) (k[i].hash)=-1;
for(i=0; i<fCapacity; i++){
- h=hash[i].hash;
+ h=(hash[i].hash);
if(0<=h){
p=HASH1(h,n);
GASSERT(0<=p && p<n);
x=HASH2(h,n);
GASSERT(1<=x && x<n);
- while(k[p].hash!=-1) p=(p+x)%n;
- GASSERT(k[p].hash<0);
+ while((k[p].hash)!=-1) p=(p+x)%n;
+ GASSERT((k[p].hash)<0);
k[p]=hash[i];
}
}
@@ -210,9 +210,9 @@ template <class OBJ> const OBJ* GHash<OBJ>::Add(const char* ky,
GASSERT(1<=x && x<fCapacity);
i=-1;
n=fCapacity;
- while(n && hash[p].hash!=-1){
- if ((i==-1)&&(hash[p].hash==-2)) i=p;
- if (hash[p].hash==h && strcmp(hash[p].key,ky)==0) {
+ while(n && (hash[p].hash)!=-1){
+ if ((i==-1)&&((hash[p].hash)==-2)) i=p;
+ if ((hash[p].hash)==h && strcmp(hash[p].key,ky)==0) {
//replace hash data for this key!
lastkeyptr=hash[p].key;
hash[p].data = (void*) pdata;
@@ -225,8 +225,8 @@ template <class OBJ> const OBJ* GHash<OBJ>::Add(const char* ky,
GTRACE(("GHash::insert: key=\"%s\"\n",ky));
//GMessage("GHash::insert: key=\"%s\"\n",ky);
GASSERT(0<=i && i<fCapacity);
- GASSERT(hash[i].hash<0);
- hash[i].hash=h;
+ GASSERT((hash[i].hash)<0);
+ (hash[i].hash)=h;
hash[i].mark=mrk;
hash[i].key=Gstrdup(ky);
hash[i].keyalloc=true;
@@ -251,9 +251,9 @@ template <class OBJ> const OBJ* GHash<OBJ>::shkAdd(const char* ky,
GASSERT(1<=x && x<fCapacity);
i=-1;
n=fCapacity;
- while(n && hash[p].hash!=-1){
- if((i==-1)&&(hash[p].hash==-2)) i=p;
- if(hash[p].hash==h && strcmp(hash[p].key,ky)==0){
+ while(n && (hash[p].hash)!=-1){
+ if((i==-1)&&((hash[p].hash)==-2)) i=p;
+ if((hash[p].hash)==h && strcmp(hash[p].key,ky)==0){
//replace hash data for this key!
lastkeyptr=hash[p].key;
hash[p].data = (void*) pdata;
@@ -266,8 +266,8 @@ template <class OBJ> const OBJ* GHash<OBJ>::shkAdd(const char* ky,
GTRACE(("GHash::insert: key=\"%s\"\n",ky));
//GMessage("GHash::insert: key=\"%s\"\n",ky);
GASSERT(0<=i && i<fCapacity);
- GASSERT(hash[i].hash<0);
- hash[i].hash=h;
+ GASSERT((hash[i].hash)<0);
+ (hash[i].hash)=h;
hash[i].mark=mrk;
hash[i].key=(char *)ky;
lastkeyptr=hash[i].key;
@@ -293,9 +293,9 @@ template <class OBJ> OBJ* GHash<OBJ>::Replace(const char* ky,const OBJ* pdata,
GASSERT(1<=x && x<fCapacity);
i=-1;
n=fCapacity;
- while(n && hash[p].hash!=-1){
- if((i==-1)&&(hash[p].hash==-2)) i=p;
- if(hash[p].hash==h && strcmp(hash[p].key,ky)==0){
+ while(n && (hash[p].hash)!=-1){
+ if((i==-1)&&((hash[p].hash)==-2)) i=p;
+ if((hash[p].hash)==h && strcmp(hash[p].key,ky)==0){
if(hash[p].mark<=mrk){
GTRACE(("GHash::replace: %08x: replacing: \"%s\"\n",this,ky));
if (FREEDATA) (*fFreeProc)(hash[p].data);
@@ -310,8 +310,8 @@ template <class OBJ> OBJ* GHash<OBJ>::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<fCapacity);
- GASSERT(hash[i].hash<0);
- hash[i].hash=h;
+ GASSERT((hash[i].hash)<0);
+ (hash[i].hash)=h;
hash[i].mark=mrk;
hash[i].key=Gstrdup(ky);
hash[i].data=pdata;
@@ -335,10 +335,10 @@ template <class OBJ> OBJ* GHash<OBJ>::Remove(const char* ky){
GASSERT(1<=x && x<fCapacity);
GASSERT(fCount<fCapacity);
n=fCapacity;
- while(n && hash[p].hash!=-1){
- if(hash[p].hash==h && strcmp(hash[p].key,ky)==0){
+ while(n && (hash[p].hash)!=-1){
+ if((hash[p].hash)==h && strcmp(hash[p].key,ky)==0){
GTRACE(("GHash::remove: %08x removing: \"%s\"\n",this,ky));
- hash[p].hash=-2;
+ (hash[p].hash)=-2;
hash[p].mark=false;
if (hash[p].keyalloc) GFREE((hash[p].key));
if (FREEDATA) (*fFreeProc)(hash[p].data);
@@ -370,8 +370,8 @@ template <class OBJ> bool GHash<OBJ>::hasKey(const char* ky) {
GASSERT(1<=x && x<fCapacity);
GASSERT(fCount<fCapacity);
n=fCapacity;
- while(n && hash[p].hash!=-1){
- if(hash[p].hash==h && strcmp(hash[p].key,ky)==0){
+ while(n && (hash[p].hash)!=-1){
+ if((hash[p].hash)==h && strcmp(hash[p].key,ky)==0){
return true;
}
p=(p+x)%fCapacity;
@@ -393,8 +393,8 @@ template <class OBJ> OBJ* GHash<OBJ>::Find(const char* ky, char** keyptr){
GASSERT(1<=x && x<fCapacity);
GASSERT(fCount<fCapacity);
n=fCapacity;
- while(n && hash[p].hash!=-1){
- if(hash[p].hash==h && strcmp(hash[p].key,ky)==0){
+ while(n && (hash[p].hash)!=-1){
+ if((hash[p].hash)==h && strcmp(hash[p].key,ky)==0){
if (keyptr!=NULL) *keyptr = hash[p].key;
return (OBJ*)hash[p].data;
}
@@ -412,7 +412,7 @@ template <class OBJ> void GHash<OBJ>::startIterate() {// initialize a key iterat
template <class OBJ> char* GHash<OBJ>::NextKey() {
register int pos=fCurrentEntry;
- while (pos<fCapacity && hash[pos].hash<0) pos++;
+ while (pos<fCapacity && (hash[pos].hash)<0) pos++;
if (pos==fCapacity) {
fCurrentEntry=fCapacity;
return NULL;
@@ -425,7 +425,7 @@ template <class OBJ> char* GHash<OBJ>::NextKey() {
template <class OBJ> OBJ* GHash<OBJ>::NextData() {
register int pos=fCurrentEntry;
- while (pos<fCapacity && hash[pos].hash<0) pos++;
+ while (pos<fCapacity && (hash[pos].hash)<0) pos++;
if (pos==fCapacity) {
fCurrentEntry=fCapacity;
return NULL;
@@ -439,7 +439,7 @@ template <class OBJ> OBJ* GHash<OBJ>::NextData() {
template <class OBJ> OBJ* GHash<OBJ>::NextData(char* &nextkey) {
register int pos=fCurrentEntry;
- while (pos<fCapacity && hash[pos].hash<0) pos++;
+ while (pos<fCapacity && (hash[pos].hash)<0) pos++;
if (pos==fCapacity) {
fCurrentEntry=fCapacity;
nextkey=NULL;
@@ -457,8 +457,8 @@ template <class OBJ> OBJ* GHash<OBJ>::NextData(char* &nextkey) {
// Get first non-empty entry
template <class OBJ> int GHash<OBJ>::First() const {
register int pos=0;
- while(pos<fCapacity){ if(0<=hash[pos].hash) break; pos++; }
- GASSERT(fCapacity<=pos || 0<=hash[pos].hash);
+ while(pos<fCapacity){ if(0<=(hash[pos].hash)) break; pos++; }
+ GASSERT(fCapacity<=pos || 0<=(hash[pos].hash));
return pos;
}
@@ -474,8 +474,8 @@ template <class OBJ> int GHash<OBJ>::Last() const {
// Find next valid entry
template <class OBJ> int GHash<OBJ>::Next(int pos) const {
GASSERT(0<=pos && pos<fCapacity);
- while(++pos <= fCapacity-1){ if(0<=hash[pos].hash) break; }
- GASSERT(fCapacity<=pos || 0<=hash[pos].hash);
+ while(++pos <= fCapacity-1){ if(0<=(hash[pos].hash)) break; }
+ GASSERT(fCapacity<=pos || 0<=(hash[pos].hash));
return pos;
}
@@ -483,8 +483,8 @@ template <class OBJ> int GHash<OBJ>::Next(int pos) const {
// Find previous valid entry
template <class OBJ> int GHash<OBJ>::Prev(int pos) const {
GASSERT(0<=pos && pos<fCapacity);
- while(--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 <class OBJ> int GHash<OBJ>::Prev(int pos) const {
template <class OBJ> void GHash<OBJ>::Clear(){
register int i;
for(i=0; i<fCapacity; i++){
- if(hash[i].hash>=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 <class OBJ> void GHash<OBJ>::Clear(){
GMALLOC(hash, sizeof(GHashEntry)*DEF_HASH_SIZE);
//reinitialize it
for (i=0; i<DEF_HASH_SIZE; i++)
- hash[i].hash=-1; //this will be an indicator for 'empty' entries
+ (hash[i].hash)=-1; //this will be an indicator for 'empty' entries
fCapacity=DEF_HASH_SIZE;
fCount=0;
}
@@ -517,7 +517,7 @@ void GHash::Save(Stream& store) const {
store << fCount;
for(int i=0; i<fCapacity; i++){
store << hash[i].hash;
- if(hash[i].hash>=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<fCapacity; i++){
store >> 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 <class OBJ> GHash<OBJ>::~GHash(){
register int i;
for(i=0; i<fCapacity; i++){
- if(hash[i].hash>=0){
+ if((hash[i].hash)>=0){
if (hash[i].keyalloc) GFREE((hash[i].key));
if (FREEDATA) (*fFreeProc)(hash[i].data);
}

View File

@ -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);

399
0007-py2to3.patch Normal file
View File

@ -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

View File

@ -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 <config.h>
#endif
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <boost/random.hpp>
#include <vector>
#include <numeric>
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<string> 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 <algorithm> // for std::min and std::max
#include <functional>
#include <boost/config.hpp>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <boost/graph/vector_as_graph.hpp>
#include <boost/graph/strong_components.hpp>
#include <boost/graph/topological_sort.hpp>
@@ -35,6 +35,7 @@
#include <boost/graph/named_function_params.hpp>
using namespace boost;
+using namespace boost::placeholders;
typedef uint16_t v_id_size_type;

BIN
cufflinks-2.2.1.tar.gz Normal file

Binary file not shown.

65
cufflinks.spec Normal file
View File

@ -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 <herengui@uniontech.com> - 2.2.1-1
- Package init