Commit 06e2cda7 authored by AITE Meziane's avatar AITE Meziane

fixing gbr output

parent 4bd1a452
......@@ -33,7 +33,7 @@ option:
"""
import re
from padmet.utils.sbmlPlugin import parseNotes, parseGeneAssoc
from libsbml import *
import libsbml
import docopt
import os
import subprocess
......@@ -93,7 +93,7 @@ def main():
ortho_in_omcl_and_inp = ortho_in_omcl.intersection(ortho_in_inp)
#read in model metabolic reactions with or & and in gene assoc'
reader = SBMLReader()
reader = libsbml.SBMLReader()
document = reader.readSBML(model_metabolic)
for i in range(document.getNumErrors()):
print (document.getError(i).getMessage())
......@@ -103,7 +103,7 @@ def main():
and "and" in parseNotes(rxn).get("GENE_ASSOCIATION",[""])[0]]
if verbose: print("nb TU reactions: %s" %len(TU_reactions))
reader_study = SBMLReader()
reader_study = libsbml.SBMLReader()
document_study = reader_study.readSBML(study_metabolic)
for i in range(document_study.getNumErrors()):
print (document_study.getError(i).getMessage())
......@@ -139,7 +139,7 @@ def main():
rxn_to_add[rxn] = new_ga
print("%s/%s reactions to add" %(len(rxn_to_add),len(TU_reactions)))
reader_study = SBMLReader()
reader_study = libsbml.SBMLReader()
document_study = reader_study.readSBML(study_metabolic)
for i in range(document_study.getNumErrors()):
print (document_study.getError(i).getMessage())
......@@ -173,7 +173,7 @@ def main():
[species_in_rxn.update(set(x)) for x in species_in_rxn_temp]
[listOfSpecies.remove(sId) for sId in set([x.id for x in listOfSpecies]).difference(species_in_rxn)]
writeSBMLToFile(document_study, output)
libsbml.writeSBMLToFile(document_study, output)
def check(value, message):
"""If 'value' is None, prints an error message constructed using
......
......@@ -16,7 +16,7 @@ def main():
ulva_bact = PadmetSpec("/home/maite/Documents/data/Ulva/ulva_bacteria.padmet")
padmetRef = PadmetRef("/home/maite/Forge/docker/aureme_workspace/ulva/database/metacyc_21.5_enhanced.padmet")
output_folder = "/home/maite/Documents/data/Ulva/pwy_analysis/"
pwy_csv = output_folder+"pathways.csv"
pwy_csv = output_folder+"pathways.tsv"
png_folder = output_folder+"pwys/"
#k=pwy_id, v = {'total':[rxn_ids], 'ulva':[rxn_ids], 'bact_1':[rxn_ids], 'bact_2':[rxn_ids]}
pwy_dict = {}
......@@ -59,11 +59,13 @@ def main():
count = 0
with open(pwy_csv, 'w') as csvfile:
fieldnames = ['pathway_id','pathway_name',
'All_reactions','Nb_all_reactions',
'Reactions_in_ULVA','Nb_reactions_in_ULVA','Ratio_ULVA',
'Reactions_in_ULVA_MS2_BACTERIA','Nb_reactions_in_ULVA_MS2_BACTERIA','Ratio_ULVA_MS2_BACTERIA',
'Reactions_in_ULVA_MS6_BACTERIA','Nb_reactions_in_ULVA_MS6_BACTERIA','Ratio_ULVA_MS6_BACTERIA',
'Reactions_in_ULVA_MS2_MS6_BACTERIA','Nb_reactions_in_ULVA_MS2_MS6_BACTERIA','Ratio_ULVA_MS2_MS6_BACTERIA']
'Nb_all_reactions','Nb_reactions_in_ULVA','Ratio_ULVA',
'Nb_reactions_in_ULVA_MS2_BACTERIA', 'Ratio_ULVA_MS2_BACTERIA',
'Nb_reactions_in_ULVA_MS6_BACTERIA', 'Ratio_ULVA_MS6_BACTERIA',
'Nb_reactions_in_ULVA_MS2_MS6_BACTERIA','Ratio_ULVA_MS2_MS6_BACTERIA',
'All_reactions', 'Reactions_in_ULVA',
'Reactions_in_ULVA_MS2_BACTERIA', 'Reactions_in_ULVA_MS6_BACTERIA',
'Reactions_in_ULVA_MS2_MS6_BACTERIA']
writer = csv.DictWriter(csvfile, fieldnames=fieldnames, delimiter='\t')
writer.writeheader()
......
......@@ -7,6 +7,6 @@
#HttpOnly_gem-aureme.irisa.fr FALSE / FALSE 1537962753 gem_a1562_ulvagem_UserName Dyliss
#HttpOnly_gem-aureme.irisa.fr FALSE / FALSE 1537962753 gem_a1562_ulvagem_Token dc07ac60d1c801c7754bee22bdde6b4c
#HttpOnly_gem-aureme.irisa.fr FALSE / FALSE 0 gem_a1562_ulva_bacteria__session 2un1d21meghud5ivvdj29nr4s0
#HttpOnly_gem-aureme.irisa.fr FALSE / FALSE 1537978613 gem_a1562_ulva_bacteria_UserID 1
#HttpOnly_gem-aureme.irisa.fr FALSE / FALSE 1537978613 gem_a1562_ulva_bacteria_UserName Dyliss
#HttpOnly_gem-aureme.irisa.fr FALSE / FALSE 1537978613 gem_a1562_ulva_bacteria_Token 5087d3be20e5c36581bde35ea66ffc74
#HttpOnly_gem-aureme.irisa.fr FALSE / FALSE 1539700747 gem_a1562_ulva_bacteria_UserID 1
#HttpOnly_gem-aureme.irisa.fr FALSE / FALSE 1539700747 gem_a1562_ulva_bacteria_UserName Dyliss
#HttpOnly_gem-aureme.irisa.fr FALSE / FALSE 1539700747 gem_a1562_ulva_bacteria_Token 5087d3be20e5c36581bde35ea66ffc74
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