Commit 2f66a775 by Eric Coissac

Patch the obicut program

parent ccd2e284
...@@ -27,26 +27,27 @@ computed using a python expression. ...@@ -27,26 +27,27 @@ computed using a python expression.
Trims the first and last 50 nucleotides of the sequence object. Trims the first and last 50 nucleotides of the sequence object.
''' '''
from obitools.fasta import fastaIterator,formatFasta from obitools.format.options import addInOutputOption, sequenceWriterGenerator
from obitools.options import getOptionManager from obitools.options import getOptionManager
from obitools.options.bioseqfilter import addSequenceFilteringOptions, sequenceFilterIteratorGenerator from obitools.options.bioseqfilter import addSequenceFilteringOptions, sequenceFilterIteratorGenerator
from obitools.options.bioseqcutter import addSequenceCuttingOptions, cutterIteratorGenerator from obitools.options.bioseqcutter import addSequenceCuttingOptions, cutterIteratorGenerator
if __name__=='__main__': if __name__=='__main__': # @UndefinedVariable
optionParser = getOptionManager([addSequenceCuttingOptions, optionParser = getOptionManager([addSequenceCuttingOptions,
addSequenceFilteringOptions addSequenceFilteringOptions,
], addInOutputOption],
entryIterator=fastaIterator progdoc=__doc__) # @UndefinedVariable
)
(options, entries) = optionParser() (options, entries) = optionParser()
filter = sequenceFilterIteratorGenerator(options) filter = sequenceFilterIteratorGenerator(options)
cutter = cutterIteratorGenerator(options) cutter = cutterIteratorGenerator(options)
writer = sequenceWriterGenerator(options)
for seq in cutter(filter(entries)): for seq in cutter(filter(entries)):
print formatFasta(seq) writer(seq)
\ No newline at end of file
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