diff --git a/setup.py b/setup.py index f5283e1..8b08e6f 100644 --- a/setup.py +++ b/setup.py @@ -102,6 +102,9 @@ class build_scripts(ori_build_scripts): file, oldmode, newmode) os.chmod(file, newmode) +class build_filters(build_scripts): + pass + def findPackage(root,base=None): modules=[] @@ -127,6 +130,8 @@ def findCython(root,base=None,pyrexs=None): for pyrex in glob.glob(path.join(root,module,'*.pyx')): pyrexs.append(Extension('.'.join(base+[module,path.splitext(path.basename(pyrex))[0]]),[pyrex])) + pyrexs[-1].sources.extend(glob.glob(os.path.splitext(pyrex)[0]+'.*.c')) + print pyrexs[-1].sources Main.compile([pyrex],timestamps=True,recursion=True) pyrexs.extend(findCython(path.join(root,module),base+[module])) @@ -147,18 +152,26 @@ def findC(root,base=None,pyrexs=None): return pyrexs -VERSION = '0.1.999' +VERSION = '0.2.000' AUTHOR = 'Eric Coissac' EMAIL = 'eric@coissac.eu' URL = 'www.grenoble.prabi.fr/trac/OBITools' LICENSE = 'CeCILL-V2' -SRC = 'src' +SRC = 'src' +FILTERSRC = 'textwrangler/filter' SCRIPTS = glob.glob('%s/*.py' % SRC) +FILTERS = glob.glob('%s/*.py' % FILTERSRC) + +def rootname(x): + return os.path.splitext(x.sources[0])[0] if has_cython: EXTENTION=findCython(SRC) + CEXTENTION=findC(SRC) + cython_ext = set(rootname(x) for x in EXTENTION) + EXTENTION.extend(x for x in CEXTENTION if rootname(x) not in cython_ext) else: EXTENTION=findC(SRC) diff --git a/src/ace2fasta.py b/src/ace2fasta.py index 63bd9b2..0abf002 100644 --- a/src/ace2fasta.py +++ b/src/ace2fasta.py @@ -3,8 +3,6 @@ from obitools.fasta import formatFasta from obitools.alignment.ace import contigIterator -import sys -from logging import root,DEBUG from obitools.options import getOptionManager diff --git a/src/embl2fasta.py b/src/embl2fasta.py deleted file mode 100755 index 8917d3e..0000000 --- a/src/embl2fasta.py +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/local/bin/python - -import re - -def igrep(lines,pattern,exclude=False): - """ - igrep emule la commande unix grep. - - @param lines: une collection de string - @type lines: iterator on str - @param pattern: une expression reguliere - @type pattern: str - - @return: un iterateur sur le sous ensemble - des lignes possedant au moins une occurence - du pattern - - @rtype: iterator on str - """ - automate = re.compile(pattern) - for l in lines: - match = automate.search(l) is not None - out = (match and not exclude) or (not match and exclude) - if out: - yield l - -def wordIterator(sequence,lword,step=1,endIncluded=False): - L = len(sequence) - - if endIncluded: - pmax=L - else: - pmax = L - lword + 1 - - pos = xrange(0,pmax,step) - - for x in pos: - yield sequence[x:x+lword] - - - -def fastaFormat(title,sequence): - width = 50 - fasta = '>' + title + '\n' - iwords= wordIterator(sequence,width,width,True) - words =[w for w in iwords] - seq = '\n'.join(words) - return fasta + seq - -def isqlines(lines): - for l in igrep(lines,'^ '): - yield l - -def icleanSqLines(lines): - sq = isqlines(lines) - bad = re.compile('[ \t\n0-9]+') - - for line in sq: - yield bad.sub('',line) - -def getSeq(lines): - sq = icleanSqLines(lines) - allsq = [x for x in sq] - seq = ''.join(allsq) - return seq - - - -if __name__=='__main__': - - # ici commence le main de mon script - - import sys - import optparse - - parser = optparse.OptionParser() - - parser.add_option("-b", "--begin", - type="int", dest="begin", - default=1, - help="start position of the cutted fragment") - - parser.add_option("-e", "--end", - type="int", dest="end", - help="end position of the cutted fragment") - - parser.add_option("-t", "--title", - dest="title", - help="title line of the fasta output") - - (options, args) = parser.parse_args() - - - if len(args) > 0: - filename = args[0] - f = open(filename) - else: - f = sys.stdin - - sq = getSeq(f) - - start = options.begin - 1 - stop = options.end - - subseq= sq[start:stop] - - fasta = fastaFormat(options.title,subseq) - - print fasta - diff --git a/src/obiselect.py b/src/obiselect.py new file mode 100644 index 0000000..cc8b187 --- /dev/null +++ b/src/obiselect.py @@ -0,0 +1,34 @@ +#!/usr/local/bin/python +''' +Created on 6 juil. 2010 + +@author: coissac +''' +from obitools.format.options import addInOutputOption, printOutput +from obitools.options import getOptionManager +from obitools.format.sequence import autoSequenceIterator + +def addSelectOptions(optionManager): + + optionManager.add_option('-i','--identifier', + action="store", dest="identifier", + metavar="", + type="string", + default=None, + help="file containing sample sequences to select on " + "on the base of their identifier") + + + + +if __name__ == '__main__': + optionParser = getOptionManager([addSelectOptions,addInOutputOption]) + + (options, entries) = optionParser() + + idset=set(x.id for x in autoSequenceIterator(options.identifier)) + + for seq in entries: + if seq.id in idset: + printOutput(options,seq) + diff --git a/src/obitools/align/_assemble.c b/src/obitools/align/_assemble.c index 8c5c00c..f6f9c37 100644 --- a/src/obitools/align/_assemble.c +++ b/src/obitools/align/_assemble.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.12 on Wed May 5 00:11:20 2010 */ +/* Generated by Cython 0.12 on Sat Jun 19 12:17:43 2010 */ #define PY_SSIZE_T_CLEAN #include "Python.h" diff --git a/src/obitools/align/_dynamic.c b/src/obitools/align/_dynamic.c index 25a1e8f..4e9bc7e 100644 --- a/src/obitools/align/_dynamic.c +++ b/src/obitools/align/_dynamic.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.12 on Wed May 5 00:11:21 2010 */ +/* Generated by Cython 0.12 on Sat Jun 19 12:17:43 2010 */ #define PY_SSIZE_T_CLEAN #include "Python.h" diff --git a/src/obitools/align/_freeendgap.c b/src/obitools/align/_freeendgap.c index 5b81733..39d5dbc 100644 --- a/src/obitools/align/_freeendgap.c +++ b/src/obitools/align/_freeendgap.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.12 on Wed May 5 00:11:21 2010 */ +/* Generated by Cython 0.12 on Sat Jun 19 12:17:43 2010 */ #define PY_SSIZE_T_CLEAN #include "Python.h" diff --git a/src/obitools/align/_lcs.c b/src/obitools/align/_lcs.c index 6a28886..cd9366a 100644 --- a/src/obitools/align/_lcs.c +++ b/src/obitools/align/_lcs.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.12 on Wed May 5 00:11:21 2010 */ +/* Generated by Cython 0.12 on Mon Jun 28 17:32:13 2010 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -139,6 +139,7 @@ #endif #include #define __PYX_HAVE_API__obitools__align___lcs +#include "_lcs.h" #include "stdlib.h" #include "string.h" @@ -1752,10 +1753,10 @@ PyMODINIT_FUNC PyInit__lcs(void) Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Execution code ---*/ - /* "/Users/coissac/encours/OBITools/src/obitools/align/_dynamic.pxd":1 - * cdef import from "stdlib.h": # <<<<<<<<<<<<<< - * void* malloc(int size) except NULL - * void* realloc(void* chunk,int size) except NULL + /* "/Users/coissac/encours/OBITools/src/obitools/align/_lcs.pxd":1 + * cdef extern from *: # <<<<<<<<<<<<<< + * ctypedef char* const_char_ptr "const char*" + * */ goto __pyx_L0; __pyx_L1_error:; diff --git a/src/obitools/align/_lcs.ext.1.c b/src/obitools/align/_lcs.ext.1.c new file mode 100644 index 0000000..cf3d6a5 --- /dev/null +++ b/src/obitools/align/_lcs.ext.1.c @@ -0,0 +1,106 @@ +#include "_lcs.h" +#include +#include +#include +#include +#include + + +// Expands the 8 low weight 8 bit unsigned integer +// to 8 16bits signed integer + +static inline vInt16 expand_8_to_16(vUInt8 data) +{ + vUInt8 mask_00= _mm_setzero_si128(); + + return _mm_unpacklo_epi8(data,mask_00); +} + + +// Load an SSE register with the next 8 first symbols + +static inline vInt16 load8Symboles(const char* seq) +{ + vUInt8 s; + s = _mm_loadu_si128((vUInt8*)seq); + return expand_8_to_16(s); +} + + +// Allocate a band allowing to align sequences of length : 'length' + +static inline band_t* allocateBand(int length,band_t *band) +{ + int size; + + size = (length + 7) * sizeof(vInt16); + + if (band==NULL) + { + band = malloc(sizeof(band_t)); + if (!band) + return NULL; + + if ((posix_memalign(&(band->band),16,size)) || + (!(band->band))) + { + free(band); + return NULL; + } + + band->size = length; + } + else if (length > band->size) + { + vInt16 *old = band->band; + if ((posix_memalign(&(band->band),16,size)) || + (!(band->band))) + { + band->band=old; + return NULL; + } + band->size=length; + free(old); + } + + + // SHRT_MIN + + return band; +} + +int fastLCSScore(const char* seq1, const char* seq2,band_t **band) +{ + int lseq1,lseq2; // length of the both sequences + + int itmp; // tmp variables for swap + const char* stmp; // + + int nbands; // Number of bands of width eight in the score matrix + int lastband; // width of the last band + + vInt16 *mainband; + int16_t *scores; + + + + // Made seq1 the shortest sequences + lseq1=strlen(seq1); + lseq2=strlen(seq2); + + if (lseq1 > lseq2) + { + itmp=lseq1; + lseq1=lseq2; + lseq2=itmp; + + stmp=seq1; + seq1=seq2; + seq2=stmp; + } + + nbands = lseq1 / 8; // You have 8 short int in a SSE register + lastband = lseq1 - (nbands * 8); + + +} diff --git a/src/obitools/align/_lcs.h b/src/obitools/align/_lcs.h new file mode 100644 index 0000000..cd50d0a --- /dev/null +++ b/src/obitools/align/_lcs.h @@ -0,0 +1,13 @@ +#include +#include + +#define ALIGN __attribute__((aligned(16))) +typedef __m128i vUInt8; +typedef __m128i vInt16; + +typedef struct { + int16_t size; + vInt16 *band; +} band_t; + +int fastLCSScore(const char* seq1, const char* seq2,band_t **band); diff --git a/src/obitools/align/_lcs.pxd b/src/obitools/align/_lcs.pxd new file mode 100644 index 0000000..7b6ba7c --- /dev/null +++ b/src/obitools/align/_lcs.pxd @@ -0,0 +1,6 @@ +cdef extern from *: + ctypedef char* const_char_ptr "const char*" + + +cdef import from "_lcs.h": + int fastLCSScore(const_char_ptr seq1, const_char_ptr seq2) diff --git a/src/obitools/align/_nws.c b/src/obitools/align/_nws.c index 92cad5a..112b79c 100644 --- a/src/obitools/align/_nws.c +++ b/src/obitools/align/_nws.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.12 on Wed May 5 00:11:21 2010 */ +/* Generated by Cython 0.12 on Sat Jun 19 12:17:43 2010 */ #define PY_SSIZE_T_CLEAN #include "Python.h" diff --git a/src/obitools/align/_qsassemble.c b/src/obitools/align/_qsassemble.c index 16caa8d..67e8650 100644 --- a/src/obitools/align/_qsassemble.c +++ b/src/obitools/align/_qsassemble.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.12 on Wed May 5 00:11:21 2010 */ +/* Generated by Cython 0.12 on Sat Jun 19 12:17:43 2010 */ #define PY_SSIZE_T_CLEAN #include "Python.h" diff --git a/src/obitools/align/_qsrassemble.c b/src/obitools/align/_qsrassemble.c index a9cab9b..983e981 100644 --- a/src/obitools/align/_qsrassemble.c +++ b/src/obitools/align/_qsrassemble.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.12 on Wed May 5 00:11:22 2010 */ +/* Generated by Cython 0.12 on Sat Jun 19 12:17:43 2010 */ #define PY_SSIZE_T_CLEAN #include "Python.h" diff --git a/src/obitools/align/_rassemble.c b/src/obitools/align/_rassemble.c index d01b87d..b806d08 100644 --- a/src/obitools/align/_rassemble.c +++ b/src/obitools/align/_rassemble.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.12 on Wed May 5 00:11:22 2010 */ +/* Generated by Cython 0.12 on Sat Jun 19 12:17:43 2010 */ #define PY_SSIZE_T_CLEAN #include "Python.h" diff --git a/src/obitools/align/_upperbond.c b/src/obitools/align/_upperbond.c index 040e471..d0644ce 100644 --- a/src/obitools/align/_upperbond.c +++ b/src/obitools/align/_upperbond.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.12 on Sun Jun 20 14:56:36 2010 */ +/* Generated by Cython 0.12 on Thu Jun 24 00:04:53 2010 */ #define PY_SSIZE_T_CLEAN #include "Python.h" diff --git a/src/obitools/align/_upperbond.ext.1.c b/src/obitools/align/_upperbond.ext.1.c index b979950..752fe08 100644 --- a/src/obitools/align/_upperbond.ext.1.c +++ b/src/obitools/align/_upperbond.ext.1.c @@ -39,13 +39,12 @@ inline static uchar_v hash4m128(uchar_v frag) { uchar_v words; - vUInt8 mask_06= _mm_set1_epi8(0x06); // charge le registre avec 16x le meme octet + vUInt8 mask_03= _mm_set1_epi8(0x03); // charge le registre avec 16x le meme octet vUInt8 mask_7F= _mm_set1_epi8(0x7F); vUInt8 mask_FC= _mm_set1_epi8(0xFC); - frag.m = _mm_and_si128(frag.m,mask_06); // and sur les 128 bits frag.m = _mm_srli_epi64(frag.m,1); // shift logic a droite sur 2 x 64 bits - frag.m = _mm_and_si128(frag.m,mask_7F); + frag.m = _mm_and_si128(frag.m,mask_03); // and sur les 128 bits words.m= _mm_slli_epi64(frag.m,2); @@ -98,7 +97,6 @@ int buildTable(const char* sequence, unsigned char *table, int *count) // encode ascii sequence with A : 00 C : 01 T: 10 G : 11 -// for(frag.m=loadm128(s);! anyzerom128(frag.m);s+=12,frag.m=loadm128(s)) for(frag.m=_mm_loadu_si128((vUInt8*)s); ! anyzerom128(frag.m); s+=12,frag.m=_mm_loadu_si128((vUInt8*)s)) diff --git a/src/obitools/alignment/__init__.py b/src/obitools/alignment/__init__.py index 49117c2..b053cac 100644 --- a/src/obitools/alignment/__init__.py +++ b/src/obitools/alignment/__init__.py @@ -144,7 +144,7 @@ class Alignment(list): return reduce(lambda x,y: x and y,(z=='-' for z in self.getSite(key)),True) def isGappedSite(self,key): - return reduce(lambda x,y: x or y,(z=='-' for z in self.getSite(key)),False) + return '-' in self.getSite(key) def __str__(self): l = len(self[0]) diff --git a/src/obitools/ecopcr/taxonomy.py b/src/obitools/ecopcr/taxonomy.py index 12aa2cf..744f704 100644 --- a/src/obitools/ecopcr/taxonomy.py +++ b/src/obitools/ecopcr/taxonomy.py @@ -105,6 +105,13 @@ class Taxonomy(object): return ancetre + def betterCommonTaxon(self,error=1,*taxids): + lca = self.lastCommonTaxon(*taxids) + idx = self._index[lca] + sublca = [t[0] for t in self._taxonomy if t[2]==idx] + dist={} + return sublca + def getScientificName(self,taxid): return self.findTaxonByTaxid(taxid)[3] @@ -139,6 +146,18 @@ class Taxonomy(object): for x in imap(None,self._ranks,xrange(len(self._ranks))): yield x + def groupTaxa(self,taxa,groupname): + t=[self.findTaxonByTaxid(x) for x in taxa] + a=set(x[2] for x in t) + assert len(a)==1,"All taxa must have the same parent" + newtaxid=max([2999999]+[x[0] for x in self._taxonomy if x[0]>=3000000 and x[0]<4000000])+1 + newidx=len(self._taxonomy) + if 'MOTU' not in self._ranks: + self._ranks.append('MOTU') + rankid=self._ranks.index('MOTU') + self._taxonomy.append((newtaxid,rankid,a.pop(),groupname)) + for x in t: + x[2]=newidx class EcoTaxonomyDB(Taxonomy,EcoPCRDBFile): ''' diff --git a/src/obitools/fasta/__init__.py b/src/obitools/fasta/__init__.py index df26f3f..42c84d4 100644 --- a/src/obitools/fasta/__init__.py +++ b/src/obitools/fasta/__init__.py @@ -138,7 +138,7 @@ def fastaAAIterator(file,tagparser=_parseFastaTag): ''' return fastaIterator(file, AASequence,tagparser) -def formatFasta(data,gbmode=False): +def formatFasta(data,gbmode=False,upper=False): ''' Convert a seqence or a set of sequences in a string following the fasta format @@ -164,7 +164,10 @@ def formatFasta(data,gbmode=False): definition='' else: definition=sequence.definition - frgseq = '\n'.join([seq[x:x+60] for x in xrange(0,len(seq),60)]) + if upper: + frgseq = '\n'.join([seq[x:x+60].upper() for x in xrange(0,len(seq),60)]) + else: + frgseq = '\n'.join([seq[x:x+60] for x in xrange(0,len(seq),60)]) info='; '.join(['%s=%s' % x for x in sequence.rawiteritems()]) if info: info=info+';' diff --git a/src/obitools/fasta/_fasta.c b/src/obitools/fasta/_fasta.c index 8067316..fb29326 100644 --- a/src/obitools/fasta/_fasta.c +++ b/src/obitools/fasta/_fasta.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.12 on Mon May 17 13:45:18 2010 */ +/* Generated by Cython 0.12 on Sat Jun 19 12:17:44 2010 */ #define PY_SSIZE_T_CLEAN #include "Python.h" diff --git a/src/obitools/fastq/_fastq.c b/src/obitools/fastq/_fastq.c index 2e68b62..cf1571b 100644 --- a/src/obitools/fastq/_fastq.c +++ b/src/obitools/fastq/_fastq.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.12 on Mon May 17 15:48:44 2010 */ +/* Generated by Cython 0.12.1 on Wed Jul 7 06:55:51 2010 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -6,6 +6,7 @@ #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #else + #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif @@ -17,6 +18,7 @@ #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) #define PyDict_Contains(d,o) PySequence_Contains(d,o) #endif + #if PY_VERSION_HEX < 0x02050000 typedef int Py_ssize_t; #define PY_SSIZE_T_MAX INT_MAX @@ -26,7 +28,9 @@ #define PyInt_AsSsize_t(o) PyInt_AsLong(o) #define PyNumber_Index(o) PyNumber_Int(o) #define PyIndex_Check(o) PyNumber_Check(o) + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) #endif + #if PY_VERSION_HEX < 0x02060000 #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) @@ -36,17 +40,17 @@ #define PyType_Modified(t) typedef struct { - void *buf; - PyObject *obj; - Py_ssize_t len; - Py_ssize_t itemsize; - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; } Py_buffer; #define PyBUF_SIMPLE 0 @@ -60,18 +64,22 @@ #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) #endif + #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #endif + #if PY_MAJOR_VERSION >= 3 #define Py_TPFLAGS_CHECKTYPES 0 #define Py_TPFLAGS_HAVE_INDEX 0 #endif + #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif + #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyString_Type PyUnicode_Type @@ -80,6 +88,7 @@ #define PyBytes_Type PyString_Type #define PyBytes_CheckExact PyString_CheckExact #endif + #if PY_MAJOR_VERSION >= 3 #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) @@ -99,10 +108,13 @@ #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) + #endif + #if PY_MAJOR_VERSION >= 3 #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func) #endif + #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall @@ -116,6 +128,7 @@ #else #define _USE_MATH_DEFINES #endif + #if PY_VERSION_HEX < 0x02050000 #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) @@ -125,6 +138,7 @@ #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) #endif + #if PY_VERSION_HEX < 0x02050000 #define __Pyx_NAMESTR(n) ((char *)(n)) #define __Pyx_DOCSTR(n) ((char *)(n)) @@ -144,12 +158,14 @@ #include "math.h" #include "string.h" -#ifdef __GNUC__ -#define INLINE __inline__ -#elif _WIN32 -#define INLINE __inline -#else -#define INLINE +#ifndef CYTHON_INLINE + #if defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #else + #define CYTHON_INLINE + #endif #endif typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ @@ -171,8 +187,8 @@ typedef struct {PyObject **p; char *s; const long n; const char* encoding; const #define __Pyx_PyBytes_AsUString(s) ((unsigned char*) __Pyx_PyBytes_AsString(s)) #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) -static INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); #if !defined(T_PYSSIZET) #if PY_VERSION_HEX < 0x02050000 @@ -236,9 +252,9 @@ static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); #endif #endif -static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) @@ -295,7 +311,7 @@ struct __pyx_opt_args_8obitools_5fastq_6_fastq_fastqQualityDecoder { /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":170 * return code * - * cpdef str formatFastq(object data, bint gbmode=False): # <<<<<<<<<<<<<< + * cpdef str formatFastq(object data, bint gbmode=False, bint upper=False): # <<<<<<<<<<<<<< * cdef list rep=[] * cdef str seq */ @@ -303,9 +319,10 @@ struct __pyx_opt_args_8obitools_5fastq_6_fastq_fastqQualityDecoder { struct __pyx_opt_args_8obitools_5fastq_6_fastq_formatFastq { int __pyx_n; int gbmode; + int upper; }; -/* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":206 +/* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":208 * * * cdef enum FastqType: # <<<<<<<<<<<<<< @@ -318,7 +335,7 @@ enum __pyx_t_8obitools_5fastq_6_fastq_FastqType { __pyx_e_8obitools_5fastq_6_fastq_solexa }; -/* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":209 +/* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":211 * sanger,solexa * * cdef class fastqParserGenetator: # <<<<<<<<<<<<<< @@ -410,13 +427,13 @@ typedef struct { } __Pyx_BufFmt_StackElem; -static INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); static int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); static void __Pyx_RaiseBufferFallbackError(void); /*proto*/ -static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name); /*proto*/ @@ -426,22 +443,22 @@ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ -static INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); -static INLINE void __Pyx_RaiseTooManyValuesError(void); +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void); static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/ static int __Pyx_EndUnpack(PyObject *); /*proto*/ -static INLINE long __Pyx_NegateNonNeg(long b) { return unlikely(b < 0) ? b : !b; } -static INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) { +static CYTHON_INLINE long __Pyx_NegateNonNeg(long b) { return unlikely(b < 0) ? b : !b; } +static CYTHON_INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) { return unlikely(b < 0) ? NULL : __Pyx_PyBool_FromLong(b); } -static INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ -static INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); @@ -454,7 +471,7 @@ static INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { __Pyx_GetItemInt_List_Fast(o, i, size <= sizeof(long)) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int fits_long) { +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int fits_long) { if (likely(o != Py_None)) { if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); @@ -474,7 +491,7 @@ static INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, in __Pyx_GetItemInt_Tuple_Fast(o, i, size <= sizeof(long)) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int fits_long) { +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int fits_long) { if (likely(o != Py_None)) { if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); @@ -495,7 +512,7 @@ static INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, i __Pyx_GetItemInt_Fast(o, i, size <= sizeof(long)) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int fits_long) { +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int fits_long) { PyObject *r; if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) { r = PyList_GET_ITEM(o, i); @@ -531,39 +548,39 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ -static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); +static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); -static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); +static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); -static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); +static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); -static INLINE char __Pyx_PyInt_AsChar(PyObject *); +static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *); -static INLINE short __Pyx_PyInt_AsShort(PyObject *); +static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *); -static INLINE int __Pyx_PyInt_AsInt(PyObject *); +static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *); -static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); +static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); -static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); +static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); -static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); +static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); -static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); +static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); -static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); +static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); -static INLINE long __Pyx_PyInt_AsLong(PyObject *); +static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *); -static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); +static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); -static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); +static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); -static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); +static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size); /*proto*/ +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size, int strict); /*proto*/ static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ @@ -582,12 +599,12 @@ static PyObject *(*__pyx_f_8obitools_5fasta_6_fasta_parseFastaDescription)(PyObj /* Module declarations from obitools.fastq.array */ static PyTypeObject *__pyx_ptype_8obitools_5fastq_5array_array = 0; -static INLINE arrayobject *__pyx_f_8obitools_5fastq_5array_zeros_like(arrayobject *); /*proto*/ -static INLINE arrayobject *__pyx_f_8obitools_5fastq_5array_empty_like(arrayobject *); /*proto*/ -static INLINE arrayobject *__pyx_f_8obitools_5fastq_5array_copy(arrayobject *); /*proto*/ -static INLINE int __pyx_f_8obitools_5fastq_5array_extend_buffer(arrayobject *, char *, Py_ssize_t); /*proto*/ -static INLINE int __pyx_f_8obitools_5fastq_5array_extend(arrayobject *, arrayobject *); /*proto*/ -static INLINE void __pyx_f_8obitools_5fastq_5array_zero(arrayobject *); /*proto*/ +static CYTHON_INLINE arrayobject *__pyx_f_8obitools_5fastq_5array_zeros_like(arrayobject *); /*proto*/ +static CYTHON_INLINE arrayobject *__pyx_f_8obitools_5fastq_5array_empty_like(arrayobject *); /*proto*/ +static CYTHON_INLINE arrayobject *__pyx_f_8obitools_5fastq_5array_copy(arrayobject *); /*proto*/ +static CYTHON_INLINE int __pyx_f_8obitools_5fastq_5array_extend_buffer(arrayobject *, char *, Py_ssize_t); /*proto*/ +static CYTHON_INLINE int __pyx_f_8obitools_5fastq_5array_extend(arrayobject *, arrayobject *); /*proto*/ +static CYTHON_INLINE void __pyx_f_8obitools_5fastq_5array_zero(arrayobject *); /*proto*/ /* Module declarations from obitools.fastq._fastq */ static PyTypeObject *__pyx_ptype_8obitools_5fastq_6_fastq_fastqParserGenetator = 0; @@ -635,6 +652,7 @@ static char __pyx_k__array[] = "array"; static char __pyx_k__range[] = "range"; static char __pyx_k__shape[] = "shape"; static char __pyx_k__split[] = "split"; +static char __pyx_k__upper[] = "upper"; static char __pyx_k__format[] = "format"; static char __pyx_k__gbmode[] = "gbmode"; static char __pyx_k__sanger[] = "sanger"; @@ -729,6 +747,7 @@ static PyObject *__pyx_n_s__strides; static PyObject *__pyx_n_s__suboffsets; static PyObject *__pyx_n_s__tagparser; static PyObject *__pyx_n_s__typecode; +static PyObject *__pyx_n_s__upper; static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_k_10; @@ -2248,8 +2267,7 @@ static PyObject *__pyx_f_8obitools_5fastq_6_fastq_errorToSangerFastQStr(arrayob * return code */ __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_result); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_DECREF(((PyObject *)__pyx_v_code)); __pyx_v_code = ((PyObject *)__pyx_t_2); __pyx_t_2 = 0; @@ -2268,7 +2286,7 @@ static PyObject *__pyx_f_8obitools_5fastq_6_fastq_errorToSangerFastQStr(arrayob * free(result) * return code # <<<<<<<<<<<<<< * - * cpdef str formatFastq(object data, bint gbmode=False): + * cpdef str formatFastq(object data, bint gbmode=False, bint upper=False): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_code)); @@ -2331,7 +2349,7 @@ static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_errorToSangerFastQStr(PyObjec /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":170 * return code * - * cpdef str formatFastq(object data, bint gbmode=False): # <<<<<<<<<<<<<< + * cpdef str formatFastq(object data, bint gbmode=False, bint upper=False): # <<<<<<<<<<<<<< * cdef list rep=[] * cdef str seq */ @@ -2339,6 +2357,7 @@ static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_errorToSangerFastQStr(PyObjec static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_formatFastq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_8obitools_5fastq_6_fastq_formatFastq(PyObject *__pyx_v_data, int __pyx_skip_dispatch, struct __pyx_opt_args_8obitools_5fastq_6_fastq_formatFastq *__pyx_optional_args) { int __pyx_v_gbmode = ((int)0); + int __pyx_v_upper = ((int)0); PyObject *__pyx_v_rep = 0; PyObject *__pyx_v_seq; PyObject *__pyx_v_definition; @@ -2362,6 +2381,9 @@ static PyObject *__pyx_f_8obitools_5fastq_6_fastq_formatFastq(PyObject *__pyx_v if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_gbmode = __pyx_optional_args->gbmode; + if (__pyx_optional_args->__pyx_n > 1) { + __pyx_v_upper = __pyx_optional_args->upper; + } } } __Pyx_INCREF(__pyx_v_data); @@ -2376,7 +2398,7 @@ static PyObject *__pyx_f_8obitools_5fastq_6_fastq_formatFastq(PyObject *__pyx_v /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":171 * - * cpdef str formatFastq(object data, bint gbmode=False): + * cpdef str formatFastq(object data, bint gbmode=False, bint upper=False): * cdef list rep=[] # <<<<<<<<<<<<<< * cdef str seq * cdef str definition @@ -2423,7 +2445,7 @@ static PyObject *__pyx_f_8obitools_5fastq_6_fastq_formatFastq(PyObject *__pyx_v * * for sequence in data: # <<<<<<<<<<<<<< * seq = str(sequence) - * if sequence.definition is None: + * if upper: */ if (PyList_CheckExact(__pyx_v_data) || PyTuple_CheckExact(__pyx_v_data)) { __pyx_t_3 = 0; __pyx_t_1 = __pyx_v_data; __Pyx_INCREF(__pyx_t_1); @@ -2454,8 +2476,8 @@ static PyObject *__pyx_f_8obitools_5fastq_6_fastq_formatFastq(PyObject *__pyx_v * * for sequence in data: * seq = str(sequence) # <<<<<<<<<<<<<< - * if sequence.definition is None: - * definition='' + * if upper: + * seq=seq.upper() */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); @@ -2473,18 +2495,48 @@ static PyObject *__pyx_f_8obitools_5fastq_6_fastq_formatFastq(PyObject *__pyx_v /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":184 * for sequence in data: * seq = str(sequence) + * if upper: # <<<<<<<<<<<<<< + * seq=seq.upper() + * if sequence.definition is None: + */ + __pyx_t_2 = __pyx_v_upper; + if (__pyx_t_2) { + + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":185 + * seq = str(sequence) + * if upper: + * seq=seq.upper() # <<<<<<<<<<<<<< + * if sequence.definition is None: + * definition='' + */ + __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_seq), __pyx_n_s__upper); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(PyString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_v_seq)); + __pyx_v_seq = ((PyObject *)__pyx_t_4); + __pyx_t_4 = 0; + goto __pyx_L6; + } + __pyx_L6:; + + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":186 + * if upper: + * seq=seq.upper() * if sequence.definition is None: # <<<<<<<<<<<<<< * definition='' * else: */ - __pyx_t_5 = PyObject_GetAttr(__pyx_v_sequence, __pyx_n_s__definition); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = (__pyx_t_5 == Py_None); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_4 = PyObject_GetAttr(__pyx_v_sequence, __pyx_n_s__definition); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = (__pyx_t_4 == Py_None); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":185 - * seq = str(sequence) + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":187 + * seq=seq.upper() * if sequence.definition is None: * definition='' # <<<<<<<<<<<<<< * else: @@ -2493,46 +2545,46 @@ static PyObject *__pyx_f_8obitools_5fastq_6_fastq_formatFastq(PyObject *__pyx_v __Pyx_INCREF(((PyObject *)__pyx_kp_s_1)); __Pyx_DECREF(((PyObject *)__pyx_v_definition)); __pyx_v_definition = __pyx_kp_s_1; - goto __pyx_L6; + goto __pyx_L7; } /*else*/ { - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":187 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":189 * definition='' * else: * definition=sequence.definition # <<<<<<<<<<<<<< * info='; '.join(['%s=%s' % x for x in sequence.rawiteritems()]) * if info: */ - __pyx_t_5 = PyObject_GetAttr(__pyx_v_sequence, __pyx_n_s__definition); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_5)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_v_sequence, __pyx_n_s__definition); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (!(likely(PyString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_definition)); - __pyx_v_definition = ((PyObject *)__pyx_t_5); - __pyx_t_5 = 0; + __pyx_v_definition = ((PyObject *)__pyx_t_4); + __pyx_t_4 = 0; } - __pyx_L6:; + __pyx_L7:; - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":188 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":190 * else: * definition=sequence.definition * info='; '.join(['%s=%s' % x for x in sequence.rawiteritems()]) # <<<<<<<<<<<<<< * if info: * info=info+';' */ - __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_2), __pyx_n_s__join); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __pyx_t_7 = PyObject_GetAttr(__pyx_v_sequence, __pyx_n_s__rawiteritems); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_2), __pyx_n_s__join); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __pyx_t_7 = PyObject_GetAttr(__pyx_v_sequence, __pyx_n_s__rawiteritems); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (PyList_CheckExact(__pyx_t_8) || PyTuple_CheckExact(__pyx_t_8)) { __pyx_t_6 = 0; __pyx_t_7 = __pyx_t_8; __Pyx_INCREF(__pyx_t_7); } else { - __pyx_t_6 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -2546,7 +2598,7 @@ static PyObject *__pyx_f_8obitools_5fastq_6_fastq_formatFastq(PyObject *__pyx_v } else { __pyx_t_8 = PyIter_Next(__pyx_t_7); if (!__pyx_t_8) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } __Pyx_GOTREF(__pyx_t_8); @@ -2554,69 +2606,69 @@ static PyObject *__pyx_f_8obitools_5fastq_6_fastq_formatFastq(PyObject *__pyx_v __Pyx_DECREF(__pyx_v_x); __pyx_v_x = __pyx_t_8; __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_3), __pyx_v_x); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_3), __pyx_v_x); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyList_Append(__pyx_t_4, (PyObject*)__pyx_t_8); if (unlikely(__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyList_Append(__pyx_t_5, (PyObject*)__pyx_t_8); if (unlikely(__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __Pyx_INCREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_INCREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_5)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (!(likely(PyString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_5)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_info)); - __pyx_v_info = ((PyObject *)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_v_info = ((PyObject *)__pyx_t_5); + __pyx_t_5 = 0; - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":189 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":191 * definition=sequence.definition * info='; '.join(['%s=%s' % x for x in sequence.rawiteritems()]) * if info: # <<<<<<<<<<<<<< * info=info+';' * id = sequence.id */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_info)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_info)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":190 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":192 * info='; '.join(['%s=%s' % x for x in sequence.rawiteritems()]) * if info: * info=info+';' # <<<<<<<<<<<<<< * id = sequence.id * if gbmode: */ - __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_info), ((PyObject *)__pyx_kp_s_4)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (!(likely(PyString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_v_info), ((PyObject *)__pyx_kp_s_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_5)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_info)); - __pyx_v_info = ((PyObject *)__pyx_t_4); - __pyx_t_4 = 0; - goto __pyx_L9; + __pyx_v_info = ((PyObject *)__pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L10; } - __pyx_L9:; + __pyx_L10:; - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":191 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":193 * if info: * info=info+';' * id = sequence.id # <<<<<<<<<<<<<< * if gbmode: * if 'gi' in sequence: */ - __pyx_t_4 = PyObject_GetAttr(__pyx_v_sequence, __pyx_n_s__id); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (!(likely(PyString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_v_sequence, __pyx_n_s__id); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_5)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_id)); - __pyx_v_id = ((PyObject *)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_v_id = ((PyObject *)__pyx_t_5); + __pyx_t_5 = 0; - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":192 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":194 * info=info+';' * id = sequence.id * if gbmode: # <<<<<<<<<<<<<< @@ -2626,139 +2678,139 @@ static PyObject *__pyx_f_8obitools_5fastq_6_fastq_formatFastq(PyObject *__pyx_v __pyx_t_2 = __pyx_v_gbmode; if (__pyx_t_2) { - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":193 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":195 * id = sequence.id * if gbmode: * if 'gi' in sequence: # <<<<<<<<<<<<<< * id = "gi|%s|%s" % (sequence['gi'],id) * else: */ - __pyx_t_2 = ((PySequence_Contains(__pyx_v_sequence, ((PyObject *)__pyx_n_s__gi)))); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PySequence_Contains(__pyx_v_sequence, ((PyObject *)__pyx_n_s__gi)))); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":194 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":196 * if gbmode: * if 'gi' in sequence: * id = "gi|%s|%s" % (sequence['gi'],id) # <<<<<<<<<<<<<< * else: * id = "lcl|%s|" % (id) */ - __pyx_t_4 = PyObject_GetItem(__pyx_v_sequence, ((PyObject *)__pyx_n_s__gi)); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetItem(__pyx_v_sequence, ((PyObject *)__pyx_n_s__gi)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_id)); PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_v_id)); __Pyx_GIVEREF(((PyObject *)__pyx_v_id)); - __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), __pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (!(likely(PyString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_5)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_id)); - __pyx_v_id = ((PyObject *)__pyx_t_4); - __pyx_t_4 = 0; - goto __pyx_L11; + __pyx_v_id = ((PyObject *)__pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L12; } /*else*/ { - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":196 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":198 * id = "gi|%s|%s" % (sequence['gi'],id) * else: * id = "lcl|%s|" % (id) # <<<<<<<<<<<<<< * if hasattr(sequence, "quality"): * quality=errorToSangerFastQStr(sequence.quality) */ - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_6), ((PyObject *)__pyx_v_id)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (!(likely(PyString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_6), ((PyObject *)__pyx_v_id)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_5)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_id)); - __pyx_v_id = ((PyObject *)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_v_id = ((PyObject *)__pyx_t_5); + __pyx_t_5 = 0; } - __pyx_L11:; - goto __pyx_L10; + __pyx_L12:; + goto __pyx_L11; } - __pyx_L10:; + __pyx_L11:; - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":197 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":199 * else: * id = "lcl|%s|" % (id) * if hasattr(sequence, "quality"): # <<<<<<<<<<<<<< * quality=errorToSangerFastQStr(sequence.quality) * else: */ - __pyx_t_2 = PyObject_HasAttr(__pyx_v_sequence, ((PyObject *)__pyx_n_s__quality)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_HasAttr(__pyx_v_sequence, ((PyObject *)__pyx_n_s__quality)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":198 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":200 * id = "lcl|%s|" % (id) * if hasattr(sequence, "quality"): * quality=errorToSangerFastQStr(sequence.quality) # <<<<<<<<<<<<<< * else: * quality="I"*len(sequence) */ - __pyx_t_4 = PyObject_GetAttr(__pyx_v_sequence, __pyx_n_s__quality); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_8obitools_5fastq_5array_array))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = ((PyObject *)__pyx_f_8obitools_5fastq_6_fastq_errorToSangerFastQStr(((arrayobject *)__pyx_t_4), 0)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_v_sequence, __pyx_n_s__quality); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_8obitools_5fastq_5array_array))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyObject *)__pyx_f_8obitools_5fastq_6_fastq_errorToSangerFastQStr(((arrayobject *)__pyx_t_5), 0)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_quality)); __pyx_v_quality = ((PyObject *)__pyx_t_7); __pyx_t_7 = 0; - goto __pyx_L12; + goto __pyx_L13; } /*else*/ { - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":200 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":202 * quality=errorToSangerFastQStr(sequence.quality) * else: * quality="I"*len(sequence) # <<<<<<<<<<<<<< * title='@%s %s %s' %(id,info,definition) * rep.append("%s\n%s\n+\n%s" % (title,seq,quality)) */ - __pyx_t_6 = PyObject_Length(__pyx_v_sequence); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Length(__pyx_v_sequence); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = PyNumber_Multiply(((PyObject *)__pyx_n_s__I), __pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyNumber_Multiply(((PyObject *)__pyx_n_s__I), __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (!(likely(PyString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_5)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_quality)); - __pyx_v_quality = ((PyObject *)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_v_quality = ((PyObject *)__pyx_t_5); + __pyx_t_5 = 0; } - __pyx_L12:; + __pyx_L13:; - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":201 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":203 * else: * quality="I"*len(sequence) * title='@%s %s %s' %(id,info,definition) # <<<<<<<<<<<<<< * rep.append("%s\n%s\n+\n%s" % (title,seq,quality)) * return '\n'.join(rep) */ - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_id)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_id)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_id)); __Pyx_GIVEREF(((PyObject *)__pyx_v_id)); __Pyx_INCREF(((PyObject *)__pyx_v_info)); - PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_info)); + PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_info)); __Pyx_GIVEREF(((PyObject *)__pyx_v_info)); __Pyx_INCREF(((PyObject *)__pyx_v_definition)); - PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_definition)); + PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_definition)); __Pyx_GIVEREF(((PyObject *)__pyx_v_definition)); - __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_7), __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_7), __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_v_title); __pyx_v_title = __pyx_t_7; __pyx_t_7 = 0; - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":202 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":204 * quality="I"*len(sequence) * title='@%s %s %s' %(id,info,definition) * rep.append("%s\n%s\n+\n%s" % (title,seq,quality)) # <<<<<<<<<<<<<< @@ -2766,9 +2818,9 @@ static PyObject *__pyx_f_8obitools_5fastq_6_fastq_formatFastq(PyObject *__pyx_v * */ if (unlikely(__pyx_v_rep == Py_None)) { - PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_title); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_title); @@ -2779,15 +2831,15 @@ static PyObject *__pyx_f_8obitools_5fastq_6_fastq_formatFastq(PyObject *__pyx_v __Pyx_INCREF(((PyObject *)__pyx_v_quality)); PyTuple_SET_ITEM(__pyx_t_7, 2, ((PyObject *)__pyx_v_quality)); __Pyx_GIVEREF(((PyObject *)__pyx_v_quality)); - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_8), __pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_8), __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_9 = PyList_Append(((PyObject *)__pyx_v_rep), __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_9 = PyList_Append(((PyObject *)__pyx_v_rep), __pyx_t_5); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":203 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":205 * title='@%s %s %s' %(id,info,definition) * rep.append("%s\n%s\n+\n%s" % (title,seq,quality)) * return '\n'.join(rep) # <<<<<<<<<<<<<< @@ -2795,18 +2847,18 @@ static PyObject *__pyx_f_8obitools_5fastq_6_fastq_formatFastq(PyObject *__pyx_v * */ __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_9), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_9), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_rep)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_rep)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_rep)); __Pyx_GIVEREF(((PyObject *)__pyx_v_rep)); - __pyx_t_7 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(PyString_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_7)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(PyString_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_7)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = ((PyObject *)__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L0; @@ -2840,7 +2892,7 @@ static PyObject *__pyx_f_8obitools_5fastq_6_fastq_formatFastq(PyObject *__pyx_v /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":170 * return code * - * cpdef str formatFastq(object data, bint gbmode=False): # <<<<<<<<<<<<<< + * cpdef str formatFastq(object data, bint gbmode=False, bint upper=False): # <<<<<<<<<<<<<< * cdef list rep=[] * cdef str seq */ @@ -2849,16 +2901,18 @@ static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_formatFastq(PyObject *__pyx_s static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_formatFastq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_data = 0; int __pyx_v_gbmode; + int __pyx_v_upper; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_8obitools_5fastq_6_fastq_formatFastq __pyx_t_2; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__data,&__pyx_n_s__gbmode,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__data,&__pyx_n_s__gbmode,&__pyx_n_s__upper,0}; __Pyx_RefNannySetupContext("formatFastq"); __pyx_self = __pyx_self; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[2] = {0,0}; + PyObject* values[3] = {0,0,0}; switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; @@ -2874,6 +2928,11 @@ static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_formatFastq(PyObject *__pyx_s PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__gbmode); if (unlikely(value)) { values[1] = value; kw_args--; } } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__upper); + if (unlikely(value)) { values[2] = value; kw_args--; } + } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "formatFastq") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} @@ -2884,9 +2943,16 @@ static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_formatFastq(PyObject *__pyx_s } else { __pyx_v_gbmode = ((int)0); } + if (values[2]) { + __pyx_v_upper = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_upper == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } else { + __pyx_v_upper = ((int)0); + } } else { __pyx_v_gbmode = ((int)0); + __pyx_v_upper = ((int)0); switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: __pyx_v_upper = __Pyx_PyObject_IsTrue(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_upper == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} case 2: __pyx_v_gbmode = __Pyx_PyObject_IsTrue(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_gbmode == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} case 1: __pyx_v_data = PyTuple_GET_ITEM(__pyx_args, 0); break; @@ -2895,14 +2961,15 @@ static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_formatFastq(PyObject *__pyx_s } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("formatFastq", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("formatFastq", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("obitools.fastq._fastq.formatFastq"); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __pyx_t_2.__pyx_n = 1; + __pyx_t_2.__pyx_n = 2; __pyx_t_2.gbmode = __pyx_v_gbmode; + __pyx_t_2.upper = __pyx_v_upper; __pyx_t_1 = ((PyObject *)__pyx_f_8obitools_5fastq_6_fastq_formatFastq(__pyx_v_data, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; @@ -2921,7 +2988,7 @@ static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_formatFastq(PyObject *__pyx_s return __pyx_r; } -/* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":216 +/* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":218 * cdef bint _errorDecoder * * def __init__(self,fastqvariant='sanger',bioseqfactory=NucSequence,tagparser=_parseFastaTag): # <<<<<<<<<<<<<< @@ -2974,7 +3041,7 @@ static int __pyx_pf_8obitools_5fastq_6_fastq_20fastqParserGenetator___init__(PyO } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_fastqvariant = values[0]; __pyx_v_bioseqfactory = values[1]; @@ -2993,13 +3060,13 @@ static int __pyx_pf_8obitools_5fastq_6_fastq_20fastqParserGenetator___init__(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("obitools.fastq._fastq.fastqParserGenetator.__init__"); return -1; __pyx_L4_argument_unpacking_done:; - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":217 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":219 * * def __init__(self,fastqvariant='sanger',bioseqfactory=NucSequence,tagparser=_parseFastaTag): * self.bioseqfactory = bioseqfactory # <<<<<<<<<<<<<< @@ -3012,7 +3079,7 @@ static int __pyx_pf_8obitools_5fastq_6_fastq_20fastqParserGenetator___init__(PyO __Pyx_DECREF(((struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *)__pyx_v_self)->bioseqfactory); ((struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *)__pyx_v_self)->bioseqfactory = __pyx_v_bioseqfactory; - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":218 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":220 * def __init__(self,fastqvariant='sanger',bioseqfactory=NucSequence,tagparser=_parseFastaTag): * self.bioseqfactory = bioseqfactory * self.tagparser = tagparser # <<<<<<<<<<<<<< @@ -3025,20 +3092,20 @@ static int __pyx_pf_8obitools_5fastq_6_fastq_20fastqParserGenetator___init__(PyO __Pyx_DECREF(((struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *)__pyx_v_self)->tagparser); ((struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *)__pyx_v_self)->tagparser = __pyx_v_tagparser; - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":221 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":223 * # Sanger = True * # Solexa = False * self._qualityDecoder, self._errorDecoder = {'sanger' : (True,True), # <<<<<<<<<<<<<< * 'solexa' : (False,False), * 'illumina' : (False,True)}[fastqvariant] */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); @@ -3046,21 +3113,21 @@ static int __pyx_pf_8obitools_5fastq_6_fastq_20fastqParserGenetator___init__(PyO __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__sanger), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__sanger), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":222 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":224 * # Solexa = False * self._qualityDecoder, self._errorDecoder = {'sanger' : (True,True), * 'solexa' : (False,False), # <<<<<<<<<<<<<< * 'illumina' : (False,True)}[fastqvariant] * */ - __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); @@ -3068,21 +3135,21 @@ static int __pyx_pf_8obitools_5fastq_6_fastq_20fastqParserGenetator___init__(PyO __Pyx_GIVEREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__solexa), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__solexa), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":223 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":225 * self._qualityDecoder, self._errorDecoder = {'sanger' : (True,True), * 'solexa' : (False,False), * 'illumina' : (False,True)}[fastqvariant] # <<<<<<<<<<<<<< * * cdef errorDecoder(self,object qualstring): */ - __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); @@ -3090,43 +3157,43 @@ static int __pyx_pf_8obitools_5fastq_6_fastq_20fastqParserGenetator___init__(PyO __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__illumina), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__illumina), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_t_1), __pyx_v_fastqvariant); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_t_1), __pyx_v_fastqvariant); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; if (PyTuple_CheckExact(__pyx_t_4) && likely(PyTuple_GET_SIZE(__pyx_t_4) == 2)) { PyObject* tuple = __pyx_t_4; __pyx_t_1 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_1); - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":221 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":223 * # Sanger = True * # Solexa = False * self._qualityDecoder, self._errorDecoder = {'sanger' : (True,True), # <<<<<<<<<<<<<< * 'solexa' : (False,False), * 'illumina' : (False,True)}[fastqvariant] */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; ((struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *)__pyx_v_self)->_qualityDecoder = __pyx_t_5; ((struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *)__pyx_v_self)->_errorDecoder = __pyx_t_6; } else { - __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_2, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_2, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_2, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_2, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_EndUnpack(__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_EndUnpack(__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; ((struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *)__pyx_v_self)->_qualityDecoder = __pyx_t_6; ((struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *)__pyx_v_self)->_errorDecoder = __pyx_t_5; @@ -3146,7 +3213,7 @@ static int __pyx_pf_8obitools_5fastq_6_fastq_20fastqParserGenetator___init__(PyO return __pyx_r; } -/* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":225 +/* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":227 * 'illumina' : (False,True)}[fastqvariant] * * cdef errorDecoder(self,object qualstring): # <<<<<<<<<<<<<< @@ -3162,7 +3229,7 @@ static PyObject *__pyx_f_8obitools_5fastq_6_fastq_20fastqParserGenetator_errorD __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_v_qualstring); - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":226 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":228 * * cdef errorDecoder(self,object qualstring): * if self._errorDecoder: # <<<<<<<<<<<<<< @@ -3172,7 +3239,7 @@ static PyObject *__pyx_f_8obitools_5fastq_6_fastq_20fastqParserGenetator_errorD __pyx_t_1 = __pyx_v_self->_errorDecoder; if (__pyx_t_1) { - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":227 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":229 * cdef errorDecoder(self,object qualstring): * if self._errorDecoder: * return qualityToSangerError(qualstring) # <<<<<<<<<<<<<< @@ -3180,8 +3247,8 @@ static PyObject *__pyx_f_8obitools_5fastq_6_fastq_20fastqParserGenetator_errorD * return qualityToSolexaError(qualstring) */ __Pyx_XDECREF(__pyx_r); - if (!(likely(((__pyx_v_qualstring) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_qualstring, __pyx_ptype_8obitools_5fastq_5array_array))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = ((PyObject *)__pyx_f_8obitools_5fastq_6_fastq_qualityToSangerError(((arrayobject *)__pyx_v_qualstring), 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_qualstring) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_qualstring, __pyx_ptype_8obitools_5fastq_5array_array))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyObject *)__pyx_f_8obitools_5fastq_6_fastq_qualityToSangerError(((arrayobject *)__pyx_v_qualstring), 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -3190,7 +3257,7 @@ static PyObject *__pyx_f_8obitools_5fastq_6_fastq_20fastqParserGenetator_errorD } /*else*/ { - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":229 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":231 * return qualityToSangerError(qualstring) * else: * return qualityToSolexaError(qualstring) # <<<<<<<<<<<<<< @@ -3198,8 +3265,8 @@ static PyObject *__pyx_f_8obitools_5fastq_6_fastq_20fastqParserGenetator_errorD * cdef qualityDecoder(self,char* qualstring): */ __Pyx_XDECREF(__pyx_r); - if (!(likely(((__pyx_v_qualstring) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_qualstring, __pyx_ptype_8obitools_5fastq_5array_array))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = ((PyObject *)__pyx_f_8obitools_5fastq_6_fastq_qualityToSolexaError(((arrayobject *)__pyx_v_qualstring), 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_qualstring) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_qualstring, __pyx_ptype_8obitools_5fastq_5array_array))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyObject *)__pyx_f_8obitools_5fastq_6_fastq_qualityToSolexaError(((arrayobject *)__pyx_v_qualstring), 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -3221,7 +3288,7 @@ static PyObject *__pyx_f_8obitools_5fastq_6_fastq_20fastqParserGenetator_errorD return __pyx_r; } -/* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":231 +/* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":233 * return qualityToSolexaError(qualstring) * * cdef qualityDecoder(self,char* qualstring): # <<<<<<<<<<<<<< @@ -3236,7 +3303,7 @@ static PyObject *__pyx_f_8obitools_5fastq_6_fastq_20fastqParserGenetator_qualit __Pyx_RefNannySetupContext("qualityDecoder"); __Pyx_INCREF((PyObject *)__pyx_v_self); - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":232 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":234 * * cdef qualityDecoder(self,char* qualstring): * if self._qualityDecoder: # <<<<<<<<<<<<<< @@ -3246,7 +3313,7 @@ static PyObject *__pyx_f_8obitools_5fastq_6_fastq_20fastqParserGenetator_qualit __pyx_t_1 = __pyx_v_self->_qualityDecoder; if (__pyx_t_1) { - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":233 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":235 * cdef qualityDecoder(self,char* qualstring): * if self._qualityDecoder: * return fastqQualitySangerDecoder(qualstring) # <<<<<<<<<<<<<< @@ -3254,7 +3321,7 @@ static PyObject *__pyx_f_8obitools_5fastq_6_fastq_20fastqParserGenetator_qualit * return fastqQualitySolexaDecoder(qualstring) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((PyObject *)__pyx_f_8obitools_5fastq_6_fastq_fastqQualitySangerDecoder(__pyx_v_qualstring, 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyObject *)__pyx_f_8obitools_5fastq_6_fastq_fastqQualitySangerDecoder(__pyx_v_qualstring, 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -3263,7 +3330,7 @@ static PyObject *__pyx_f_8obitools_5fastq_6_fastq_20fastqParserGenetator_qualit } /*else*/ { - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":235 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":237 * return fastqQualitySangerDecoder(qualstring) * else: * return fastqQualitySolexaDecoder(qualstring) # <<<<<<<<<<<<<< @@ -3271,7 +3338,7 @@ static PyObject *__pyx_f_8obitools_5fastq_6_fastq_20fastqParserGenetator_qualit * def __call__(self,seq): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((PyObject *)__pyx_f_8obitools_5fastq_6_fastq_fastqQualitySolexaDecoder(__pyx_v_qualstring, 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyObject *)__pyx_f_8obitools_5fastq_6_fastq_fastqQualitySolexaDecoder(__pyx_v_qualstring, 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -3292,7 +3359,7 @@ static PyObject *__pyx_f_8obitools_5fastq_6_fastq_20fastqParserGenetator_qualit return __pyx_r; } -/* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":237 +/* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":239 * return fastqQualitySolexaDecoder(qualstring) * * def __call__(self,seq): # <<<<<<<<<<<<<< @@ -3337,7 +3404,7 @@ static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_20fastqParserGenetator___call else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__call__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__call__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_seq = values[0]; } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { @@ -3347,7 +3414,7 @@ static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_20fastqParserGenetator___call } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("obitools.fastq._fastq.fastqParserGenetator.__call__"); return NULL; @@ -3363,33 +3430,33 @@ static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_20fastqParserGenetator___call __pyx_v_title = Py_None; __Pyx_INCREF(Py_None); __pyx_v_quality = Py_None; __Pyx_INCREF(Py_None); - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":245 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":247 * cdef bytes tqual * * s0=seq[0] # <<<<<<<<<<<<<< * title = s0[1:].split(None,1) * id=title[0] */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_seq, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_seq, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_s0)); __pyx_v_s0 = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":246 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":248 * * s0=seq[0] * title = s0[1:].split(None,1) # <<<<<<<<<<<<<< * id=title[0] * if len(title) == 2: */ - __pyx_t_1 = PySequence_GetSlice(((PyObject *)__pyx_v_s0), 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySequence_GetSlice(((PyObject *)__pyx_v_s0), 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_t_1), __pyx_n_s__split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_t_1), __pyx_n_s__split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_None); PyTuple_SET_ITEM(__pyx_t_1, 0, Py_None); @@ -3397,7 +3464,7 @@ static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_20fastqParserGenetator___call __Pyx_INCREF(__pyx_int_1); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); - __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -3405,52 +3472,52 @@ static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_20fastqParserGenetator___call __pyx_v_title = __pyx_t_3; __pyx_t_3 = 0; - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":247 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":249 * s0=seq[0] * title = s0[1:].split(None,1) * id=title[0] # <<<<<<<<<<<<<< * if len(title) == 2: * definition,info=parseFastaDescription(title[1], self.tagparser) */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_title, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_title, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_id)); __pyx_v_id = ((PyObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":248 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":250 * title = s0[1:].split(None,1) * id=title[0] * if len(title) == 2: # <<<<<<<<<<<<<< * definition,info=parseFastaDescription(title[1], self.tagparser) * else: */ - __pyx_t_4 = PyObject_Length(__pyx_v_title); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Length(__pyx_v_title); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = (__pyx_t_4 == 2); if (__pyx_t_5) { - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":249 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":251 * id=title[0] * if len(title) == 2: * definition,info=parseFastaDescription(title[1], self.tagparser) # <<<<<<<<<<<<<< * else: * info= {} */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_title, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_title, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6.__pyx_n = 1; __pyx_t_6.tagparser = ((struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *)__pyx_v_self)->tagparser; - __pyx_t_1 = __pyx_f_8obitools_5fasta_6_fasta_parseFastaDescription(((PyObject *)__pyx_t_3), 0, &__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_f_8obitools_5fasta_6_fasta_parseFastaDescription(((PyObject *)__pyx_t_3), 0, &__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 2)) { PyObject* tuple = __pyx_t_1; __pyx_t_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_3); - if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_2); - if (!(likely(PyDict_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected dict, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyDict_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected dict, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_definition)); __pyx_v_definition = ((PyObject *)__pyx_t_3); @@ -3459,16 +3526,16 @@ static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_20fastqParserGenetator___call __pyx_v_info = ((PyObject *)__pyx_t_2); __pyx_t_2 = 0; } else { - __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_7, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_7, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_7, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_7, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (!(likely(PyDict_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected dict, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_EndUnpack(__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyDict_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected dict, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_EndUnpack(__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_definition)); __pyx_v_definition = ((PyObject *)__pyx_t_3); @@ -3481,20 +3548,20 @@ static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_20fastqParserGenetator___call } /*else*/ { - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":251 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":253 * definition,info=parseFastaDescription(title[1], self.tagparser) * else: * info= {} # <<<<<<<<<<<<<< * definition=None * */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_DECREF(((PyObject *)__pyx_v_info)); __pyx_v_info = __pyx_t_1; __pyx_t_1 = 0; - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":252 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":254 * else: * info= {} * definition=None # <<<<<<<<<<<<<< @@ -3507,61 +3574,61 @@ static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_20fastqParserGenetator___call } __pyx_L6:; - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":254 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":256 * definition=None * * tqual = seq[3] # <<<<<<<<<<<<<< * quality=self.errorDecoder(self.qualityDecoder(tqual)) * */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_seq, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_seq, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_tqual)); __pyx_v_tqual = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":255 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":257 * * tqual = seq[3] * quality=self.errorDecoder(self.qualityDecoder(tqual)) # <<<<<<<<<<<<<< * * tseq=seq[1] */ - __pyx_t_8 = __Pyx_PyBytes_AsString(((PyObject *)__pyx_v_tqual)); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = ((struct __pyx_vtabstruct_8obitools_5fastq_6_fastq_fastqParserGenetator *)((struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *)__pyx_v_self)->__pyx_vtab)->qualityDecoder(((struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *)__pyx_v_self), __pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyBytes_AsString(((PyObject *)__pyx_v_tqual)); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_8obitools_5fastq_6_fastq_fastqParserGenetator *)((struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *)__pyx_v_self)->__pyx_vtab)->qualityDecoder(((struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *)__pyx_v_self), __pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = ((struct __pyx_vtabstruct_8obitools_5fastq_6_fastq_fastqParserGenetator *)((struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *)__pyx_v_self)->__pyx_vtab)->errorDecoder(((struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *)__pyx_v_self), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_8obitools_5fastq_6_fastq_fastqParserGenetator *)((struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *)__pyx_v_self)->__pyx_vtab)->errorDecoder(((struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *)__pyx_v_self), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_quality); __pyx_v_quality = __pyx_t_2; __pyx_t_2 = 0; - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":257 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":259 * quality=self.errorDecoder(self.qualityDecoder(tqual)) * * tseq=seq[1] # <<<<<<<<<<<<<< * * seq = self.bioseqfactory(id, tseq, definition,False,**info) */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_seq, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_seq, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_tseq)); __pyx_v_tseq = ((PyObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":259 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":261 * tseq=seq[1] * * seq = self.bioseqfactory(id, tseq, definition,False,**info) # <<<<<<<<<<<<<< * seq.quality = quality * */ - __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_id)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_id)); @@ -3575,23 +3642,23 @@ static PyObject *__pyx_pf_8obitools_5fastq_6_fastq_20fastqParserGenetator___call PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyEval_CallObjectWithKeywords(((struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *)__pyx_v_self)->bioseqfactory, __pyx_t_1, ((PyObject *)__pyx_v_info)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyEval_CallObjectWithKeywords(((struct __pyx_obj_8obitools_5fastq_6_fastq_fastqParserGenetator *)__pyx_v_self)->bioseqfactory, __pyx_t_1, ((PyObject *)__pyx_v_info)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_seq); __pyx_v_seq = __pyx_t_2; __pyx_t_2 = 0; - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":260 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":262 * * seq = self.bioseqfactory(id, tseq, definition,False,**info) * seq.quality = quality # <<<<<<<<<<<<<< * * return seq */ - if (PyObject_SetAttr(__pyx_v_seq, __pyx_n_s__quality, __pyx_v_quality) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_seq, __pyx_n_s__quality, __pyx_v_quality) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":262 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":264 * seq.quality = quality * * return seq # <<<<<<<<<<<<<< @@ -3807,7 +3874,7 @@ static void __pyx_pf_8obitools_5fastq_5array_5array___releasebuffer__(PyObject * * if op: */ -static INLINE arrayobject *__pyx_f_8obitools_5fastq_5array_zeros_like(arrayobject *__pyx_v_sametype) { +static CYTHON_INLINE arrayobject *__pyx_f_8obitools_5fastq_5array_zeros_like(arrayobject *__pyx_v_sametype) { arrayobject *__pyx_v_op = 0; arrayobject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; @@ -3883,7 +3950,7 @@ static INLINE arrayobject *__pyx_f_8obitools_5fastq_5array_zeros_like(arrayobjec * sametype.ob_descr) */ -static INLINE arrayobject *__pyx_f_8obitools_5fastq_5array_empty_like(arrayobject *__pyx_v_sametype) { +static CYTHON_INLINE arrayobject *__pyx_f_8obitools_5fastq_5array_empty_like(arrayobject *__pyx_v_sametype) { arrayobject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -3940,7 +4007,7 @@ static INLINE arrayobject *__pyx_f_8obitools_5fastq_5array_empty_like(arrayobjec * self.ob_descr) */ -static INLINE arrayobject *__pyx_f_8obitools_5fastq_5array_copy(arrayobject *__pyx_v_self) { +static CYTHON_INLINE arrayobject *__pyx_f_8obitools_5fastq_5array_copy(arrayobject *__pyx_v_self) { arrayobject *__pyx_v_op = 0; arrayobject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; @@ -4000,7 +4067,7 @@ static INLINE arrayobject *__pyx_f_8obitools_5fastq_5array_copy(arrayobject *__p * n: number of elements (not number of bytes!) */ -static INLINE int __pyx_f_8obitools_5fastq_5array_extend_buffer(arrayobject *__pyx_v_self, char *__pyx_v_stuff, Py_ssize_t __pyx_v_n) { +static CYTHON_INLINE int __pyx_f_8obitools_5fastq_5array_extend_buffer(arrayobject *__pyx_v_self, char *__pyx_v_stuff, Py_ssize_t __pyx_v_n) { Py_ssize_t __pyx_v_itemsize; Py_ssize_t __pyx_v_orgsize; int __pyx_r; @@ -4065,7 +4132,7 @@ static INLINE int __pyx_f_8obitools_5fastq_5array_extend_buffer(arrayobject *__p * PyErr_BadArgument() */ -static INLINE int __pyx_f_8obitools_5fastq_5array_extend(arrayobject *__pyx_v_self, arrayobject *__pyx_v_other) { +static CYTHON_INLINE int __pyx_f_8obitools_5fastq_5array_extend(arrayobject *__pyx_v_self, arrayobject *__pyx_v_other) { int __pyx_r; int __pyx_t_1; __Pyx_RefNannySetupContext("extend"); @@ -4129,7 +4196,7 @@ static INLINE int __pyx_f_8obitools_5fastq_5array_extend(arrayobject *__pyx_v_se * memset(op.ob_item, 0, op.ob_size * op.ob_descr.itemsize) */ -static INLINE void __pyx_f_8obitools_5fastq_5array_zero(arrayobject *__pyx_v_op) { +static CYTHON_INLINE void __pyx_f_8obitools_5fastq_5array_zero(arrayobject *__pyx_v_op) { __Pyx_RefNannySetupContext("zero"); /* "/Users/coissac/encours/OBITools/src/obitools/fastq/array.pxd":183 @@ -4431,6 +4498,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s__suboffsets, __pyx_k__suboffsets, sizeof(__pyx_k__suboffsets), 0, 0, 1, 1}, {&__pyx_n_s__tagparser, __pyx_k__tagparser, sizeof(__pyx_k__tagparser), 0, 0, 1, 1}, {&__pyx_n_s__typecode, __pyx_k__typecode, sizeof(__pyx_k__typecode), 0, 0, 1, 1}, + {&__pyx_n_s__upper, __pyx_k__upper, sizeof(__pyx_k__upper), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { @@ -4516,12 +4584,12 @@ PyMODINIT_FUNC PyInit__fastq(void) *(void(**)(void))&__pyx_vtable_8obitools_5fastq_6_fastq_fastqParserGenetator.errorDecoder = (void(*)(void))__pyx_f_8obitools_5fastq_6_fastq_20fastqParserGenetator_errorDecoder; *(void(**)(void))&__pyx_vtable_8obitools_5fastq_6_fastq_fastqParserGenetator.qualityDecoder = (void(*)(void))__pyx_f_8obitools_5fastq_6_fastq_20fastqParserGenetator_qualityDecoder; #endif - if (PyType_Ready(&__pyx_type_8obitools_5fastq_6_fastq_fastqParserGenetator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_8obitools_5fastq_6_fastq_fastqParserGenetator.tp_dict, __pyx_vtabptr_8obitools_5fastq_6_fastq_fastqParserGenetator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "fastqParserGenetator", (PyObject *)&__pyx_type_8obitools_5fastq_6_fastq_fastqParserGenetator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_8obitools_5fastq_6_fastq_fastqParserGenetator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_8obitools_5fastq_6_fastq_fastqParserGenetator.tp_dict, __pyx_vtabptr_8obitools_5fastq_6_fastq_fastqParserGenetator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "fastqParserGenetator", (PyObject *)&__pyx_type_8obitools_5fastq_6_fastq_fastqParserGenetator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_8obitools_5fastq_6_fastq_fastqParserGenetator = &__pyx_type_8obitools_5fastq_6_fastq_fastqParserGenetator; /*--- Type import code ---*/ - __pyx_ptype_8obitools_5fastq_5array_array = __Pyx_ImportType("array", "array", sizeof(arrayobject)); if (unlikely(!__pyx_ptype_8obitools_5fastq_5array_array)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_8obitools_5fastq_5array_array = __Pyx_ImportType("array", "array", sizeof(arrayobject), 0); if (unlikely(!__pyx_ptype_8obitools_5fastq_5array_array)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Function import code ---*/ __pyx_t_1 = __Pyx_ImportModule("obitools.fasta._fasta"); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_ImportFunction(__pyx_t_1, "parseFastaDescription", (void (**)(void))&__pyx_f_8obitools_5fasta_6_fasta_parseFastaDescription, "PyObject *(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_8obitools_5fasta_6_fasta_parseFastaDescription *__pyx_optional_args)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -4633,25 +4701,25 @@ PyMODINIT_FUNC PyInit__fastq(void) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":216 + /* "/Users/coissac/encours/OBITools/src/obitools/fastq/_fastq.pyx":218 * cdef bint _errorDecoder * * def __init__(self,fastqvariant='sanger',bioseqfactory=NucSequence,tagparser=_parseFastaTag): # <<<<<<<<<<<<<< * self.bioseqfactory = bioseqfactory * self.tagparser = tagparser */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__NucSequence); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__NucSequence); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_k_10 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___parseFastaTag); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___parseFastaTag); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_k_11 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/stdlib.pxd":2 + /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/stdlib.pxd":2 * * cdef extern from "stdlib.h" nogil: # <<<<<<<<<<<<<< * void free(void *ptr) @@ -4688,7 +4756,7 @@ static void __pyx_init_filenames(void) { __pyx_f = __pyx_filenames; } -static INLINE int __Pyx_IsLittleEndian(void) { +static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { unsigned int n = 1; return *(unsigned char*)(&n) != 0; } @@ -5085,7 +5153,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha } } -static INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { +static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { buf->buf = NULL; buf->obj = NULL; buf->strides = __Pyx_zeros; @@ -5126,7 +5194,7 @@ fail:; return -1; } -static INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { if (info->buf == NULL) return; if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; __Pyx_ReleaseBuffer(info); @@ -5138,7 +5206,7 @@ static void __Pyx_RaiseBufferFallbackError(void) { } -static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); @@ -5153,7 +5221,7 @@ static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *t Py_XDECREF(tmp_tb); } -static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; @@ -5287,7 +5355,7 @@ bad: return -1; } -static INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, #if PY_VERSION_HEX < 0x02050000 "need more than %d value%s to unpack", (int)index, @@ -5297,7 +5365,7 @@ static INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { (index == 1) ? "" : "s"); } -static INLINE void __Pyx_RaiseTooManyValuesError(void) { +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void) { PyErr_SetString(PyExc_ValueError, "too many values to unpack"); } @@ -5324,7 +5392,7 @@ static int __Pyx_EndUnpack(PyObject *iter) { return -1; } -static INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_Format(PyExc_SystemError, "Missing type object"); return 0; @@ -5422,7 +5490,7 @@ static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { return result; } -static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { +static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { const unsigned char neg_one = (unsigned char)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(unsigned char) < sizeof(long)) { @@ -5441,7 +5509,7 @@ static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x); } -static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { +static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { const unsigned short neg_one = (unsigned short)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(unsigned short) < sizeof(long)) { @@ -5460,7 +5528,7 @@ static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x); } -static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { +static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { const unsigned int neg_one = (unsigned int)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(unsigned int) < sizeof(long)) { @@ -5479,7 +5547,7 @@ static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x); } -static INLINE char __Pyx_PyInt_AsChar(PyObject* x) { +static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) { const char neg_one = (char)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(char) < sizeof(long)) { @@ -5498,7 +5566,7 @@ static INLINE char __Pyx_PyInt_AsChar(PyObject* x) { return (char)__Pyx_PyInt_AsLong(x); } -static INLINE short __Pyx_PyInt_AsShort(PyObject* x) { +static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) { const short neg_one = (short)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(short) < sizeof(long)) { @@ -5517,7 +5585,7 @@ static INLINE short __Pyx_PyInt_AsShort(PyObject* x) { return (short)__Pyx_PyInt_AsLong(x); } -static INLINE int __Pyx_PyInt_AsInt(PyObject* x) { +static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) { const int neg_one = (int)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(int) < sizeof(long)) { @@ -5536,7 +5604,7 @@ static INLINE int __Pyx_PyInt_AsInt(PyObject* x) { return (int)__Pyx_PyInt_AsLong(x); } -static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { +static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { const signed char neg_one = (signed char)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(signed char) < sizeof(long)) { @@ -5555,7 +5623,7 @@ static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { return (signed char)__Pyx_PyInt_AsSignedLong(x); } -static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { +static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { const signed short neg_one = (signed short)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(signed short) < sizeof(long)) { @@ -5574,7 +5642,7 @@ static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { return (signed short)__Pyx_PyInt_AsSignedLong(x); } -static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { +static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { const signed int neg_one = (signed int)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(signed int) < sizeof(long)) { @@ -5593,7 +5661,7 @@ static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { return (signed int)__Pyx_PyInt_AsSignedLong(x); } -static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { +static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { const unsigned long neg_one = (unsigned long)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 @@ -5628,7 +5696,7 @@ static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { } } -static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { +static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 @@ -5663,7 +5731,7 @@ static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) } } -static INLINE long __Pyx_PyInt_AsLong(PyObject* x) { +static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) { const long neg_one = (long)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 @@ -5698,7 +5766,7 @@ static INLINE long __Pyx_PyInt_AsLong(PyObject* x) { } } -static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { +static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 @@ -5733,7 +5801,7 @@ static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { } } -static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { +static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { const signed long neg_one = (signed long)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 @@ -5768,7 +5836,7 @@ static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { } } -static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { +static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 @@ -5823,11 +5891,12 @@ bad: #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, - long size) + long size, int strict) { PyObject *py_module = 0; PyObject *result = 0; PyObject *py_name = 0; + char warning[200]; py_module = __Pyx_ImportModule(module_name); if (!py_module) @@ -5852,9 +5921,15 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class module_name, class_name); goto bad; } - if (((PyTypeObject *)result)->tp_basicsize != size) { + if (!strict && ((PyTypeObject *)result)->tp_basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility", + module_name, class_name); + PyErr_WarnEx(NULL, warning, 0); + } + else if (((PyTypeObject *)result)->tp_basicsize != size) { PyErr_Format(PyExc_ValueError, - "%s.%s does not appear to be the correct type object", + "%s.%s has the wrong size, try recompiling", module_name, class_name); goto bad; } @@ -6046,13 +6121,13 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { /* Type Conversion Functions */ -static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { if (x == Py_True) return 1; else if ((x == Py_False) | (x == Py_None)) return 0; else return PyObject_IsTrue(x); } -static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; @@ -6098,7 +6173,7 @@ static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { return res; } -static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject* x = PyNumber_Index(b); if (!x) return -1; @@ -6107,7 +6182,7 @@ static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { return ival; } -static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { #if PY_VERSION_HEX < 0x02050000 if (ival <= LONG_MAX) return PyInt_FromLong((long)ival); @@ -6121,7 +6196,7 @@ static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { #endif } -static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { +static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x); if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) { return (size_t)-1; diff --git a/src/obitools/fastq/_fastq.pyx b/src/obitools/fastq/_fastq.pyx index 32977ab..4606a6a 100644 --- a/src/obitools/fastq/_fastq.pyx +++ b/src/obitools/fastq/_fastq.pyx @@ -167,7 +167,7 @@ cpdef str errorToSangerFastQStr(array.array quality): free(result) return code -cpdef str formatFastq(object data, bint gbmode=False): +cpdef str formatFastq(object data, bint gbmode=False, bint upper=False): cdef list rep=[] cdef str seq cdef str definition @@ -181,6 +181,8 @@ cpdef str formatFastq(object data, bint gbmode=False): for sequence in data: seq = str(sequence) + if upper: + seq=seq.upper() if sequence.definition is None: definition='' else: diff --git a/src/obitools/format/_format.c b/src/obitools/format/_format.c index d948656..1801581 100644 --- a/src/obitools/format/_format.c +++ b/src/obitools/format/_format.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.12 on Mon May 17 11:01:39 2010 */ +/* Generated by Cython 0.12.1 on Wed Jul 7 07:04:27 2010 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -6,6 +6,7 @@ #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #else + #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif @@ -17,6 +18,7 @@ #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) #define PyDict_Contains(d,o) PySequence_Contains(d,o) #endif + #if PY_VERSION_HEX < 0x02050000 typedef int Py_ssize_t; #define PY_SSIZE_T_MAX INT_MAX @@ -26,7 +28,9 @@ #define PyInt_AsSsize_t(o) PyInt_AsLong(o) #define PyNumber_Index(o) PyNumber_Int(o) #define PyIndex_Check(o) PyNumber_Check(o) + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) #endif + #if PY_VERSION_HEX < 0x02060000 #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) @@ -36,17 +40,17 @@ #define PyType_Modified(t) typedef struct { - void *buf; - PyObject *obj; - Py_ssize_t len; - Py_ssize_t itemsize; - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; } Py_buffer; #define PyBUF_SIMPLE 0 @@ -60,18 +64,22 @@ #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) #endif + #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #endif + #if PY_MAJOR_VERSION >= 3 #define Py_TPFLAGS_CHECKTYPES 0 #define Py_TPFLAGS_HAVE_INDEX 0 #endif + #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif + #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyString_Type PyUnicode_Type @@ -80,6 +88,7 @@ #define PyBytes_Type PyString_Type #define PyBytes_CheckExact PyString_CheckExact #endif + #if PY_MAJOR_VERSION >= 3 #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) @@ -99,10 +108,13 @@ #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) + #endif + #if PY_MAJOR_VERSION >= 3 #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func) #endif + #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall @@ -116,6 +128,7 @@ #else #define _USE_MATH_DEFINES #endif + #if PY_VERSION_HEX < 0x02050000 #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) @@ -125,6 +138,7 @@ #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) #endif + #if PY_VERSION_HEX < 0x02050000 #define __Pyx_NAMESTR(n) ((char *)(n)) #define __Pyx_DOCSTR(n) ((char *)(n)) @@ -140,12 +154,14 @@ #include #define __PYX_HAVE_API__obitools__format___format -#ifdef __GNUC__ -#define INLINE __inline__ -#elif _WIN32 -#define INLINE __inline -#else -#define INLINE +#ifndef CYTHON_INLINE + #if defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #else + #define CYTHON_INLINE + #endif #endif typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ @@ -167,8 +183,8 @@ typedef struct {PyObject **p; char *s; const long n; const char* encoding; const #define __Pyx_PyBytes_AsUString(s) ((unsigned char*) __Pyx_PyBytes_AsString(s)) #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) -static INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); #if !defined(T_PYSSIZET) #if PY_VERSION_HEX < 0x02050000 @@ -232,9 +248,9 @@ static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); #endif #endif -static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) @@ -326,59 +342,64 @@ struct __pyx_opt_args_8obitools_6format_7_format_printOutput { #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0) #ifndef CYTHON_PROFILE -#define CYTHON_PROFILE 1 + #define CYTHON_PROFILE 1 #endif #ifndef CYTHON_PROFILE_REUSE_FRAME -#define CYTHON_PROFILE_REUSE_FRAME 0 + #define CYTHON_PROFILE_REUSE_FRAME 0 #endif #if CYTHON_PROFILE -#include "compile.h" -#include "frameobject.h" -#include "traceback.h" + #include "compile.h" + #include "frameobject.h" + #include "traceback.h" -#if CYTHON_PROFILE_REUSE_FRAME -#define CYTHON_FRAME_MODIFIER static -#define CYTHON_FRAME_DEL -#else -#define CYTHON_FRAME_MODIFIER -#define CYTHON_FRAME_DEL Py_DECREF(__pyx_frame) -#endif + #if CYTHON_PROFILE_REUSE_FRAME + #define CYTHON_FRAME_MODIFIER static + #define CYTHON_FRAME_DEL + #else + #define CYTHON_FRAME_MODIFIER + #define CYTHON_FRAME_DEL Py_DECREF(__pyx_frame) + #endif -#define __Pyx_TraceCall(funcname, srcfile, firstlineno) \ -static PyCodeObject *__pyx_frame_code = NULL; \ -CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL; \ -int __Pyx_use_tracing = 0; \ -if (unlikely(PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_profilefunc)) { \ - __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, funcname, srcfile, firstlineno); \ -} + #define __Pyx_TraceDeclarations \ + static PyCodeObject *__pyx_frame_code = NULL; \ + CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL; \ + int __Pyx_use_tracing = 0; -#define __Pyx_TraceException() \ -if (unlikely(__Pyx_use_tracing( && PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_profilefunc) { \ - PyObject *exc_info = __Pyx_GetExceptionTuple(); \ - if (exc_info) { \ - PyThreadState_GET()->c_profilefunc( \ - PyThreadState_GET()->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info); \ - Py_DECREF(exc_info); \ - } \ -} + #define __Pyx_TraceCall(funcname, srcfile, firstlineno) \ + if (unlikely(PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_profilefunc)) { \ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, funcname, srcfile, firstlineno); \ + } -#define __Pyx_TraceReturn(result) \ -if (unlikely(__Pyx_use_tracing) && PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_profilefunc) { \ - PyThreadState_GET()->c_profilefunc( \ - PyThreadState_GET()->c_profileobj, __pyx_frame, PyTrace_RETURN, (PyObject*)result); \ - CYTHON_FRAME_DEL; \ -} + #define __Pyx_TraceException() \ + if (unlikely(__Pyx_use_tracing( && PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_profilefunc) { \ + PyObject *exc_info = __Pyx_GetExceptionTuple(); \ + if (exc_info) { \ + PyThreadState_GET()->c_profilefunc( \ + PyThreadState_GET()->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info); \ + Py_DECREF(exc_info); \ + } \ + } -static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); /*proto*/ -static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, const char *funcname, const char *srcfile, int firstlineno); /*proto*/ + #define __Pyx_TraceReturn(result) \ + if (unlikely(__Pyx_use_tracing) && PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_profilefunc) { \ + PyThreadState_GET()->c_profilefunc( \ + PyThreadState_GET()->c_profileobj, __pyx_frame, PyTrace_RETURN, (PyObject*)result); \ + CYTHON_FRAME_DEL; \ + } + + static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); /*proto*/ + static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, const char *funcname, const char *srcfile, int firstlineno); /*proto*/ #else -#define __Pyx_TraceCall(funcname, srcfile, firstlineno) -#define __Pyx_TraceException() -#define __Pyx_TraceReturn(result) + + #define __Pyx_TraceDeclarations + #define __Pyx_TraceCall(funcname, srcfile, firstlineno) + #define __Pyx_TraceException() + #define __Pyx_TraceReturn(result) + #endif /* CYTHON_PROFILE */ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ @@ -391,42 +412,42 @@ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ -static INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ -static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); +static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); -static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); +static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); -static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); +static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); -static INLINE char __Pyx_PyInt_AsChar(PyObject *); +static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *); -static INLINE short __Pyx_PyInt_AsShort(PyObject *); +static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *); -static INLINE int __Pyx_PyInt_AsInt(PyObject *); +static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *); -static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); +static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); -static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); +static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); -static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); +static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); -static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); +static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); -static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); +static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); -static INLINE long __Pyx_PyInt_AsLong(PyObject *); +static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *); -static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); +static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); -static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); +static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); -static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); +static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); static void __Pyx_AddTraceback(const char *funcname); /*proto*/ @@ -444,6 +465,7 @@ static char __pyx_k_3[] = "obitools.fasta"; static char __pyx_k__seq[] = "seq"; static char __pyx_k__sys[] = "sys"; static char __pyx_k__exit[] = "exit"; +static char __pyx_k__upper[] = "upper"; static char __pyx_k__write[] = "write"; static char __pyx_k__output[] = "output"; static char __pyx_k__stdout[] = "stdout"; @@ -451,6 +473,7 @@ static char __pyx_k__IOError[] = "IOError"; static char __pyx_k__options[] = "options"; static char __pyx_k____main__[] = "__main__"; static char __pyx_k____test__[] = "__test__"; +static char __pyx_k__uppercase[] = "uppercase"; static char __pyx_k__formatFasta[] = "formatFasta"; static char __pyx_k__outputFormater[] = "outputFormater"; static PyObject *__pyx_kp_s_2; @@ -466,6 +489,8 @@ static PyObject *__pyx_n_s__outputFormater; static PyObject *__pyx_n_s__seq; static PyObject *__pyx_n_s__stdout; static PyObject *__pyx_n_s__sys; +static PyObject *__pyx_n_s__upper; +static PyObject *__pyx_n_s__uppercase; static PyObject *__pyx_n_s__write; static PyObject *__pyx_int_0; static PyObject *__pyx_k_1; @@ -487,10 +512,11 @@ static PyObject *__pyx_f_8obitools_6format_7_format_printOutput(PyObject *__pyx int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; + __Pyx_TraceDeclarations __Pyx_RefNannySetupContext("printOutput"); __Pyx_TraceCall("printOutput", __pyx_f[0], 6); if (__pyx_optional_args) { @@ -521,7 +547,7 @@ static PyObject *__pyx_f_8obitools_6format_7_format_printOutput(PyObject *__pyx * if options.output is not None: * r=options.output(seq) # <<<<<<<<<<<<<< * elif options.outputFormater is not None: - * r=options.outputFormater(seq) + * r=options.outputFormater(seq,upper=options.uppercase) */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_options, __pyx_n_s__output); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); @@ -544,7 +570,7 @@ static PyObject *__pyx_f_8obitools_6format_7_format_printOutput(PyObject *__pyx * if options.output is not None: * r=options.output(seq) * elif options.outputFormater is not None: # <<<<<<<<<<<<<< - * r=options.outputFormater(seq) + * r=options.outputFormater(seq,upper=options.uppercase) * else: */ __pyx_t_4 = PyObject_GetAttr(__pyx_v_options, __pyx_n_s__outputFormater); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -556,7 +582,7 @@ static PyObject *__pyx_f_8obitools_6format_7_format_printOutput(PyObject *__pyx /* "/Users/coissac/encours/OBITools/src/obitools/format/_format.pyx":10 * r=options.output(seq) * elif options.outputFormater is not None: - * r=options.outputFormater(seq) # <<<<<<<<<<<<<< + * r=options.outputFormater(seq,upper=options.uppercase) # <<<<<<<<<<<<<< * else: * r=formatFasta(seq) */ @@ -567,38 +593,45 @@ static PyObject *__pyx_f_8obitools_6format_7_format_printOutput(PyObject *__pyx __Pyx_INCREF(__pyx_v_seq); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_seq); __Pyx_GIVEREF(__pyx_v_seq); - __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __pyx_t_5 = PyObject_GetAttr(__pyx_v_options, __pyx_n_s__uppercase); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__upper), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_4, __pyx_t_3, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_r); - __pyx_v_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L3; } /*else*/ { /* "/Users/coissac/encours/OBITools/src/obitools/format/_format.pyx":12 - * r=options.outputFormater(seq) + * r=options.outputFormater(seq,upper=options.uppercase) * else: * r=formatFasta(seq) # <<<<<<<<<<<<<< * * try: */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__formatFasta); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__formatFasta); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_seq); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_seq); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_seq); __Pyx_GIVEREF(__pyx_v_seq); - __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_r); - __pyx_v_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_v_r = __pyx_t_3; + __pyx_t_3 = 0; } __pyx_L3:; @@ -624,18 +657,18 @@ static PyObject *__pyx_f_8obitools_6format_7_format_printOutput(PyObject *__pyx * output.write("\n") * except IOError: */ - __pyx_t_4 = PyObject_GetAttr(__pyx_v_output, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L4_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_output, __pyx_n_s__write); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_r); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_r); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_r); __Pyx_GIVEREF(__pyx_v_r); - __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L4_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "/Users/coissac/encours/OBITools/src/obitools/format/_format.pyx":16 * try: @@ -644,27 +677,28 @@ static PyObject *__pyx_f_8obitools_6format_7_format_printOutput(PyObject *__pyx * except IOError: * sys.exit(0) */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_output, __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_v_output, __pyx_n_s__write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L4_error;} - __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_kp_s_2)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_2)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_2)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2)); - __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L4_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; goto __pyx_L11_try_end; __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "/Users/coissac/encours/OBITools/src/obitools/format/_format.pyx":17 * output.write(r) @@ -672,37 +706,37 @@ static PyObject *__pyx_f_8obitools_6format_7_format_printOutput(PyObject *__pyx * except IOError: # <<<<<<<<<<<<<< * sys.exit(0) */ - __pyx_t_5 = PyErr_ExceptionMatches(__pyx_builtin_IOError); - if (__pyx_t_5) { + __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_IOError); + if (__pyx_t_6) { __Pyx_AddTraceback("obitools.format._format.printOutput"); - if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} - __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_5); /* "/Users/coissac/encours/OBITools/src/obitools/format/_format.pyx":18 * output.write("\n") * except IOError: * sys.exit(0) # <<<<<<<<<<<<<< */ - __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__exit); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__exit); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} - __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_8 = PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __pyx_t_8 = PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L5_exception_handled; } __pyx_L6_except_error:; @@ -725,7 +759,7 @@ static PyObject *__pyx_f_8obitools_6format_7_format_printOutput(PyObject *__pyx __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("obitools.format._format.printOutput"); @@ -758,6 +792,7 @@ static PyObject *__pyx_pf_8obitools_6format_7_format_printOutput(PyObject *__pyx PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_8obitools_6format_7_format_printOutput __pyx_t_2; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__options,&__pyx_n_s__seq,&__pyx_n_s__output,0}; + __Pyx_TraceDeclarations __Pyx_RefNannySetupContext("printOutput"); __Pyx_TraceCall("printOutput", __pyx_f[0], 6); __pyx_self = __pyx_self; @@ -871,6 +906,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s__seq, __pyx_k__seq, sizeof(__pyx_k__seq), 0, 0, 1, 1}, {&__pyx_n_s__stdout, __pyx_k__stdout, sizeof(__pyx_k__stdout), 0, 0, 1, 1}, {&__pyx_n_s__sys, __pyx_k__sys, sizeof(__pyx_k__sys), 0, 0, 1, 1}, + {&__pyx_n_s__upper, __pyx_k__upper, sizeof(__pyx_k__upper), 0, 0, 1, 1}, + {&__pyx_n_s__uppercase, __pyx_k__uppercase, sizeof(__pyx_k__uppercase), 0, 0, 1, 1}, {&__pyx_n_s__write, __pyx_k__write, sizeof(__pyx_k__write), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; @@ -1276,7 +1313,7 @@ bad: return -1; } -static INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { PyThreadState *tstate = PyThreadState_GET(); *type = tstate->exc_type; *value = tstate->exc_value; @@ -1341,7 +1378,7 @@ static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { return result; } -static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { +static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { const unsigned char neg_one = (unsigned char)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(unsigned char) < sizeof(long)) { @@ -1360,7 +1397,7 @@ static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x); } -static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { +static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { const unsigned short neg_one = (unsigned short)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(unsigned short) < sizeof(long)) { @@ -1379,7 +1416,7 @@ static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x); } -static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { +static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { const unsigned int neg_one = (unsigned int)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(unsigned int) < sizeof(long)) { @@ -1398,7 +1435,7 @@ static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x); } -static INLINE char __Pyx_PyInt_AsChar(PyObject* x) { +static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) { const char neg_one = (char)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(char) < sizeof(long)) { @@ -1417,7 +1454,7 @@ static INLINE char __Pyx_PyInt_AsChar(PyObject* x) { return (char)__Pyx_PyInt_AsLong(x); } -static INLINE short __Pyx_PyInt_AsShort(PyObject* x) { +static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) { const short neg_one = (short)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(short) < sizeof(long)) { @@ -1436,7 +1473,7 @@ static INLINE short __Pyx_PyInt_AsShort(PyObject* x) { return (short)__Pyx_PyInt_AsLong(x); } -static INLINE int __Pyx_PyInt_AsInt(PyObject* x) { +static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) { const int neg_one = (int)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(int) < sizeof(long)) { @@ -1455,7 +1492,7 @@ static INLINE int __Pyx_PyInt_AsInt(PyObject* x) { return (int)__Pyx_PyInt_AsLong(x); } -static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { +static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { const signed char neg_one = (signed char)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(signed char) < sizeof(long)) { @@ -1474,7 +1511,7 @@ static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { return (signed char)__Pyx_PyInt_AsSignedLong(x); } -static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { +static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { const signed short neg_one = (signed short)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(signed short) < sizeof(long)) { @@ -1493,7 +1530,7 @@ static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { return (signed short)__Pyx_PyInt_AsSignedLong(x); } -static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { +static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { const signed int neg_one = (signed int)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(signed int) < sizeof(long)) { @@ -1512,7 +1549,7 @@ static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { return (signed int)__Pyx_PyInt_AsSignedLong(x); } -static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { +static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { const unsigned long neg_one = (unsigned long)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 @@ -1547,7 +1584,7 @@ static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { } } -static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { +static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 @@ -1582,7 +1619,7 @@ static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) } } -static INLINE long __Pyx_PyInt_AsLong(PyObject* x) { +static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) { const long neg_one = (long)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 @@ -1617,7 +1654,7 @@ static INLINE long __Pyx_PyInt_AsLong(PyObject* x) { } } -static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { +static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 @@ -1652,7 +1689,7 @@ static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { } } -static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { +static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { const signed long neg_one = (signed long)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 @@ -1687,7 +1724,7 @@ static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { } } -static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { +static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 @@ -1824,13 +1861,13 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { /* Type Conversion Functions */ -static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { if (x == Py_True) return 1; else if ((x == Py_False) | (x == Py_None)) return 0; else return PyObject_IsTrue(x); } -static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; @@ -1876,7 +1913,7 @@ static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { return res; } -static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject* x = PyNumber_Index(b); if (!x) return -1; @@ -1885,7 +1922,7 @@ static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { return ival; } -static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { #if PY_VERSION_HEX < 0x02050000 if (ival <= LONG_MAX) return PyInt_FromLong((long)ival); @@ -1899,7 +1936,7 @@ static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { #endif } -static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { +static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x); if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) { return (size_t)-1; diff --git a/src/obitools/format/_format.pyx b/src/obitools/format/_format.pyx index 2020401..f8dd12a 100644 --- a/src/obitools/format/_format.pyx +++ b/src/obitools/format/_format.pyx @@ -7,7 +7,7 @@ cpdef printOutput(options,seq,output=sys.stdout): if options.output is not None: r=options.output(seq) elif options.outputFormater is not None: - r=options.outputFormater(seq) + r=options.outputFormater(seq,upper=options.uppercase) else: r=formatFasta(seq) diff --git a/src/obitools/format/options.py b/src/obitools/format/options.py index d313fa3..8bf934f 100644 --- a/src/obitools/format/options.py +++ b/src/obitools/format/options.py @@ -79,6 +79,10 @@ def addInputFormatOption(optionManager): default=None, const='pep', help="input file is protein sequences") + optionManager.add_option('--upper-case', + action='store_true',dest='uppercase', + default=False, + help="Print sequences in upper case (defualt is lower case)") def addOutputFormatOption(optionManager): diff --git a/src/obitools/format/sequence/__init__.py b/src/obitools/format/sequence/__init__.py index e69de29..2a3a254 100644 --- a/src/obitools/format/sequence/__init__.py +++ b/src/obitools/format/sequence/__init__.py @@ -0,0 +1,22 @@ +from obitools.fasta import fastaIterator +from obitools.fastq import fastqSangerIterator +from obitools.seqdb.embl.parser import emblIterator +from obitools.seqdb.genbank.parser import genbankIterator +from itertools import chain + +def autoSequenceIterator(lineiterator): + first = lineiterator.next() + if first[0]==">": + reader=fastaIterator + elif first[0]=='@': + reader=fastqSangerIterator + elif first[0:3]=='ID ': + reader=emblIterator + elif first[0:6]=='LOCUS ': + reader=genbankIterator + else: + raise AssertionError,'file is not in fasta, fasta, embl, or genbank format' + + input = reader(chain([first],lineiterator)) + + return input diff --git a/src/obitools/tools/_solexapairend.c b/src/obitools/tools/_solexapairend.c index 0083998..6bc38a3 100644 --- a/src/obitools/tools/_solexapairend.c +++ b/src/obitools/tools/_solexapairend.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.12 on Mon May 17 16:55:39 2010 */ +/* Generated by Cython 0.12 on Sat Jun 19 12:17:44 2010 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -612,6 +612,7 @@ static PyObject *__pyx_kp_s_10; static PyObject *__pyx_kp_s_11; static PyObject *__pyx_kp_s_12; static PyObject *__pyx_kp_s_13; +static PyObject *__pyx_kp_s_2; static PyObject *__pyx_kp_s_3; static PyObject *__pyx_n_s_4; static PyObject *__pyx_kp_s_5; @@ -1783,13 +1784,12 @@ static PyObject *__pyx_pf_8obitools_5tools_14_solexapairend_15IterOnConsensus___ * * def buildConsensus(ali): # <<<<<<<<<<<<<< * cdef array.array[double] quality = array.array('d',[0]) - * cdef char* space=' ' + * cdef array.array[char] aseq = array.array('c',' ') */ static PyObject *__pyx_pf_8obitools_5tools_14_solexapairend_buildConsensus(PyObject *__pyx_self, PyObject *__pyx_v_ali); /*proto*/ static PyObject *__pyx_pf_8obitools_5tools_14_solexapairend_buildConsensus(PyObject *__pyx_self, PyObject *__pyx_v_ali) { arrayobject *__pyx_v_quality = 0; - char *__pyx_v_space; arrayobject *__pyx_v_aseq = 0; double *__pyx_v_dquality; char *__pyx_v_cseq; @@ -1832,8 +1832,8 @@ static PyObject *__pyx_pf_8obitools_5tools_14_solexapairend_buildConsensus(PyObj * * def buildConsensus(ali): * cdef array.array[double] quality = array.array('d',[0]) # <<<<<<<<<<<<<< - * cdef char* space=' ' - * cdef array.array[char] aseq = array.array('c',[space[0]]) + * cdef array.array[char] aseq = array.array('c',' ') + * cdef double* dquality */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); @@ -1867,42 +1867,26 @@ static PyObject *__pyx_pf_8obitools_5tools_14_solexapairend_buildConsensus(PyObj /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":146 * def buildConsensus(ali): * cdef array.array[double] quality = array.array('d',[0]) - * cdef char* space=' ' # <<<<<<<<<<<<<< - * cdef array.array[char] aseq = array.array('c',[space[0]]) - * cdef double* dquality - */ - __pyx_v_space = __pyx_k_2; - - /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":147 - * cdef array.array[double] quality = array.array('d',[0]) - * cdef char* space=' ' - * cdef array.array[char] aseq = array.array('c',[space[0]]) # <<<<<<<<<<<<<< + * cdef array.array[char] aseq = array.array('c',' ') # <<<<<<<<<<<<<< * cdef double* dquality * cdef char* cseq */ - __pyx_t_1 = PyInt_FromLong((__pyx_v_space[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_n_s__c)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__c)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__c)); - PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_t_2)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8obitools_5tools_5array_array)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_INCREF(((PyObject *)__pyx_kp_s_2)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_kp_s_2)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8obitools_5tools_5array_array)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_aseq, (PyObject*)((arrayobject *)__pyx_t_2), &__Pyx_TypeInfo_char, PyBUF_FORMAT| PyBUF_INDIRECT, 1, 0, __pyx_stack) == -1)) { __pyx_v_aseq = ((arrayobject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_aseq.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_aseq = __pyx_bstruct_aseq.strides[0]; __pyx_bshape_0_aseq = __pyx_bstruct_aseq.shape[0]; __pyx_boffset_0_aseq = __pyx_bstruct_aseq.suboffsets[0]; @@ -1911,7 +1895,7 @@ static PyObject *__pyx_pf_8obitools_5tools_14_solexapairend_buildConsensus(PyObj __pyx_v_aseq = ((arrayobject *)__pyx_t_2); __pyx_t_2 = 0; - /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":150 + /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":149 * cdef double* dquality * cdef char* cseq * cdef int i=0 # <<<<<<<<<<<<<< @@ -1920,33 +1904,33 @@ static PyObject *__pyx_pf_8obitools_5tools_14_solexapairend_buildConsensus(PyObj */ __pyx_v_i = 0; - /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":156 + /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":155 * cdef str sseq * * array.resize(quality,len(ali[0])) # <<<<<<<<<<<<<< * array.resize(aseq,len(ali[0])) * dquality = quality._d */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ali, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ali, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; resize(((arrayobject *)__pyx_v_quality), __pyx_t_3); - /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":157 + /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":156 * * array.resize(quality,len(ali[0])) * array.resize(aseq,len(ali[0])) # <<<<<<<<<<<<<< * dquality = quality._d * cseq = aseq._c */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ali, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ali, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; resize(((arrayobject *)__pyx_v_aseq), __pyx_t_3); - /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":158 + /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":157 * array.resize(quality,len(ali[0])) * array.resize(aseq,len(ali[0])) * dquality = quality._d # <<<<<<<<<<<<<< @@ -1955,7 +1939,7 @@ static PyObject *__pyx_pf_8obitools_5tools_14_solexapairend_buildConsensus(PyObj */ __pyx_v_dquality = __pyx_v_quality->_d; - /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":159 + /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":158 * array.resize(aseq,len(ali[0])) * dquality = quality._d * cseq = aseq._c # <<<<<<<<<<<<<< @@ -1964,26 +1948,26 @@ static PyObject *__pyx_pf_8obitools_5tools_14_solexapairend_buildConsensus(PyObj */ __pyx_v_cseq = __pyx_v_aseq->_c; - /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":161 + /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":160 * cseq = aseq._c * * ic=IterOnConsensus(ali) # <<<<<<<<<<<<<< * * for nuc,score in ic: */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_ali); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ali); __Pyx_GIVEREF(__pyx_v_ali); - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8obitools_5tools_14_solexapairend_IterOnConsensus)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8obitools_5tools_14_solexapairend_IterOnConsensus)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_v_ic); __pyx_v_ic = __pyx_t_1; __pyx_t_1 = 0; - /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":163 + /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":162 * ic=IterOnConsensus(ali) * * for nuc,score in ic: # <<<<<<<<<<<<<< @@ -1993,7 +1977,7 @@ static PyObject *__pyx_pf_8obitools_5tools_14_solexapairend_buildConsensus(PyObj if (PyList_CheckExact(__pyx_v_ic) || PyTuple_CheckExact(__pyx_v_ic)) { __pyx_t_3 = 0; __pyx_t_1 = __pyx_v_ic; __Pyx_INCREF(__pyx_t_1); } else { - __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_ic); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_ic); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } for (;;) { @@ -2006,7 +1990,7 @@ static PyObject *__pyx_pf_8obitools_5tools_14_solexapairend_buildConsensus(PyObj } else { __pyx_t_2 = PyIter_Next(__pyx_t_1); if (!__pyx_t_2) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } __Pyx_GOTREF(__pyx_t_2); @@ -2014,9 +1998,9 @@ static PyObject *__pyx_pf_8obitools_5tools_14_solexapairend_buildConsensus(PyObj if (PyTuple_CheckExact(__pyx_t_2) && likely(PyTuple_GET_SIZE(__pyx_t_2) == 2)) { PyObject* tuple = __pyx_t_2; __pyx_t_4 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_4); - if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_5); - __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_nuc)); @@ -2024,17 +2008,17 @@ static PyObject *__pyx_pf_8obitools_5tools_14_solexapairend_buildConsensus(PyObj __pyx_t_4 = 0; __pyx_v_score = __pyx_t_6; } else { - __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_7, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_7, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = __Pyx_UnpackItem(__pyx_t_7, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_UnpackItem(__pyx_t_7, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_EndUnpack(__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_EndUnpack(__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_nuc)); __pyx_v_nuc = ((PyObject *)__pyx_t_4); @@ -2042,17 +2026,17 @@ static PyObject *__pyx_pf_8obitools_5tools_14_solexapairend_buildConsensus(PyObj __pyx_v_score = __pyx_t_6; } - /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":164 + /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":163 * * for nuc,score in ic: * cnuc=nuc # <<<<<<<<<<<<<< * dquality[i]=score * cseq[i]=cnuc[0] */ - __pyx_t_8 = __Pyx_PyBytes_AsString(((PyObject *)__pyx_v_nuc)); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyBytes_AsString(((PyObject *)__pyx_v_nuc)); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_cnuc = __pyx_t_8; - /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":165 + /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":164 * for nuc,score in ic: * cnuc=nuc * dquality[i]=score # <<<<<<<<<<<<<< @@ -2061,7 +2045,7 @@ static PyObject *__pyx_pf_8obitools_5tools_14_solexapairend_buildConsensus(PyObj */ (__pyx_v_dquality[__pyx_v_i]) = __pyx_v_score; - /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":166 + /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":165 * cnuc=nuc * dquality[i]=score * cseq[i]=cnuc[0] # <<<<<<<<<<<<<< @@ -2070,7 +2054,7 @@ static PyObject *__pyx_pf_8obitools_5tools_14_solexapairend_buildConsensus(PyObj */ (__pyx_v_cseq[__pyx_v_i]) = (__pyx_v_cnuc[0]); - /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":167 + /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":166 * dquality[i]=score * cseq[i]=cnuc[0] * i+=1 # <<<<<<<<<<<<<< @@ -2081,7 +2065,7 @@ static PyObject *__pyx_pf_8obitools_5tools_14_solexapairend_buildConsensus(PyObj } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":169 + /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":168 * i+=1 * * array.resize(quality,i) # <<<<<<<<<<<<<< @@ -2090,7 +2074,7 @@ static PyObject *__pyx_pf_8obitools_5tools_14_solexapairend_buildConsensus(PyObj */ resize(((arrayobject *)__pyx_v_quality), __pyx_v_i); - /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":170 + /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":169 * * array.resize(quality,i) * array.resize(aseq,i) # <<<<<<<<<<<<<< @@ -2099,50 +2083,50 @@ static PyObject *__pyx_pf_8obitools_5tools_14_solexapairend_buildConsensus(PyObj */ resize(((arrayobject *)__pyx_v_aseq), __pyx_v_i); - /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":172 + /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":171 * array.resize(aseq,i) * * sseq=''.join(aseq) # <<<<<<<<<<<<<< * seq=NucSequence(ali[0].wrapped.id+'_CONS',sseq,**ali[0].wrapped.getTags()) * seq.quality=quality */ - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_3), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_3), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_aseq)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_aseq)); __Pyx_GIVEREF(((PyObject *)__pyx_v_aseq)); - __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_5)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_5)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_sseq)); __pyx_v_sseq = ((PyObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":173 + /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":172 * * sseq=''.join(aseq) * seq=NucSequence(ali[0].wrapped.id+'_CONS',sseq,**ali[0].wrapped.getTags()) # <<<<<<<<<<<<<< * seq.quality=quality * */ - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__NucSequence); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__NucSequence); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ali, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ali, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__wrapped); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__wrapped); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__id); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__id); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_2, ((PyObject *)__pyx_n_s___CONS)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_t_2, ((PyObject *)__pyx_n_s___CONS)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -2150,18 +2134,18 @@ static PyObject *__pyx_pf_8obitools_5tools_14_solexapairend_buildConsensus(PyObj PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_sseq)); __Pyx_GIVEREF(((PyObject *)__pyx_v_sseq)); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ali, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ali, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__wrapped); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__wrapped); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__getTags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__getTags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_5, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_5, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -2170,154 +2154,154 @@ static PyObject *__pyx_pf_8obitools_5tools_14_solexapairend_buildConsensus(PyObj __pyx_v_seq = __pyx_t_1; __pyx_t_1 = 0; - /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":174 + /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":173 * sseq=''.join(aseq) * seq=NucSequence(ali[0].wrapped.id+'_CONS',sseq,**ali[0].wrapped.getTags()) * seq.quality=quality # <<<<<<<<<<<<<< * * if hasattr(ali, "direction"): */ - if (PyObject_SetAttr(__pyx_v_seq, __pyx_n_s__quality, ((PyObject *)__pyx_v_quality)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_seq, __pyx_n_s__quality, ((PyObject *)__pyx_v_quality)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":176 + /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":175 * seq.quality=quality * * if hasattr(ali, "direction"): # <<<<<<<<<<<<<< * seq['alignment']=ali.direction * seq['seqASingle']=ic.seqASingle */ - __pyx_t_9 = PyObject_HasAttr(__pyx_v_ali, ((PyObject *)__pyx_n_s__direction)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_HasAttr(__pyx_v_ali, ((PyObject *)__pyx_n_s__direction)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_9) { - /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":177 + /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":176 * * if hasattr(ali, "direction"): * seq['alignment']=ali.direction # <<<<<<<<<<<<<< * seq['seqASingle']=ic.seqASingle * seq['seqBSingle']=ic.seqBSingle */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_ali, __pyx_n_s__direction); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_ali, __pyx_n_s__direction); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetItem(__pyx_v_seq, ((PyObject *)__pyx_n_s__alignment), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_v_seq, ((PyObject *)__pyx_n_s__alignment), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L7; } __pyx_L7:; - /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":178 + /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":177 * if hasattr(ali, "direction"): * seq['alignment']=ali.direction * seq['seqASingle']=ic.seqASingle # <<<<<<<<<<<<<< * seq['seqBSingle']=ic.seqBSingle * seq['seqABMatch']=ic.seqABMatch */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_ic, __pyx_n_s__seqASingle); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_ic, __pyx_n_s__seqASingle); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetItem(__pyx_v_seq, ((PyObject *)__pyx_n_s__seqASingle), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_v_seq, ((PyObject *)__pyx_n_s__seqASingle), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":179 + /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":178 * seq['alignment']=ali.direction * seq['seqASingle']=ic.seqASingle * seq['seqBSingle']=ic.seqBSingle # <<<<<<<<<<<<<< * seq['seqABMatch']=ic.seqABMatch * seq['seqAMismatch']=ic.seqAMismatch */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_ic, __pyx_n_s__seqBSingle); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_ic, __pyx_n_s__seqBSingle); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetItem(__pyx_v_seq, ((PyObject *)__pyx_n_s__seqBSingle), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_v_seq, ((PyObject *)__pyx_n_s__seqBSingle), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":180 + /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":179 * seq['seqASingle']=ic.seqASingle * seq['seqBSingle']=ic.seqBSingle * seq['seqABMatch']=ic.seqABMatch # <<<<<<<<<<<<<< * seq['seqAMismatch']=ic.seqAMismatch * seq['seqBMismatch']=ic.seqBMismatch */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_ic, __pyx_n_s__seqABMatch); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_ic, __pyx_n_s__seqABMatch); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetItem(__pyx_v_seq, ((PyObject *)__pyx_n_s__seqABMatch), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_v_seq, ((PyObject *)__pyx_n_s__seqABMatch), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":181 + /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":180 * seq['seqBSingle']=ic.seqBSingle * seq['seqABMatch']=ic.seqABMatch * seq['seqAMismatch']=ic.seqAMismatch # <<<<<<<<<<<<<< * seq['seqBMismatch']=ic.seqBMismatch * seq['seqAInsertion']=ic.seqAInsertion */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_ic, __pyx_n_s__seqAMismatch); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_ic, __pyx_n_s__seqAMismatch); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetItem(__pyx_v_seq, ((PyObject *)__pyx_n_s__seqAMismatch), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_v_seq, ((PyObject *)__pyx_n_s__seqAMismatch), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":182 + /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":181 * seq['seqABMatch']=ic.seqABMatch * seq['seqAMismatch']=ic.seqAMismatch * seq['seqBMismatch']=ic.seqBMismatch # <<<<<<<<<<<<<< * seq['seqAInsertion']=ic.seqAInsertion * seq['seqBInsertion']=ic.seqBInsertion-ic.seqBSingle */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_ic, __pyx_n_s__seqBMismatch); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_ic, __pyx_n_s__seqBMismatch); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetItem(__pyx_v_seq, ((PyObject *)__pyx_n_s__seqBMismatch), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_v_seq, ((PyObject *)__pyx_n_s__seqBMismatch), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":183 + /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":182 * seq['seqAMismatch']=ic.seqAMismatch * seq['seqBMismatch']=ic.seqBMismatch * seq['seqAInsertion']=ic.seqAInsertion # <<<<<<<<<<<<<< * seq['seqBInsertion']=ic.seqBInsertion-ic.seqBSingle * seq['seqADeletion']=ic.seqADeletion */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_ic, __pyx_n_s__seqAInsertion); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_ic, __pyx_n_s__seqAInsertion); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetItem(__pyx_v_seq, ((PyObject *)__pyx_n_s__seqAInsertion), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_v_seq, ((PyObject *)__pyx_n_s__seqAInsertion), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":184 + /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":183 * seq['seqBMismatch']=ic.seqBMismatch * seq['seqAInsertion']=ic.seqAInsertion * seq['seqBInsertion']=ic.seqBInsertion-ic.seqBSingle # <<<<<<<<<<<<<< * seq['seqADeletion']=ic.seqADeletion * seq['seqBDeletion']=ic.seqBDeletion */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_ic, __pyx_n_s__seqBInsertion); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_ic, __pyx_n_s__seqBInsertion); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_v_ic, __pyx_n_s__seqBSingle); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_v_ic, __pyx_n_s__seqBSingle); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyObject_SetItem(__pyx_v_seq, ((PyObject *)__pyx_n_s__seqBInsertion), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_v_seq, ((PyObject *)__pyx_n_s__seqBInsertion), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":185 + /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":184 * seq['seqAInsertion']=ic.seqAInsertion * seq['seqBInsertion']=ic.seqBInsertion-ic.seqBSingle * seq['seqADeletion']=ic.seqADeletion # <<<<<<<<<<<<<< * seq['seqBDeletion']=ic.seqBDeletion * return seq */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_ic, __pyx_n_s__seqADeletion); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_ic, __pyx_n_s__seqADeletion); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetItem(__pyx_v_seq, ((PyObject *)__pyx_n_s__seqADeletion), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_v_seq, ((PyObject *)__pyx_n_s__seqADeletion), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":186 + /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":185 * seq['seqBInsertion']=ic.seqBInsertion-ic.seqBSingle * seq['seqADeletion']=ic.seqADeletion * seq['seqBDeletion']=ic.seqBDeletion # <<<<<<<<<<<<<< * return seq */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_ic, __pyx_n_s__seqBDeletion); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_ic, __pyx_n_s__seqBDeletion); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetItem(__pyx_v_seq, ((PyObject *)__pyx_n_s__seqBDeletion), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_v_seq, ((PyObject *)__pyx_n_s__seqBDeletion), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":187 + /* "/Users/coissac/encours/OBITools/src/obitools/tools/_solexapairend.pyx":186 * seq['seqADeletion']=ic.seqADeletion * seq['seqBDeletion']=ic.seqBDeletion * return seq # <<<<<<<<<<<<<< @@ -3109,6 +3093,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0}, {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0}, {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0}, + {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0}, {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0}, {&__pyx_n_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 1}, {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0}, diff --git a/src/obitools/utils/bioseq.py b/src/obitools/utils/bioseq.py index ae14016..dd9a39b 100644 --- a/src/obitools/utils/bioseq.py +++ b/src/obitools/utils/bioseq.py @@ -70,7 +70,8 @@ def uniqSequence(seqIterator,taxonomy=None,mergedKey=None,mergeIds=False): s[mkey][skey]=seq[mkey][skey] for key in seq.iterkeys(): - if key in s and s[key]!=seq[key]: + # Merger proprement l'attribut merged s'il exist + if key in s and s[key]!=seq[key] and key!='count' and key[0:7]!='merged_' and key!='merged': del(s[key]) diff --git a/src/obitools/word/_binary.c b/src/obitools/word/_binary.c index 1c437c0..9ce1996 100644 --- a/src/obitools/word/_binary.c +++ b/src/obitools/word/_binary.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.12 on Wed May 5 00:11:22 2010 */ +/* Generated by Cython 0.12 on Sat Jun 19 12:17:44 2010 */ #define PY_SSIZE_T_CLEAN #include "Python.h"