Created
February 18, 2014 01:14
-
-
Save kozo2/9062681 to your computer and use it in GitHub Desktop.
iron-maiden
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
from pymongo.collection import Collection | |
client = MongoClient() | |
db = client['keggscape'] | |
targets = db['all_target_ids_all'] | |
ecoli_targets = targets.find({"Species" : "Escherichia coli"}) | |
convtable = db['conv-eco-uniprot'] | |
eco = db['eco'] | |
for target in ecoli_targets: | |
conv = convtable.find_one({ "uniprot_id" : "up:" + target['UniProt ID'] }) | |
if (conv != None): | |
targets.update({"_id" : target["_id"]}, {"$set" : {"kegg_id" : conv["kegg_id"]}}) | |
#import pdb; pdb.set_trace() | |
#target.insert({'kegg_id' : conv['kegg_id']}) | |
#print target['ID'], target['UniProt ID'], conv["kegg_id"] | |
import pdb; pdb.set_trace() | |
eco.insert(ecoli_targets) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment