Gitlab is now using https://gitlab.lcsb.uni.lu as it's primary address. Please update your bookmarks. FAQ.

Commit 52e49b9f authored by Aishwarya Alex's avatar Aishwarya Alex
Browse files

translation for namespace module

parent 49d6fbb9
......@@ -14,22 +14,12 @@
import MySQLdb
#LOAD NAMESPACE DICTIONARY
def getNamespaceDict():
namespaceDict={}
for line in open("inputs/namespaceDictFile.txt",'r'):
def getDict(filename):
dict={}
for line in open(filename,'r'):
nspace=line.split()
namespaceDict[nspace[0]]=nspace[1]
return namespaceDict
#LOAD NAMESPACE DICTIONARY
def getEntityDict():
entityDict={}
for line in open("inputs/EntityDictFile.txt",'r'):
nspace=line.split()
entityDict[nspace[0]]=nspace[1]
return entityDict
dict[nspace[0]]=nspace[1]
return dict
#LOAD reaction DICTIONARY
......@@ -42,10 +32,18 @@ def getReactionDict():
#Get GOID from GOOSE
def getGoIDfromTerm(term):
cnx = MySQLdb.connect(user='go_select', passwd='amigo', host='mysql-amigo.ebi.ac.uk', db='go_latest', port=4085)
print "get conn"
cnx = MySQLdb.connect(user='go_select', passwd='amigo', host='spitz.lbl.gov', db='go_latest', port=4085)
cursor=cnx.cursor()
print"connected and querying"
query="SELECT acc FROM term WHERE name='cell migration'"
cursor.execute(query)
print "query done"
row=cursor.fetchone()
cnx.close()
return row
\ No newline at end of file
print row
return row
print "try"
getGoIDfromTerm("cell migration")
print "done"
\ No newline at end of file
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