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

Commit 41416b6d authored by Aishwarya Alex's avatar Aishwarya Alex
Browse files

mar 15th 2017

parent 9347c784
......@@ -89,12 +89,22 @@ def get_entry_for_term(term):
parameter = term.find(ns_tag("parameter"))
belnamespace = parameter.get(ns_tag("ns")) if parameter.get(ns_tag("ns")) is not None else ""
miriamnamespace = belnamespace
identifier=parameter.text
if belnamespace is not "":
identifier = NT.termToIdentifier(belnamespace, parameter.text)
elementName = "" # function@TERM
elementAnnotation = "" # ns@PARAMETER+text
#get element
# check for abundance element name from namespace
if element=="abundance":
element=abundanceDict[element]
if belnamespace is not "":
new_element=element+"_"+belnamespace
if abundanceDict.has_key(new_element):
element=abundanceDict[new_element]
else:
check_to_add_in_file(belnamespace,"outputs/additional/toAddNamespaces.txt")
else: #no namespace, checking in G0, eg encountered: neuroinflammation,Amyloid beta peptides, etc
identifier = NT.termToIdentifier(belnamespace, parameter.text)
if element in entityDict.keys():
elementName = entityDict[element]
else:
......@@ -102,12 +112,14 @@ def get_entry_for_term(term):
#add not handled entity to file
check_to_add_in_file(element,"outputs/additional/toMapEntities.txt")
if namespaceDict.has_key(belnamespace):
miriamnamespace = namespaceDict[belnamespace]
elif belnamespace is not "":
#add not handled namespace to file
check_to_add_in_file(belnamespace,"outputs/additional/toAddNamespaces.txt")
elementAnnotation = parameter.text + "\t" + miriamnamespace + ":" + parameter.text
elementAnnotation = parameter.text + "\t" + miriamnamespace + ":" + identifier
entry=elementName + "\t" + elementAnnotation
return entry
except Exception as ExceptionTerm:
......@@ -245,7 +257,7 @@ def convertXBEL(filepath):
#if reaction is ComplexAbundance
elif relationship == "complexAbundance" :
elif relationship == "complexAbundance":
complexTerms=subject.find(ns_tag('term')).findall(ns_tag('term'))
complexList=[]
for each in complexTerms:
......
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