Commit f3e6c41c by Eric Coissac

Add input and output options to solexaPairEnd

parent e37bef2e
......@@ -28,6 +28,8 @@ from obitools.fastq import fastqSolexaIterator, formatFastq
from obitools.align import QSolexaReverseAssemble
from obitools.align import QSolexaRightReverseAssemble
from obitools.tools._solexapairend import buildConsensus
from obitools.format.options import addInputFormatOption,addOutputFormatOption,\
sequenceWriterGenerator
from itertools import chain
......@@ -39,6 +41,24 @@ def addSolexaPairEndOptions(optionManager):
default=None,
help="Filename containing reverse solexa reads "
)
optionManager.add_option('--sanger',
action="store_const", dest="seqinformat",
default=None,
const='sanger',
help="input file is in sanger fastq nucleic format (standard fastq)")
optionManager.add_option('--solexa',
action="store_const", dest="seqinformat",
default=None,
const='solexa',
help="input file is in fastq nucleic format produced by solexa sequencer")
optionManager.add_option('--illumina',
action="store_const", dest="seqinformat",
default=None,
const='illumina',
help="input file is in fastq nucleic format produced by old solexa sequencer")
def cutDirectReverse(entries):
......@@ -103,8 +123,8 @@ def buildAlignment(sequences):
if __name__ == '__main__':
optionParser = getOptionManager([addSolexaPairEndOptions],
entryIterator=fastqSolexaIterator
optionParser = getOptionManager([addSolexaPairEndOptions,addOutputFormatOption]
# entryIterator=fastqSolexaIterator
)
(options, direct) = optionParser()
......@@ -112,12 +132,14 @@ if __name__ == '__main__':
if options.reverse is None:
sequences=cutDirectReverse(direct)
else:
reverse = fastqSolexaIterator(options.reverse)
reverse = options.readerIterator(options.reverse)
sequences=seqPairs(direct,reverse)
writer = sequenceWriterGenerator(options)
for ali in buildAlignment(sequences):
consensus = buildConsensus(ali)
print formatFastq(consensus)
writer(consensus)
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