Created
August 11, 2016 07:16
-
-
Save irwandwiyanto/bc958e11ea8940d96d1c9c9946045db4 to your computer and use it in GitHub Desktop.
Revisions
-
irwandwiyanto created this gist
Aug 11, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ #!/usr/bin/python import simplejson as json import optparse import sys input_file = str(sys.argv[1]) data = open(input_file, 'r') location_database = open('/home/bioinformatics2/DW/taxo.json', 'r') database = json.load(location_database) for line in data: for taxonomy in database: if taxonomy["genus"] == line.replace('\n','') : print "Kingdom: %s," % taxonomy['kingdom'], print "phylum: %s," % taxonomy['phylum'], print "class: %s," % taxonomy['class'], print "order: %s," % taxonomy['order'], print "family: %s," % taxonomy['family'], print "genus: %s" % taxonomy['genus'] break else: print ("No found genus on taxanomy")