cbmpy
cbmpy copied to clipboard
createGeneProteinAssociation can lead to duplicate gene labels
When I do
import cbmpy as cbm
mod = cbm.CBRead.readSBML3FBC('e_coli_core.xml.gz')
mod.getGene('G_b4395').setLabel('b4301')
I receive - as expected - a warning that the gene label already exists and it is therefore not set.
However, when I then do:
mod.createReaction('dummy')
mod.createGeneProteinAssociation('dummy', 'b4395')
two genes will exist with identical label:
[g for g in mod.getGeneIds() if 'b4395' in g] # ['G_b4395', 'b4395']
[g for g in mod.getGeneLabels() if 'b4395' in g] # ['b4395', 'b4395']
Export and import of the model works fine, however, if one uses the online validator it will return the error:
Error Line 10826 Column 47: (SBML Validation Rule #fbc-21205) The attribute 'fbc:label' on a <GeneProduct> must be unique among the set of all <GeneProduct> elements defined in the <Model>. Reference: L3V1 Fbc V2 Section 3.5 A GeneProduct with the label 'b4395' has already been declared.
Could this be fixed?!
Good catch, I will look into this