diff --git a/converter-sbml/src/main/java/lcsb/mapviewer/converter/model/sbml/species/SbmlSpeciesExporter.java b/converter-sbml/src/main/java/lcsb/mapviewer/converter/model/sbml/species/SbmlSpeciesExporter.java index 6215374c9d25eda9f77427651d89d826e9254b74..b4e503a8b33abb0476ea9ff5b0c19e681c148201 100644 --- a/converter-sbml/src/main/java/lcsb/mapviewer/converter/model/sbml/species/SbmlSpeciesExporter.java +++ b/converter-sbml/src/main/java/lcsb/mapviewer/converter/model/sbml/species/SbmlSpeciesExporter.java @@ -312,7 +312,8 @@ public class SbmlSpeciesExporter extends SbmlElementExporter<Species, org.sbml.j private void assignChargeToMulti(Species element, MultiSpeciesPlugin multiExtension, MultiSpeciesType speciesType) { if (element.getCharge() != null) { - assignValueToFeature(element, multiExtension, speciesType, element.getCharge().toString(), BioEntityFeature.CHARGE); + assignValueToFeature(element, multiExtension, speciesType, element.getCharge().toString(), + BioEntityFeature.CHARGE); } } @@ -399,6 +400,7 @@ public class SbmlSpeciesExporter extends SbmlElementExporter<Species, org.sbml.j Collections.sort(modifications); multiDistinguisher += "\n" + StringUtils.join(modifications, ","); } + multiDistinguisher += "\n" + element.getPositionToCompartment(); } String result = element.getClass().getSimpleName() + "\n" + element.getName() + "\n" + compartmentName + "\n" + complexName @@ -472,7 +474,7 @@ public class SbmlSpeciesExporter extends SbmlElementExporter<Species, org.sbml.j private void createModificationGlyph(ModificationResidue mr, AbstractReferenceGlyph speciesGlyph) { org.sbml.jsbml.Species sbmlSpecies = getSbmlModel().getSpecies(speciesGlyph.getReference()); - + MultiSpeciesPlugin speciesExtension = (MultiSpeciesPlugin) sbmlSpecies.getExtension("multi"); SpeciesFeature feature = null; String featureTypeId = MultiPackageNamingUtils.getModificationFeatureId(mr); diff --git a/converter-sbml/testFiles/cd_for_multi/position_to_compartment_in_aliases.xml b/converter-sbml/testFiles/cd_for_multi/position_to_compartment_in_aliases.xml new file mode 100644 index 0000000000000000000000000000000000000000..0b2a4d4298eb1358c5ce3c1ff91cf2d50167adf9 --- /dev/null +++ b/converter-sbml/testFiles/cd_for_multi/position_to_compartment_in_aliases.xml @@ -0,0 +1,132 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml xmlns="http://www.sbml.org/sbml/level2/version4" xmlns:celldesigner="http://www.sbml.org/2001/ns/celldesigner" level="2" version="4"> +<model metaid="untitled" id="untitled"> +<annotation> +<celldesigner:extension> +<celldesigner:modelVersion>4.0</celldesigner:modelVersion> +<celldesigner:modelDisplay sizeX="600" sizeY="400"/> +<celldesigner:listOfCompartmentAliases> +<celldesigner:compartmentAlias id="ca1" compartment="c1"> +<celldesigner:class>SQUARE</celldesigner:class> +<celldesigner:bounds x="132.0" y="88.0" w="263.0" h="142.0"/> +<celldesigner:namePoint x="142.0" y="98.0"/> +<celldesigner:doubleLine thickness="12.0" outerWidth="2.0" innerWidth="1.0"/> +<celldesigner:paint color="ffcccc00" scheme="Color"/> +<celldesigner:info state="empty" angle="-1.5707963267948966"/> +</celldesigner:compartmentAlias> +</celldesigner:listOfCompartmentAliases> +<celldesigner:listOfComplexSpeciesAliases/> +<celldesigner:listOfSpeciesAliases> +<celldesigner:speciesAlias id="sa1" species="s3" compartmentAlias="ca1"> +<celldesigner:activity>inactive</celldesigner:activity> +<celldesigner:bounds x="85.0" y="133.0" w="80.0" h="40.0"/> +<celldesigner:font size="12"/> +<celldesigner:view state="usual"/> +<celldesigner:usualView> +<celldesigner:innerPosition x="-47.0" y="45.0"/> +<celldesigner:boxSize width="80.0" height="40.0"/> +<celldesigner:singleLine width="1.0"/> +<celldesigner:paint color="ffccffcc" scheme="Color"/> +</celldesigner:usualView> +<celldesigner:briefView> +<celldesigner:innerPosition x="0.0" y="0.0"/> +<celldesigner:boxSize width="80.0" height="60.0"/> +<celldesigner:singleLine width="0.0"/> +<celldesigner:paint color="3fff0000" scheme="Color"/> +</celldesigner:briefView> +<celldesigner:info state="empty" angle="-1.5707963267948966"/> +</celldesigner:speciesAlias> +<celldesigner:speciesAlias id="sa3" species="s1" compartmentAlias="ca1"> +<celldesigner:activity>inactive</celldesigner:activity> +<celldesigner:bounds x="232.0" y="130.0" w="80.0" h="40.0"/> +<celldesigner:font size="12"/> +<celldesigner:view state="usual"/> +<celldesigner:usualView> +<celldesigner:innerPosition x="100.0" y="42.0"/> +<celldesigner:boxSize width="80.0" height="40.0"/> +<celldesigner:singleLine width="1.0"/> +<celldesigner:paint color="ffccffcc" scheme="Color"/> +</celldesigner:usualView> +<celldesigner:briefView> +<celldesigner:innerPosition x="0.0" y="0.0"/> +<celldesigner:boxSize width="80.0" height="60.0"/> +<celldesigner:singleLine width="0.0"/> +<celldesigner:paint color="3fff0000" scheme="Color"/> +</celldesigner:briefView> +<celldesigner:info state="empty" angle="-1.5707963267948966"/> +</celldesigner:speciesAlias> +</celldesigner:listOfSpeciesAliases> +<celldesigner:listOfGroups/> +<celldesigner:listOfProteins> +<celldesigner:protein id="pr1" name="s1" type="GENERIC"/> +</celldesigner:listOfProteins> +<celldesigner:listOfGenes/> +<celldesigner:listOfRNAs/> +<celldesigner:listOfAntisenseRNAs/> +<celldesigner:listOfLayers/> +<celldesigner:listOfBlockDiagrams/> +</celldesigner:extension> +</annotation> +<listOfUnitDefinitions> +<unitDefinition metaid="substance" id="substance" name="substance"> +<listOfUnits> +<unit metaid="CDMT00001" kind="mole"/> +</listOfUnits> +</unitDefinition> +<unitDefinition metaid="volume" id="volume" name="volume"> +<listOfUnits> +<unit metaid="CDMT00002" kind="litre"/> +</listOfUnits> +</unitDefinition> +<unitDefinition metaid="area" id="area" name="area"> +<listOfUnits> +<unit metaid="CDMT00003" kind="metre" exponent="2"/> +</listOfUnits> +</unitDefinition> +<unitDefinition metaid="length" id="length" name="length"> +<listOfUnits> +<unit metaid="CDMT00004" kind="metre"/> +</listOfUnits> +</unitDefinition> +<unitDefinition metaid="time" id="time" name="time"> +<listOfUnits> +<unit metaid="CDMT00005" kind="second"/> +</listOfUnits> +</unitDefinition> +</listOfUnitDefinitions> +<listOfCompartments> +<compartment metaid="default" id="default" size="1" units="volume"/> +<compartment metaid="c1" id="c1" name="c1" size="1" units="volume" outside="default"> +<annotation> +<celldesigner:extension> +<celldesigner:name>c1</celldesigner:name> +</celldesigner:extension> +</annotation> +</compartment> +</listOfCompartments> +<listOfSpecies> +<species metaid="s1" id="s1" name="s1" compartment="c1" initialAmount="0"> +<annotation> +<celldesigner:extension> +<celldesigner:positionToCompartment>inside</celldesigner:positionToCompartment> +<celldesigner:speciesIdentity> +<celldesigner:class>PROTEIN</celldesigner:class> +<celldesigner:proteinReference>pr1</celldesigner:proteinReference> +</celldesigner:speciesIdentity> +</celldesigner:extension> +</annotation> +</species> +<species metaid="s3" id="s3" name="s1" compartment="c1" initialAmount="0"> +<annotation> +<celldesigner:extension> +<celldesigner:positionToCompartment>transmembrane</celldesigner:positionToCompartment> +<celldesigner:speciesIdentity> +<celldesigner:class>PROTEIN</celldesigner:class> +<celldesigner:proteinReference>pr1</celldesigner:proteinReference> +</celldesigner:speciesIdentity> +</celldesigner:extension> +</annotation> +</species> +</listOfSpecies> +</model> +</sbml>