Skip to content
Snippets Groups Projects
Commit 6f47fe03 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

unit tests for parsing sbo terms into species type

parent 17ba584e
No related branches found
No related tags found
1 merge request!186Resolve "upload of sbml"
Showing
with 499 additions and 1 deletion
......@@ -4,12 +4,15 @@ import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
import lcsb.mapviewer.converter.model.sbml.species.SbmlSpeciesParserTest;
@RunWith(Suite.class)
@SuiteClasses({ GenericSbmlParserTest.class, //
GenericSbmlToXmlParserTest.class, //
SbmlExporterTest.class, //
SbmlPareserForInvalidReactionTest.class, //
SbmlParserTest.class,//
SbmlParserTest.class, //
SbmlSpeciesParserTest.class,//
})
public class AllSbmlConverterTests {
......
package lcsb.mapviewer.converter.model.sbml.species;
import static org.junit.Assert.assertTrue;
import java.io.FileNotFoundException;
import org.apache.log4j.Logger;
import org.junit.Test;
import lcsb.mapviewer.converter.ConverterParams;
import lcsb.mapviewer.converter.InvalidInputDataExecption;
import lcsb.mapviewer.converter.model.sbml.SbmlParser;
import lcsb.mapviewer.model.map.model.Model;
import lcsb.mapviewer.model.map.species.AntisenseRna;
import lcsb.mapviewer.model.map.species.Complex;
import lcsb.mapviewer.model.map.species.Degraded;
import lcsb.mapviewer.model.map.species.Drug;
import lcsb.mapviewer.model.map.species.Element;
import lcsb.mapviewer.model.map.species.Gene;
import lcsb.mapviewer.model.map.species.GenericProtein;
import lcsb.mapviewer.model.map.species.Ion;
import lcsb.mapviewer.model.map.species.IonChannelProtein;
import lcsb.mapviewer.model.map.species.Phenotype;
import lcsb.mapviewer.model.map.species.ReceptorProtein;
import lcsb.mapviewer.model.map.species.Rna;
import lcsb.mapviewer.model.map.species.SimpleMolecule;
import lcsb.mapviewer.model.map.species.Unknown;
public class SbmlSpeciesParserTest {
Logger logger = Logger.getLogger(SbmlSpeciesParserTest.class);
SbmlParser parser = new SbmlParser();
@Test
public void testParseAntisenseRna() throws FileNotFoundException, InvalidInputDataExecption {
Model model = parser.createModel(new ConverterParams().filename("testFiles/small/antisense_rna.xml"));
Element element = model.getElementByElementId("s1");
assertTrue(element instanceof AntisenseRna);
}
@Test
public void testParseComplex() throws FileNotFoundException, InvalidInputDataExecption {
Model model = parser.createModel(new ConverterParams().filename("testFiles/small/complex.xml"));
Element element = model.getElementByElementId("s1");
assertTrue(element instanceof Complex);
}
@Test
public void testParseDegraded() throws FileNotFoundException, InvalidInputDataExecption {
Model model = parser.createModel(new ConverterParams().filename("testFiles/small/degraded.xml"));
Element element = model.getElementByElementId("s1");
assertTrue(element instanceof Degraded);
}
@Test
public void testParseDrug() throws FileNotFoundException, InvalidInputDataExecption {
Model model = parser.createModel(new ConverterParams().filename("testFiles/small/drug.xml"));
Element element = model.getElementByElementId("s1");
assertTrue(element instanceof Drug);
}
@Test
public void testParseGene() throws FileNotFoundException, InvalidInputDataExecption {
Model model = parser.createModel(new ConverterParams().filename("testFiles/small/gene.xml"));
Element element = model.getElementByElementId("s1");
assertTrue(element instanceof Gene);
}
@Test
public void testParseGenericProtein() throws FileNotFoundException, InvalidInputDataExecption {
Model model = parser.createModel(new ConverterParams().filename("testFiles/small/generic_protein.xml"));
Element element = model.getElementByElementId("s1");
assertTrue(element instanceof GenericProtein);
}
@Test
public void testParseIonChannel() throws FileNotFoundException, InvalidInputDataExecption {
Model model = parser.createModel(new ConverterParams().filename("testFiles/small/ion_channel.xml"));
Element element = model.getElementByElementId("s1");
assertTrue(element instanceof IonChannelProtein);
}
@Test
public void testParseIon() throws FileNotFoundException, InvalidInputDataExecption {
Model model = parser.createModel(new ConverterParams().filename("testFiles/small/ion.xml"));
Element element = model.getElementByElementId("s1");
assertTrue(element instanceof Ion);
}
@Test
public void testParsePhenotype() throws FileNotFoundException, InvalidInputDataExecption {
Model model = parser.createModel(new ConverterParams().filename("testFiles/small/phenotype.xml"));
Element element = model.getElementByElementId("s1");
assertTrue(element instanceof Phenotype);
}
@Test
public void testParseReceptor() throws FileNotFoundException, InvalidInputDataExecption {
Model model = parser.createModel(new ConverterParams().filename("testFiles/small/receptor.xml"));
Element element = model.getElementByElementId("s1");
assertTrue(element instanceof ReceptorProtein);
}
@Test
public void testParseRna() throws FileNotFoundException, InvalidInputDataExecption {
Model model = parser.createModel(new ConverterParams().filename("testFiles/small/rna.xml"));
Element element = model.getElementByElementId("s1");
assertTrue(element instanceof Rna);
}
@Test
public void testParseSimpleMolecule() throws FileNotFoundException, InvalidInputDataExecption {
Model model = parser.createModel(new ConverterParams().filename("testFiles/small/small_molecule.xml"));
Element element = model.getElementByElementId("s1");
assertTrue(element instanceof SimpleMolecule);
}
@Test
public void testParseSimpleMoleculeWithAlternativeSBOTerm() throws FileNotFoundException, InvalidInputDataExecption {
Model model = parser.createModel(new ConverterParams().filename("testFiles/small/small_molecule2.xml"));
Element element = model.getElementByElementId("s1");
assertTrue(element instanceof SimpleMolecule);
}
@Test
public void testParseUnknown() throws FileNotFoundException, InvalidInputDataExecption {
Model model = parser.createModel(new ConverterParams().filename("testFiles/small/unknown_species.xml"));
Element element = model.getElementByElementId("s1");
assertTrue(element instanceof Unknown);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
<model id="TestGEN">
<annotation/>
<listOfCompartments>
<compartment constant="true" id="cell" name="cell" sboTerm="SBO:0000290" size="1">
<annotation>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqmodel="http://biomodels.net/model-qualifiers/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
<rdf:Description rdf:about="#">
<bqbiol:isVersionOf>
<rdf:Bag>
<rdf:li rdf:resource="urn:miriam:obo.go:GO:0005623"/>
</rdf:Bag>
</bqbiol:isVersionOf>
</rdf:Description>
</rdf:RDF>
</annotation>
</compartment>
</listOfCompartments>
<listOfSpecies>
<species boundaryCondition="false" compartment="cell" initialConcentration="1" id="s1" name="nm1" sboTerm="SBO:0000334">
<annotation/>
</species>
</listOfSpecies>
</model>
</sbml>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
<model id="TestGEN">
<annotation/>
<listOfCompartments>
<compartment constant="true" id="cell" name="cell" sboTerm="SBO:0000290" size="1">
<annotation>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqmodel="http://biomodels.net/model-qualifiers/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
<rdf:Description rdf:about="#">
<bqbiol:isVersionOf>
<rdf:Bag>
<rdf:li rdf:resource="urn:miriam:obo.go:GO:0005623"/>
</rdf:Bag>
</bqbiol:isVersionOf>
</rdf:Description>
</rdf:RDF>
</annotation>
</compartment>
</listOfCompartments>
<listOfSpecies>
<species boundaryCondition="false" compartment="cell" initialConcentration="1" id="s1" name="nm1" sboTerm="SBO:0000297">
<annotation/>
</species>
</listOfSpecies>
</model>
</sbml>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
<model id="TestGEN">
<annotation/>
<listOfCompartments>
<compartment constant="true" id="cell" name="cell" sboTerm="SBO:0000290" size="1">
<annotation>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqmodel="http://biomodels.net/model-qualifiers/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
<rdf:Description rdf:about="#">
<bqbiol:isVersionOf>
<rdf:Bag>
<rdf:li rdf:resource="urn:miriam:obo.go:GO:0005623"/>
</rdf:Bag>
</bqbiol:isVersionOf>
</rdf:Description>
</rdf:RDF>
</annotation>
</compartment>
</listOfCompartments>
<listOfSpecies>
<species boundaryCondition="false" compartment="cell" initialConcentration="1" id="s1" name="nm1" sboTerm="SBO:0000291">
<annotation/>
</species>
</listOfSpecies>
</model>
</sbml>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
<model id="TestGEN">
<annotation/>
<listOfCompartments>
<compartment constant="true" id="cell" name="cell" sboTerm="SBO:0000290" size="1">
<annotation>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqmodel="http://biomodels.net/model-qualifiers/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
<rdf:Description rdf:about="#">
<bqbiol:isVersionOf>
<rdf:Bag>
<rdf:li rdf:resource="urn:miriam:obo.go:GO:0005623"/>
</rdf:Bag>
</bqbiol:isVersionOf>
</rdf:Description>
</rdf:RDF>
</annotation>
</compartment>
</listOfCompartments>
<listOfSpecies>
<species boundaryCondition="false" compartment="cell" initialConcentration="1" id="s1" name="nm1" sboTerm="SBO:0000298">
<annotation/>
</species>
</listOfSpecies>
</model>
</sbml>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
<model id="TestGEN">
<annotation/>
<listOfCompartments>
<compartment constant="true" id="cell" name="cell" sboTerm="SBO:0000290" size="1">
<annotation>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqmodel="http://biomodels.net/model-qualifiers/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
<rdf:Description rdf:about="#">
<bqbiol:isVersionOf>
<rdf:Bag>
<rdf:li rdf:resource="urn:miriam:obo.go:GO:0005623"/>
</rdf:Bag>
</bqbiol:isVersionOf>
</rdf:Description>
</rdf:RDF>
</annotation>
</compartment>
</listOfCompartments>
<listOfSpecies>
<species boundaryCondition="false" compartment="cell" initialConcentration="1" id="s1" name="nm1" sboTerm="SBO:0000243">
<annotation/>
</species>
</listOfSpecies>
</model>
</sbml>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
<model id="TestGEN">
<annotation/>
<listOfCompartments>
<compartment constant="true" id="cell" name="cell" sboTerm="SBO:0000290" size="1">
<annotation>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqmodel="http://biomodels.net/model-qualifiers/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
<rdf:Description rdf:about="#">
<bqbiol:isVersionOf>
<rdf:Bag>
<rdf:li rdf:resource="urn:miriam:obo.go:GO:0005623"/>
</rdf:Bag>
</bqbiol:isVersionOf>
</rdf:Description>
</rdf:RDF>
</annotation>
</compartment>
</listOfCompartments>
<listOfSpecies>
<species boundaryCondition="false" compartment="cell" initialConcentration="1" id="s1" name="nm1" sboTerm="SBO:0000252">
<annotation/>
</species>
</listOfSpecies>
</model>
</sbml>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
<model id="TestGEN">
<annotation/>
<listOfCompartments>
<compartment constant="true" id="cell" name="cell" sboTerm="SBO:0000290" size="1">
<annotation>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqmodel="http://biomodels.net/model-qualifiers/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
<rdf:Description rdf:about="#">
<bqbiol:isVersionOf>
<rdf:Bag>
<rdf:li rdf:resource="urn:miriam:obo.go:GO:0005623"/>
</rdf:Bag>
</bqbiol:isVersionOf>
</rdf:Description>
</rdf:RDF>
</annotation>
</compartment>
</listOfCompartments>
<listOfSpecies>
<species boundaryCondition="false" compartment="cell" initialConcentration="1" id="s1" name="nm1" sboTerm="SBO:0000327">
<annotation/>
</species>
</listOfSpecies>
</model>
</sbml>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
<model id="TestGEN">
<annotation/>
<listOfCompartments>
<compartment constant="true" id="cell" name="cell" sboTerm="SBO:0000290" size="1">
<annotation>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqmodel="http://biomodels.net/model-qualifiers/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
<rdf:Description rdf:about="#">
<bqbiol:isVersionOf>
<rdf:Bag>
<rdf:li rdf:resource="urn:miriam:obo.go:GO:0005623"/>
</rdf:Bag>
</bqbiol:isVersionOf>
</rdf:Description>
</rdf:RDF>
</annotation>
</compartment>
</listOfCompartments>
<listOfSpecies>
<species boundaryCondition="false" compartment="cell" initialConcentration="1" id="s1" name="nm1" sboTerm="SBO:0000284">
<annotation/>
</species>
</listOfSpecies>
</model>
</sbml>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
<model id="TestGEN">
<annotation/>
<listOfCompartments>
<compartment constant="true" id="cell" name="cell" sboTerm="SBO:0000290" size="1">
<annotation>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqmodel="http://biomodels.net/model-qualifiers/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
<rdf:Description rdf:about="#">
<bqbiol:isVersionOf>
<rdf:Bag>
<rdf:li rdf:resource="urn:miriam:obo.go:GO:0005623"/>
</rdf:Bag>
</bqbiol:isVersionOf>
</rdf:Description>
</rdf:RDF>
</annotation>
</compartment>
</listOfCompartments>
<listOfSpecies>
<species boundaryCondition="false" compartment="cell" initialConcentration="1" id="s1" name="nm1" sboTerm="SBO:0000358">
<annotation/>
</species>
</listOfSpecies>
</model>
</sbml>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
<model id="TestGEN">
<annotation/>
<listOfCompartments>
<compartment constant="true" id="cell" name="cell" sboTerm="SBO:0000290" size="1">
<annotation>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqmodel="http://biomodels.net/model-qualifiers/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
<rdf:Description rdf:about="#">
<bqbiol:isVersionOf>
<rdf:Bag>
<rdf:li rdf:resource="urn:miriam:obo.go:GO:0005623"/>
</rdf:Bag>
</bqbiol:isVersionOf>
</rdf:Description>
</rdf:RDF>
</annotation>
</compartment>
</listOfCompartments>
<listOfSpecies>
<species boundaryCondition="false" compartment="cell" initialConcentration="1" id="s1" name="nm1" sboTerm="SBO:0000244">
<annotation/>
</species>
</listOfSpecies>
</model>
</sbml>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
<model id="TestGEN">
<annotation/>
<listOfCompartments>
<compartment constant="true" id="cell" name="cell" sboTerm="SBO:0000290" size="1">
<annotation>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqmodel="http://biomodels.net/model-qualifiers/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
<rdf:Description rdf:about="#">
<bqbiol:isVersionOf>
<rdf:Bag>
<rdf:li rdf:resource="urn:miriam:obo.go:GO:0005623"/>
</rdf:Bag>
</bqbiol:isVersionOf>
</rdf:Description>
</rdf:RDF>
</annotation>
</compartment>
</listOfCompartments>
<listOfSpecies>
<species boundaryCondition="false" compartment="cell" initialConcentration="1" id="s1" name="nm1" sboTerm="SBO:0000278">
<annotation/>
</species>
</listOfSpecies>
</model>
</sbml>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
<model id="TestGEN">
<annotation/>
<listOfCompartments>
<compartment constant="true" id="cell" name="cell" sboTerm="SBO:0000290" size="1">
<annotation>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqmodel="http://biomodels.net/model-qualifiers/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
<rdf:Description rdf:about="#">
<bqbiol:isVersionOf>
<rdf:Bag>
<rdf:li rdf:resource="urn:miriam:obo.go:GO:0005623"/>
</rdf:Bag>
</bqbiol:isVersionOf>
</rdf:Description>
</rdf:RDF>
</annotation>
</compartment>
</listOfCompartments>
<listOfSpecies>
<species boundaryCondition="false" compartment="cell" initialConcentration="1" id="s1" name="nm1" sboTerm="SBO:0000247">
<annotation/>
</species>
</listOfSpecies>
</model>
</sbml>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
<model id="TestGEN">
<annotation/>
<listOfCompartments>
<compartment constant="true" id="cell" name="cell" sboTerm="SBO:0000290" size="1">
<annotation>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqmodel="http://biomodels.net/model-qualifiers/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
<rdf:Description rdf:about="#">
<bqbiol:isVersionOf>
<rdf:Bag>
<rdf:li rdf:resource="urn:miriam:obo.go:GO:0005623"/>
</rdf:Bag>
</bqbiol:isVersionOf>
</rdf:Description>
</rdf:RDF>
</annotation>
</compartment>
</listOfCompartments>
<listOfSpecies>
<species boundaryCondition="false" compartment="cell" initialConcentration="1" id="s1" name="nm1" sboTerm="SBO:0000299">
<annotation/>
</species>
</listOfSpecies>
</model>
</sbml>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
<model id="TestGEN">
<annotation/>
<listOfCompartments>
<compartment constant="true" id="cell" name="cell" sboTerm="SBO:0000290" size="1">
<annotation>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqmodel="http://biomodels.net/model-qualifiers/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
<rdf:Description rdf:about="#">
<bqbiol:isVersionOf>
<rdf:Bag>
<rdf:li rdf:resource="urn:miriam:obo.go:GO:0005623"/>
</rdf:Bag>
</bqbiol:isVersionOf>
</rdf:Description>
</rdf:RDF>
</annotation>
</compartment>
</listOfCompartments>
<listOfSpecies>
<species boundaryCondition="false" compartment="cell" initialConcentration="1" id="s1" name="nm1" sboTerm="SBO:0000462">
<annotation/>
</species>
</listOfSpecies>
</model>
</sbml>
\ No newline at end of file
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