/usr/share/ray/scripts/NCBI-Taxonomy/GenerateTaxonNames.py is in ray-extra 2.3.1-5.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | #!/usr/bin/env python
#encoding: UTF-8
# author: Sébastien Boisvert
"""
GenerateTaxonNames.py Taxon-Names.tsv Taxon-Types.tsv > NCBI-taxons-for-Ray.txt
Genome-to-Taxon.tsv -> ../2012-01-23/gi_taxid_nucl.dmp
Taxon-Names.tsv -> ../2011-11-05/ncbi.map
Taxon-Types.tsv -> ../2011-11-05/ncbi.lvl
TreeOfLife-Edges.tsv -> ../2011-11-05/TreeOfLife-Edges.tsv
"""
import sys
if len(sys.argv)!=3:
print __doc__
sys.exit(1)
namesFile=sys.argv[1]
typesFile=sys.argv[2]
types={}
for line in open(typesFile):
tokens=line.split("\t")
type=int(tokens[0])
name=tokens[1].strip()
types[type]=name
for line in open(namesFile):
tokens=line.split("\t")
type=int(tokens[3])
taxonNumber=tokens[0]
taxonName=tokens[1]
rank="CachingError"
if type in types:
rank=types[type]
print taxonNumber+" "+taxonName+" "+rank
|