Commit 8cedba3c by Eric Coissac

patch bug in the fastq formating of the index command and several small

other stuffs
parent 7042f912
......@@ -63,7 +63,7 @@ def addOptions(parser):
parser.add_argument('--check-ids', dest='index:checkids',
action='store_true',
default=None,
default=False,
help='Checks that forward and reverse ids are identical')
parser.add_argument('--max-read', dest='index:maxread',
......@@ -100,17 +100,17 @@ def addOptions(parser):
parser.add_argument('--forward-fasta', dest='index:ffasta',
action='store_true',
default=None,
default=False,
help='forward file is a fasta file')
parser.add_argument('--check-pairing', dest='index:checkpairs',
action='store_true',
default=None,
default=False,
help='ensure that forward and reverse files are correctly paired')
parser.add_argument('--reverse-fasta', dest='index:rfasta',
action='store_true',
default=None,
default=False,
help='forward file is a fasta file')
tmpdir = []
......@@ -213,7 +213,7 @@ def readFasta(filename):
if seqid > 0:
seq = ''.join(seq)
yield (sid,bytes(seq,encoding='latin1'))
sid = line[1:].split(' ',1)[0].rsplit('/',1)[0]
sid = line[1:].split(' ',1)[0].rsplit('/',1)[0].strip()
seqid+=1
seq=[]
else:
......@@ -237,7 +237,7 @@ def readFastq(filename):
if seqid > 0:
seq = ''.join(seq)
yield (sid,bytes(seq,encoding='latin1'))
sid = line[1:].split(' ',1)[0].rsplit('/',1)[0]
sid = line[1:].split(' ',1)[0].rsplit('/',1)[0].strip()
seqid+=1
lseq = 0
seq=[]
......@@ -282,9 +282,9 @@ def lengthStats(seqs):
def formatFastq(seq):
fastq = '@s{id:0>7}\n{seq}\n+\n{qual}'
fastq = '@{id:0>7}\n{seq}\n+\n{qual}'
return fastq.format(id=seq[0],
seq=seq[1].decode('latin1'),
seq=seq[1].decode('ascii'),
qual='0'*len(seq[1]))
......@@ -319,7 +319,7 @@ def doubleToCheckedPairs(forward,reverse,mate=False):
else:
yield (seq,(seq[0],reverseComplement(seq[1])))
for sid,seq in rstore.iteritems():
for sid,seq in rstore.items():
if seq is not None:
seq = zlib.decompress(seq)
if mate:
......@@ -461,9 +461,9 @@ def run(config):
fconvert=True
rconvert=True
length = config['index']['length']
logger.info('Simulate paired reads of %dbp' % length)
if length is None:
length=100
logger.info('Simulate paired reads of %dbp' % length)
pairs = singleToPairedEnd(cforward,length)
else:
if config['index']['checkpairs']:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment