Skip to content
Snippets Groups Projects
Commit a9a8ca36 authored by lcottret's avatar lcottret
Browse files

fix protein/gene names in sbml reading

parent 3bad8cea
No related branches found
No related tags found
No related merge requests found
......@@ -91,15 +91,15 @@ public class SbmlDocMock {
FBCModelPlugin fbcModel = (FBCModelPlugin) model.getPlugin("http://www.sbml.org/sbml/level3/version1/fbc/version2");
GeneProduct gene1 = fbcModel.createGeneProduct();
gene1.setId("g1");
gene1.setName("g1");
gene1.setLabel("g1");
gene1.setName("G1_name");
gene1.setLabel("G1_label");
fbcModel.addGeneProduct(gene1);
GeneProduct gene2 = fbcModel.createGeneProduct();
gene2.setId("g2");
gene2.setName("g2");
gene2.setLabel("g2");
gene2.setName("G2_name");
gene2.setLabel("G2_label");
fbcModel.addGeneProduct(gene2);
......
......@@ -45,6 +45,7 @@ import java.util.stream.Collectors;
import javax.xml.stream.XMLStreamException;
import fr.inrae.toulouse.metexplore.met4j_core.biodata.BioGene;
import fr.inrae.toulouse.metexplore.met4j_io.annotations.reaction.ReactionAttributes;
import fr.inrae.toulouse.metexplore.met4j_io.jsbml.reader.Met4jSbmlReaderException;
import org.junit.Before;
......@@ -242,9 +243,20 @@ public class FBCParserTest {
rxn2Plugin = (FBCReactionPlugin) rSbml2.getPlugin("fbc");
rxn3Plugin = (FBCReactionPlugin) rSbml3.getPlugin("fbc");
plugin.addGeneProduct(new GeneProduct("g1"));
plugin.addGeneProduct(new GeneProduct("g2"));
plugin.addGeneProduct(new GeneProduct("g3"));
GeneProduct g1 = new GeneProduct("g1");
g1.setLabel("g1Label");
g1.setName("g1Name");
GeneProduct g2 = new GeneProduct("g2");
g2.setLabel("g2Label");
// G2 Does not have name
GeneProduct g3 = new GeneProduct("g3");
// G3 does not have neither name or label
plugin.addGeneProduct(g1);
plugin.addGeneProduct(g2);
plugin.addGeneProduct(g3);
GeneProductRef p1 = new GeneProductRef("g1ref");
p1.setGeneProduct("g1");
......@@ -280,6 +292,22 @@ public class FBCParserTest {
parser.parseModel(model, network);
BioGene bioGene1 = network.getGenesView().get("g1");
assertNotNull(bioGene1);
assertEquals("g1", bioGene1.getId());
assertEquals("g1Name", bioGene1.getName());
BioGene bioGene2 = network.getGenesView().get("g2");
assertNotNull(bioGene2);
assertEquals("g2", bioGene2.getId());
assertEquals("g2Label", bioGene2.getName());
BioGene bioGene3 = network.getGenesView().get("g3");
assertNotNull(bioGene3);
assertEquals("g3", bioGene3.getId());
assertEquals("g3", bioGene3.getName());
String ga1 = BioReactionUtils.getGPR(network, r1, false);
assertEquals("g1", ga1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment