Commit a18fbfa6 authored by piotr.gawron's avatar piotr.gawron
Browse files

polishing distinction betwen model and celldesigner parser

parent cd8d1eb1
......@@ -241,9 +241,9 @@ public class ModelAnnotator {
protected void copyAnnotationFromOtherSpecies(Model model, IProgressUpdater progressUpdater) {
double counter = 0;
double amount = model.getAliases().size();
for (Species element : model.getSpeciesAliases()) {
for (Species element : model.getSpeciesList()) {
if (element.getMiriamData().size() == 0) {
List<Element> speciesList = model.getAliasByName(element.getName());
List<Element> speciesList = model.getElementsByName(element.getName());
for (Element species2 : speciesList) {
if (species2.getClass().equals(element.getClass()) && species2.getMiriamData().size() > 0 && element.getMiriamData().size() == 0) {
for (MiriamData md : species2.getMiriamData()) {
......
......@@ -85,8 +85,8 @@ public class ModelAnnotatorTest extends AnnotationTestFunctions {
modelAnnotator.annotateModel(model, updater, null);
assertTrue(model.getAliasByAliasId("a1").getMiriamData().size() > 0);
assertTrue(model.getAliasByAliasId("a2").getMiriamData().size() >= 1);
assertTrue(model.getElementByElementId("a1").getMiriamData().size() > 0);
assertTrue(model.getElementByElementId("a2").getMiriamData().size() >= 1);
} catch (Exception e) {
e.printStackTrace();
......@@ -135,7 +135,7 @@ public class ModelAnnotatorTest extends AnnotationTestFunctions {
modelAnnotator.copyAnnotationFromOtherSpecies(model, updater);
for (Species element : model.getSpeciesAliases()) {
for (Species element : model.getSpeciesList()) {
if (element.getName().equals("s4"))
assertEquals(0, element.getMiriamData().size());
else if (element.getName().equals("hello"))
......@@ -157,7 +157,7 @@ public class ModelAnnotatorTest extends AnnotationTestFunctions {
Set<String> knowAnnotations = new HashSet<String>();
modelAnnotator.annotateModel(model, updater, null);
for (MiriamData md : model.getAliasByAliasId("sa1").getMiriamData()) {
for (MiriamData md : model.getElementByElementId("sa1").getMiriamData()) {
knowAnnotations.add(md.getDataType() + ":" + md.getRelationType() + ":" + md.getResource());
}
counter = 0;
......@@ -171,7 +171,7 @@ public class ModelAnnotatorTest extends AnnotationTestFunctions {
modelAnnotator.annotateModel(model, updater, null);
knowAnnotations.clear();
for (MiriamData md : model.getAliasByAliasId("sa1").getMiriamData()) {
for (MiriamData md : model.getElementByElementId("sa1").getMiriamData()) {
knowAnnotations.add(md.getDataType() + ":" + md.getRelationType() + ":" + md.getResource());
}
counter = 0;
......@@ -192,8 +192,8 @@ public class ModelAnnotatorTest extends AnnotationTestFunctions {
public void testGetAnnotationsForSYN() throws Exception {
try {
Model model = getModelForFile("testFiles/annotation/emptyAnnotationsSyn1.xml", true);
Element sa1 = model.getAliasByAliasId("sa1");
Element sa2 = model.getAliasByAliasId("sa2");
Element sa1 = model.getElementByElementId("sa1");
Element sa2 = model.getElementByElementId("sa2");
assertFalse(sa1.getNotes().contains("Symbol"));
assertFalse(sa2.getNotes().contains("Symbol"));
......@@ -208,7 +208,7 @@ public class ModelAnnotatorTest extends AnnotationTestFunctions {
assertFalse(sa2.getNotes().contains("Symbol"));
assertNull(sa2.getSymbol());
for (Species el : model.getSpeciesAliases()) {
for (Species el : model.getSpeciesList()) {
if (el.getNotes() != null) {
assertFalse("Invalid notes: " + el.getNotes(), el.getNotes().contains("Symbol"));
assertFalse("Invalid notes: " + el.getNotes(), el.getNotes().contains("HGNC"));
......
......@@ -240,7 +240,7 @@ public class ConsoleConverter {
String productString = cols[productsColumn];
for (String string : productString.split(",")) {
if (!string.isEmpty()) {
Species alias = model.getAliasByAliasId(string.trim());
Species alias = model.getElementByElementId(string.trim());
Product product = new Product(alias);
products.add(product);
}
......@@ -253,7 +253,7 @@ public class ConsoleConverter {
String reactantString = cols[reactantsColumn];
for (String string : reactantString.split(",")) {
if (!string.isEmpty()) {
Species element = model.getAliasByAliasId(string.trim());
Species element = model.getElementByElementId(string.trim());
Reactant product = new Reactant(element);
reactants.add(product);
}
......@@ -266,7 +266,7 @@ public class ConsoleConverter {
String modifierString = cols[modifiersColumn];
for (String string : modifierString.split(",")) {
if (!string.isEmpty()) {
Species element = model.getAliasByAliasId(string.trim());
Species element = model.getElementByElementId(string.trim());
Modifier modifier = new Catalysis(element);
modifiers.add(modifier);
}
......
......@@ -112,7 +112,7 @@ public class ReactomeComparison {
Set<String> list = new HashSet<String>();
for (Species element : model.getSpeciesAliases()) {
for (Species element : model.getSpeciesList()) {
list.add(element.getName());
}
logger.debug("Species: " + list.size());
......
......@@ -131,7 +131,7 @@ public class ReactomeExport {
addElement(a);
}
} else if (alias instanceof Compartment) {
for (Element a : ((Compartment) alias).getAliases()) {
for (Element a : ((Compartment) alias).getElements()) {
addElement(a);
}
}
......@@ -214,7 +214,7 @@ public class ReactomeExport {
}
if (alias instanceof Compartment) {
parameters.put("displayName", alias.getName());
for (Element a : ((Compartment) alias).getAliases()) {
for (Element a : ((Compartment) alias).getElements()) {
components.add(addElement(a));
}
}
......
......@@ -257,7 +257,7 @@ public class Statistics {
print("Complex annotations:");
for (Element element : model.getAliases()) {
if (element instanceof Complex && element.getMiriamData().size() > 0) {
print(element.getClass().getSimpleName() + ";\t\tname=" + element.getName() + ";\t\tid=" + element.getAliasId());
print(element.getClass().getSimpleName() + ";\t\tname=" + element.getName() + ";\t\tid=" + element.getElementId());
}
}
print("-----------------------------");
......@@ -324,7 +324,7 @@ public class Statistics {
list = new ArrayList<String>();
links.put(md.getResource(), list);
}
String address = "<a href =\"" + Configuration.PUBLICALY_AVAILABLE_PD_MAP + "&search=species:" + element.getAliasId() + "\">" + element.getName()
String address = "<a href =\"" + Configuration.PUBLICALY_AVAILABLE_PD_MAP + "&search=species:" + element.getElementId() + "\">" + element.getName()
+ "</a>";
list.add(address);
}
......
......@@ -84,7 +84,7 @@ public class VibineSnippet {
String speciesId = "sa7208";
String reactionId = "re332";
Species species = model.getAliasByAliasId(speciesId);
Species species = model.getElementByElementId(speciesId);
logger.debug("Element with id: " + speciesId);
logger.debug("Element type: " + species.getClass());
......@@ -96,7 +96,7 @@ public class VibineSnippet {
logger.debug("Reaction with id: " + reactionId);
logger.debug("Reaction has " + reaction.getReactionNodes().size() + " members.");
for (ReactionNode node : reaction.getReactionNodes()) {
logger.debug(node.getClass().getSimpleName() + "; points to " + node.getAlias().getClass().getSimpleName() + "[" + node.getAlias().getAliasId() + "]");
logger.debug(node.getClass().getSimpleName() + "; points to " + node.getAlias().getClass().getSimpleName() + "[" + node.getAlias().getElementId() + "]");
}
logger.debug("-------------------------------");
}
......
......@@ -26,7 +26,7 @@ public class CellDesignerElementCollection {
public String getElementId(Element alias) {
// TODO
// silly implementation for now (if CD won't crash than we can keep it)
return "s_id_" + alias.getAliasId();
return "s_id_" + alias.getElementId();
}
public void addElements(List<? extends CellDesignerElement<?>> elements) {
......
......@@ -497,11 +497,11 @@ public class CellDesignerXmlParser extends XmlParser implements IConverter {
if (node.getNodeName().equalsIgnoreCase("celldesigner:complexSpeciesAlias")) {
String aliasId = getNodeAttr("id", node);
String complexId = getNodeAttr("complexSpeciesAlias", node);
Complex alias = (Complex) model.getAliasByAliasId(aliasId);
Complex alias = (Complex) model.getElementByElementId(aliasId);
if (alias == null) {
throw new InvalidXmlSchemaException("Alias does not exist " + aliasId);
}
Complex complex = (Complex) model.getAliasByAliasId(complexId);
Complex complex = (Complex) model.getElementByElementId(complexId);
if (complex != null) {
complex.addAlias(alias);
alias.setParent(complex);
......@@ -534,11 +534,11 @@ public class CellDesignerXmlParser extends XmlParser implements IConverter {
if (node.getNodeName().equalsIgnoreCase("celldesigner:speciesAlias")) {
String aliasId = getNodeAttr("id", node);
String complexId = getNodeAttr("complexSpeciesAlias", node);
Element alias = model.getAliasByAliasId(aliasId);
Element alias = model.getElementByElementId(aliasId);
if (alias == null) {
throw new InvalidXmlSchemaException("Alias does not exist " + aliasId);
} else if (alias instanceof Species) {
Complex complex = (Complex) model.getAliasByAliasId(complexId);
Complex complex = (Complex) model.getElementByElementId(complexId);
if (complex != null) {
alias.setParent(complex);
complex.addAlias((Species) alias);
......@@ -588,7 +588,7 @@ public class CellDesignerXmlParser extends XmlParser implements IConverter {
result.append(compartmentCollectionXmlParser.toXml(model.getCompartmentsAliases()));
result.append(speciesCollectionXmlParser.speciesCollectionToSbmlString(model.getSpeciesAliases()));
result.append(speciesCollectionXmlParser.speciesCollectionToSbmlString(model.getSpeciesList()));
result.append(reactionCollectionXmlParser.reactionCollectionToXmlString(model.getReactions()));
......@@ -613,11 +613,11 @@ public class CellDesignerXmlParser extends XmlParser implements IConverter {
result.append("<celldesigner:modelVersion>4.0</celldesigner:modelVersion>\n");
result.append("<celldesigner:modelDisplay sizeX=\"" + model.getWidth().intValue() + "\" sizeY=\"" + model.getHeight().intValue() + "\"/>\n");
result.append(speciesCollectionXmlParser.speciesCollectionToXmlIncludedString(model.getSpeciesAliases()));
result.append(speciesCollectionXmlParser.speciesCollectionToXmlIncludedString(model.getSpeciesList()));
result.append(aliasCollectionParser.compartmentAliasCollectionToXmlString(model.getCompartmentsAliases()));
result.append(aliasCollectionParser.complexAliasCollectionToXmlString(model.getComplexAliases()));
result.append(aliasCollectionParser.speciesAliasCollectionToXmlString(model.getNotComplexSpeciesAliases()));
result.append(aliasCollectionParser.complexAliasCollectionToXmlString(model.getComplexList()));
result.append(aliasCollectionParser.speciesAliasCollectionToXmlString(model.getNotComplexSpeciesList()));
List<Protein> proteins = new ArrayList<>();
List<Gene> genes = new ArrayList<>();
......
......@@ -172,7 +172,7 @@ public class LayerXmlParser extends XmlParser {
String[] list = members.split(",");
for (String string : list) {
Element alias = model.getAliasByAliasId(string);
Element alias = model.getElementByElementId(string);
if (alias == null) {
throw new InvalidGroupException("Group \"" + id + "\" contains alias with id: \"" + string + "\", but such alias doesn't exist in the model.");
}
......
......@@ -123,7 +123,7 @@ public class CompartmentAliasXmlParser extends AbstractAliasXmlParser<Compartmen
StringBuilder sb = new StringBuilder("");
sb.append("<celldesigner:compartmentAlias ");
sb.append("id=\"" + alias.getAliasId() + "\" ");
sb.append("id=\"" + alias.getElementId() + "\" ");
sb.append("compartment=\"" + elements.getElementId(alias) + "\">\n");
boolean bounds = true;
......
......@@ -135,7 +135,7 @@ public class ComplexAliasXmlParser extends AbstractAliasXmlParser<Complex> {
result.setLineWidth(view.getSingleLine().getWidth());
result.setColor(view.getColor());
} else if (!state.equalsIgnoreCase("complexnoborder")) {
throw new InvalidXmlSchemaException("No view (" + state + ") in ComplexAlias for " + result.getAliasId());
throw new InvalidXmlSchemaException("No view (" + state + ") in ComplexAlias for " + result.getElementId());
}
result.setState(state);
String compartmentAliasId = getNodeAttr("compartmentAlias", aliasNode);
......@@ -145,14 +145,14 @@ public class ComplexAliasXmlParser extends AbstractAliasXmlParser<Complex> {
throw new InvalidXmlSchemaException("CompartmentAlias does not exist: " + compartmentAliasId);
} else {
result.setParent(ca);
ca.addAlias(result);
ca.addElement(result);
}
}
String complexSpeciesAliasId = getNodeAttr("complexSpeciesAlias", aliasNode);
if (!complexSpeciesAliasId.equals("")) {
parents.put(result.getAliasId(), complexSpeciesAliasId);
parents.put(result.getElementId(), complexSpeciesAliasId);
}
complexAliasesMapById.put(result.getAliasId(), result);
complexAliasesMapById.put(result.getElementId(), result);
return result;
}
......@@ -176,7 +176,7 @@ public class ComplexAliasXmlParser extends AbstractAliasXmlParser<Complex> {
} else if (state == null || state.isEmpty()) {
return;
} else {
throw new NotImplementedException("[Alias: " + alias.getAliasId() + "] Unkown alias state: " + state);
throw new NotImplementedException("[Alias: " + alias.getElementId() + "] Unkown alias state: " + state);
}
}
......@@ -188,11 +188,11 @@ public class ComplexAliasXmlParser extends AbstractAliasXmlParser<Complex> {
* alias for which we want to add parent information
*/
public void addReference(Complex alias) {
String parentId = parents.get(alias.getAliasId());
String parentId = parents.get(alias.getElementId());
if (parentId != null) {
Complex ca = complexAliasesMapById.get(parentId);
if (ca == null) {
throw new InvalidArgumentException("Parent complex alias does not exist: " + parentId + " for alias: " + alias.getAliasId());
throw new InvalidArgumentException("Parent complex alias does not exist: " + parentId + " for alias: " + alias.getElementId());
} else {
alias.setParent(ca);
ca.addAlias(alias);
......@@ -231,17 +231,17 @@ public class ComplexAliasXmlParser extends AbstractAliasXmlParser<Complex> {
String compartmentAliasId = null;
if (ca != null) {
compartmentAliasId = ca.getAliasId();
compartmentAliasId = ca.getElementId();
}
StringBuilder sb = new StringBuilder("");
sb.append("<celldesigner:complexSpeciesAlias ");
sb.append("id=\"" + alias.getAliasId() + "\" ");
sb.append("id=\"" + alias.getElementId() + "\" ");
sb.append("species=\"" + elements.getElementId(alias) + "\" ");
if (compartmentAliasId != null) {
sb.append("compartmentAlias=\"" + compartmentAliasId + "\" ");
}
if (complexAlias != null) {
sb.append("complexSpeciesAlias=\"" + complexAlias.getAliasId() + "\"");
sb.append("complexSpeciesAlias=\"" + complexAlias.getElementId() + "\"");
}
sb.append(">\n");
......
......@@ -116,14 +116,14 @@ public class SpeciesAliasXmlParser extends AbstractAliasXmlParser<Species> {
throw new InvalidXmlSchemaException("CompartmentAlias does not exist: " + compartmentAliasId);
} else {
result.setParent(ca);
ca.addAlias(result);
ca.addElement(result);
}
}
String complexAliasId = getNodeAttr("complexSpeciesAlias", aliasNode);
if (!complexAliasId.isEmpty()) {
Complex alias = (Complex) model.getAliasByAliasId(complexAliasId);
Complex alias = (Complex) model.getElementByElementId(complexAliasId);
if (alias == null) {
throw new InvalidXmlSchemaException("ComplexAlias does not exist: " + complexAliasId + ", current: " + result.getAliasId());
throw new InvalidXmlSchemaException("ComplexAlias does not exist: " + complexAliasId + ", current: " + result.getElementId());
} else {
result.setParent(alias);
alias.addAlias(result);
......@@ -152,7 +152,7 @@ public class SpeciesAliasXmlParser extends AbstractAliasXmlParser<Species> {
} else if (state == null || state.isEmpty()) {
return;
} else {
throw new NotImplementedException("[Alias: " + alias.getAliasId() + "] Unkown alias state: " + state);
throw new NotImplementedException("[Alias: " + alias.getElementId() + "] Unkown alias state: " + state);
}
}
......@@ -185,18 +185,18 @@ public class SpeciesAliasXmlParser extends AbstractAliasXmlParser<Species> {
String compartmentAliasId = null;
if (ca != null) {
compartmentAliasId = ca.getAliasId();
compartmentAliasId = ca.getElementId();
}
StringBuilder sb = new StringBuilder("");
sb.append("<celldesigner:speciesAlias ");
sb.append("id=\"" + alias.getAliasId() + "\" ");
sb.append("id=\"" + alias.getElementId() + "\" ");
sb.append("species=\"" + elements.getElementId(alias) + "\" ");
if (compartmentAliasId != null) {
sb.append("compartmentAlias=\"" + compartmentAliasId + "\" ");
}
if (complexAlias != null) {
sb.append("complexSpeciesAlias=\"" + complexAlias.getAliasId() + "\" ");
sb.append("complexSpeciesAlias=\"" + complexAlias.getElementId() + "\" ");
}
sb.append(">\n");
......
......@@ -124,7 +124,7 @@ public class CompartmentXmlParser extends AbstractElementXmlParser<CellDesignerC
}
// default is the top level compartment
if (!compartment.getAliasId().equals("default")) {
if (!compartment.getElementId().equals("default")) {
sb.append("outside=\"" + parentName + "\" ");
}
sb.append(">\n");
......
......@@ -1133,7 +1133,7 @@ public class ReactionFromXml extends XmlParser {
*/
private Reactant getReactantLink(Node rootNode, Model model, Reaction reaction, CellDesignerElementCollection elements) throws ReactionParserException {
String aliasId = getNodeAttr("alias", rootNode);
Species al = (Species) model.getAliasByAliasId(aliasId);
Species al = (Species) model.getElementByElementId(aliasId);
if (al == null) {
throw new ReactionParserException("Alias doesn't exist (id: " + aliasId + ")", reaction);
}
......@@ -1232,7 +1232,7 @@ public class ReactionFromXml extends XmlParser {
*/
private Product getProductLink(Node rootNode, Model model, Reaction reaction, CellDesignerElementCollection elements) throws ReactionParserException {
String aliasId = getNodeAttr("alias", rootNode);
Species al = (Species) model.getAliasByAliasId(aliasId);
Species al = (Species) model.getElementByElementId(aliasId);
if (al == null) {
throw new ReactionParserException("Alias doesn't exist (id: " + aliasId + ")", reaction);
}
......@@ -1371,7 +1371,7 @@ public class ReactionFromXml extends XmlParser {
String[] list = aliasId.split(",");
for (String string : list) {
Species al = (Species) model.getAliasByAliasId(string);
Species al = (Species) model.getElementByElementId(string);
if (al != null) {
aliasList.add(al);
} else {
......@@ -1571,7 +1571,7 @@ public class ReactionFromXml extends XmlParser {
*/
private void parseBaseReactant(Reaction result, Node reactantNode, Model model, CellDesignerElementCollection elements) throws ReactionParserException {
String aliasId = getNodeAttr("alias", reactantNode);
Species alias = (Species) model.getAliasByAliasId(aliasId);
Species alias = (Species) model.getElementByElementId(aliasId);
if (alias == null) {
throw new ReactionParserException("Alias with id=" + aliasId + " doesn't exist.", result);
}
......@@ -1607,7 +1607,7 @@ public class ReactionFromXml extends XmlParser {
*/
private void parseBaseProduct(Model model, Reaction result, Node reactantNode, CellDesignerElementCollection elements) throws ReactionParserException {
String aliasId = getNodeAttr("alias", reactantNode);
Species alias = (Species) model.getAliasByAliasId(aliasId);
Species alias = (Species) model.getElementByElementId(aliasId);
if (alias == null) {
throw new ReactionParserException("Alias with id=" + aliasId + " doesn't exist.", result);
}
......
......@@ -187,7 +187,7 @@ public class ReactionToXml extends XmlParser {
sb.append("species=\"" + elements.getElementId(alias) + "\">\n");
sb.append("<annotation>\n");
sb.append("<celldesigner:extension>\n");
sb.append("<celldesigner:alias>" + alias.getAliasId() + "</celldesigner:alias>\n");
sb.append("<celldesigner:alias>" + alias.getElementId() + "</celldesigner:alias>\n");
sb.append("</celldesigner:extension>\n");
sb.append("</annotation>\n");
sb.append("</modifierSpeciesReference>\n");
......@@ -218,10 +218,10 @@ public class ReactionToXml extends XmlParser {
Modifier mod = (Modifier) modifier;
if (modifiers.equals("")) {
modifiers = elements.getElementId(mod.getAlias());
aliases = mod.getAlias().getAliasId();
aliases = mod.getAlias().getElementId();
} else {
modifiers += "," + elements.getElementId(mod.getAlias());
aliases += "," + mod.getAlias().getAliasId();
aliases += "," + mod.getAlias().getElementId();
}
}
......@@ -274,7 +274,7 @@ public class ReactionToXml extends XmlParser {
String type = modifierTypeUtils.getStringTypeByModifier(modifier);
sb.append(" type=\"" + type + "\" ");
sb.append(" modifiers=\"" + elements.getElementId(modifier.getAlias()) + "\" ");
sb.append(" aliases=\"" + modifier.getAlias().getAliasId() + "\" ");
sb.append(" aliases=\"" + modifier.getAlias().getElementId() + "\" ");
sb.append(" targetLineIndex=\"" + modifierTypeUtils.getTargetLineIndexByModifier(modifier) + "\" ");
PolylineData line = new PolylineData(modifier.getLine());
......@@ -328,7 +328,7 @@ public class ReactionToXml extends XmlParser {
*/
private String getLinkTargetXmlString(Modifier modifier) {
StringBuilder sb = new StringBuilder();
sb.append("<celldesigner:linkTarget species=\"" + elements.getElementId(modifier.getAlias()) + "\" alias=\"" + modifier.getAlias().getAliasId() + "\">\n");
sb.append("<celldesigner:linkTarget species=\"" + elements.getElementId(modifier.getAlias()) + "\" alias=\"" + modifier.getAlias().getElementId() + "\">\n");
sb.append(getAnchorXml(modifier.getAlias(), modifier.getLine().getBeginPoint()));
sb.append("</celldesigner:linkTarget>\n");
......@@ -354,7 +354,7 @@ public class ReactionToXml extends XmlParser {
sb.append("<annotation>\n");
sb.append("<celldesigner:extension>\n");
sb.append("<celldesigner:alias>" + product.getAlias().getAliasId() + "</celldesigner:alias>\n");
sb.append("<celldesigner:alias>" + product.getAlias().getElementId() + "</celldesigner:alias>\n");
sb.append("</celldesigner:extension>\n");
sb.append("</annotation>\n");
sb.append("</speciesReference>\n");
......@@ -395,7 +395,7 @@ public class ReactionToXml extends XmlParser {
sb.append("<speciesReference species=\"" + elements.getElementId(species) + "\">\n");
sb.append("<annotation>\n");
sb.append("<celldesigner:extension>\n");
sb.append("<celldesigner:alias>" + alias.getAliasId() + "</celldesigner:alias>\n");
sb.append("<celldesigner:alias>" + alias.getElementId() + "</celldesigner:alias>\n");
sb.append("</celldesigner:extension>\n");
sb.append("</annotation>\n");
sb.append("</speciesReference>\n");
......@@ -471,7 +471,7 @@ public class ReactionToXml extends XmlParser {
// product line
result.append("<celldesigner:GateMember type=\"" + type.getStringName() + "\"");
result.append(" aliases=\"" + alias1.getAliasId() + "," + alias2.getAliasId() + "\"");
result.append(" aliases=\"" + alias1.getElementId() + "," + alias2.getElementId() + "\"");
result.append(" modificationType=\"" + lineData.getCellDesignerString() + "\"");
CellDesignerLineTransformation clt = new CellDesignerLineTransformation();
......@@ -497,7 +497,7 @@ public class ReactionToXml extends XmlParser {
// reactant 1 line
result.append("<celldesigner:GateMember type=\"" + lineData.getCellDesignerString() + "\"");
result.append(" aliases=\"" + alias1.getAliasId() + "\"");
result.append(" aliases=\"" + alias1.getElementId() + "\"");
points = clt.getPointsFromLine(reactant1.getLine());
......@@ -520,7 +520,7 @@ public class ReactionToXml extends XmlParser {
// reactant 2 line
result.append("<celldesigner:GateMember type=\"" + lineData.getCellDesignerString() + "\"");
result.append(" aliases=\"" + alias2.getAliasId() + "\"");
result.append(" aliases=\"" + alias2.getElementId() + "\"");
points = clt.getPointsFromLine(reactant2.getLine());
......@@ -600,7 +600,7 @@ public class ReactionToXml extends XmlParser {
StringBuilder sb = new StringBuilder();
sb.append("<celldesigner:reactantLink ");
sb.append("reactant=\"" + elements.getElementId(alias) + "\" ");
sb.append("alias=\"" + alias.getAliasId() + "\" ");
sb.append("alias=\"" + alias.getElementId() + "\" ");
// targetLineIndex is missing (maybe it's unimportant :))
sb.append(">\n");
......@@ -639,7 +639,7 @@ public class ReactionToXml extends XmlParser {
StringBuilder sb = new StringBuilder();
sb.append("<celldesigner:productLink ");
sb.append("product=\"" + elements.getElementId(alias) + "\" ");
sb.append("alias=\"" + alias.getAliasId() + "\" ");
sb.append("alias=\"" + alias.getElementId() + "\" ");
// targetLineIndex is missing (maybe it's unimportant :))
sb.append(">\n");
......@@ -975,7 +975,7 @@ public class ReactionToXml extends XmlParser {
Element alias = product.getAlias();
sb.append("<celldesigner:baseProduct ");
sb.append("species=\"" + elements.getElementId(product.getAlias()) + "\" ");
sb.append("alias=\"" + product.getAlias().getAliasId() + "\" ");
sb.append("alias=\"" + product.getAlias().getElementId() + "\" ");
sb.append(">\n");
sb.append(getAnchorXml(alias, product.getLine().getEndPoint()));
......@@ -1005,7 +1005,7 @@ public class ReactionToXml extends XmlParser {
Element alias = reactant.getAlias();
sb.append("<celldesigner:baseReactant ");
sb.append("species=\"" + elements.getElementId(reactant.getAlias()) + "\" ");
sb.append("alias=\"" + reactant.getAlias().getAliasId() + "\" ");
sb.append("alias=\"" + reactant.getAlias().getElementId() + "\" ");
sb.append(">\n");
sb.append(getAnchorXml(alias, reactant.getLine().getBeginPoint()));
......
......@@ -9,10 +9,10 @@ import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
import lcsb.mapviewer.converter.model.celldesigner.CellDesignerElementCollection;
import lcsb.mapviewer.converter.model.celldesigner.annotation.RestAnnotationParser;
import lcsb.mapviewer.converter.model.celldesigner.structure.CellDesignerAntisenseRna;