Commit f40c2f52 by Celine Mercier

in obitaxonomy, fixed a problem when adding taxa from file with an associated path

parent f596d3a4
......@@ -150,7 +150,7 @@ def editTaxonomyOptions(optionManager):
metavar="<file name>",
default=None,
help="Add all the species from a fasta file to the taxonomy. The header of"
" the sequences must contain the field defined by the -S option")
" the sequences must contain the field defined by the -k option")
optionManager.add_option('-k','--key_name',
action="store", dest="key_name",
......@@ -295,24 +295,14 @@ if __name__ == '__main__':
raise KeyError()
except KeyError :
if (
options.taxonomy._ranks[previous[1]] == 'genus'
or (a == ancestors[-1]
and len(a.split(' ')) >= 2
and ((not numberInStr(a))
or 'sp' in a.split(' ')
or t[0].isupper()))
) : #super sale ca
rank = 'species'
elif (len(ancestors) > 1 and a == ancestors[-2] and len(ancestors[-1].split(' ')) >= 2 \
and ((not numberInStr(a)) or 'sp' in a.split(' '))) : #a voirrrrr, trop restrictif ?
rank = 'genus'
else :
rank = 'no rank'
taxid = addTaxonFromFile(a,rank,previous[0],options)
previous = (taxid, options.taxonomy.findRankByName(rank))
if (len(ancestors) > 1 and a == ancestors[-2] and len(ancestors[-1].split(' ')) >= 2 and ((not numberInStr(a)) or 'sp' in a.split(' '))) : #a voirrrrr, trop restrictif ?
rank = 'genus'
elif a == ancestors[-1] :
rank = 'species'
else :
rank = 'no rank'
taxid = addTaxonFromFile(a,rank,previous[0],options)
previous = (taxid, options.taxonomy.findRankByName(rank))
else :
......
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