So, as mentioned I'm trying to find a way of translating a graphml file (or another format such as xgmml, csv, edgelist), from networkx or igraph (python or R) into this SBML format.
I believe there should be an easy way but...I can't find one. Any ideas?
EDIT: there are some other fomats that can be used to eventually land on SBML planet but still I don't have any ideas about how to export to any of them.
EDIT II: here I posted a question related to SBML and Cytoscape so...might be useful to some else who is interested into the topic.
SBML is mainly encoding process or reaction based models. The corresponding network graph of such models is a bipartite graph, i.e., there are two classes of nodes in the graph (reactions and species) and only edges between species and reaction nodes, but never between a species-species or species-reaction. An important concept in SBML is the stoichiometry in the reaction which is basically an edge attribute defining how the species occur in corresponding reactions.
So for graphs to be convertible to SBML they must follow a certain structure, i.e. they must be bipartite directed graphs with reaction and species nodes with stoichiometry information on the edges.
Such graphs can easily be converted to SBML using for instance libsbml or JSBML (both libraries for the manipulation of SBML). I attached an example below with the python bindings from libsbml.
with the output
The SBML can then be visualized using tools like cy3sbml in Cytoscape