Commit 0c68b00a by Frédéric Boyer

[MOD] dirty patch for metabarcoding spring school

parent 6b4b3e39
......@@ -62,7 +62,7 @@ from obitools.graph import Graph
from obitools.utils import progressBar
from obitools.align import LCS
from obitools.align import isLCSReachable
from obitools.format.options import addInOutputOption, sequenceWriterGenerator
from obitools.format.options import addInputFormatOption, sequenceWriterGenerator
from obitools.options import getOptionManager
from obitools.graph.algorithms.component import componentIterator
from obitools.ecopcr.options import addTaxonomyDBOptions, loadTaxonomyDatabase
......@@ -155,7 +155,7 @@ if __name__=='__main__':
first = True
s = ""
for node in sub: #all nodes of a component should go with same key (taken as first sequence in comp)
print node
#print node
seq = node["_sequence"]
if first == True: #we will take first seq of a component as key for that component
s = str(seq)
......@@ -165,9 +165,11 @@ if __name__=='__main__':
indexbyseq[s].add(seq)
yy = yy + 1
print "Number of sequences added in graph: " + str(xx)
print "Number of nodes in all components: " + str (yy)
print "Number of sequences lost: " + str (xx-yy) + "!"
#print "Number of sequences added in graph: " + str(xx)
#print "Number of nodes in all components: " + str (yy)
#print "Number of sequences lost: " + str (xx-yy) + "!"
print >>sys.stderr
# since multiple different sequences have one key, we need to know what that key is for each sequence
indexbykey={} #it will have elements like: {"seq1":key, "seq2":key, ...} where 'key' is the component key to which 'seqx' belongs
......
......@@ -52,6 +52,10 @@ if __name__=='__main__':
if (options.db is None):
print>>sys.stderr, "-d option is required"
sys.exit(1)
if len(options.required)==0:
print>>sys.stderr, "-r option is required"
sys.exit(1)
tax = taxonomy.EcoTaxonomyDB(options.db)
seqd= sequence.EcoPCRDBSequenceIterator(options.db,taxonomy=tax)
......
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