Created
August 11, 2016 07:16
-
-
Save irwandwiyanto/bc958e11ea8940d96d1c9c9946045db4 to your computer and use it in GitHub Desktop.
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 characters
| #!/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") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment