...
 
Commits (4)
......@@ -276,13 +276,16 @@ public class BioNetwork extends BioEntity {
BioCollection<BioEnzymeParticipant> participants = new BioCollection<>(
e.getParticipants());
boolean contains = false;
for (BioEnzymeParticipant p : participants) {
if (p.getPhysicalEntity().equals(m)) {
contains = true;
e.getParticipants().remove(p);
}
}
if (e.getParticipantsView().size() == 0) {
if (e.getParticipantsView().size() == 0 && contains) {
this.removeOnCascade(e);
}
});
......
......@@ -483,23 +483,34 @@ public class JsbmlToBioNetwork {
hasInvalidSboTerms = true;
// It's considered as a gene
// We replace the first "_" by "" if exists
String oldId = specieId;
specieId = specieId.replaceFirst("^_", "");
specieId = specieId.replaceFirst("_.$", "");
specieName = specieName.replaceFirst("^_", "");
specieName = specieName.replaceFirst("_.$", "");
BioGene gene = new BioGene(specieId, specieName);
gene.setAttribute("oldId", oldId);
this.getNetwork().add(gene);
}
else if(sboTerm.compareToIgnoreCase("SBO:0000014")==0 || sboTerm.compareToIgnoreCase("SBO:0000297")==0)
{
validSboTerm = false;
hasInvalidSboTerms = true;
String oldId = specieId;
// It's considered as an enzyme
specieId = specieId.replaceFirst("^_", "");
specieId = specieId.replaceFirst("_.$", "");
specieName = specieName.replaceFirst("^_", "");
specieName = specieName.replaceFirst("_.$", "");
BioEnzyme enz = new BioEnzyme(specieId, specieName);
enz.setAttribute("oldId", oldId);
this.getNetwork().add(enz);
}
}
......
......@@ -153,7 +153,14 @@ public class AnnotationParser implements PackageParser, AdditionalDataTag, Reade
for (BioEntity entry : collection) {
UniqueNamedSBase sbase = this.getModel().findUniqueNamedSBase(entry.getId());
String id = entry.getId();
if(entry.getAttribute("oldId") != null)
{
id = (String) entry.getAttribute("oldId");
}
UniqueNamedSBase sbase = this.getModel().findUniqueNamedSBase(id);
if (sbase != null && !sbase.getAnnotation().isEmpty() && sbase.hasValidAnnotation()) {
......@@ -206,8 +213,9 @@ public class AnnotationParser implements PackageParser, AdditionalDataTag, Reade
while (m.find()) {
if (m.group(1).equalsIgnoreCase("http://biomodels.net/inchi")) {
if (!ent.hasRef("inchi", m.group(2))) {
ent.addRef("inchi", m.group(2), 1, "is", ORIGIN);
String inchi = m.group(2);
if (!ent.hasRef("inchi", inchi)) {
ent.addRef("inchi", inchi, 1, "is", ORIGIN);
}
}
}
......
......@@ -44,7 +44,7 @@ import javax.xml.stream.XMLStreamException;
import fr.inrae.toulouse.metexplore.met4j_core.biodata.*;
import fr.inrae.toulouse.metexplore.met4j_io.annotations.metabolite.MetaboliteAttributes;
import fr.inrae.toulouse.metexplore.met4j_io.annotations.reaction.ReactionAttributes;
import fr.inrae.toulouse.metexplore.met4j_io.jsbml.refs.IdentifiersOrg;
import fr.inrae.toulouse.metexplore.met4j_io.refs.IdentifiersOrg;
import org.sbml.jsbml.Annotation;
import org.sbml.jsbml.CVTerm;
import org.sbml.jsbml.CVTerm.Qualifier;
......
package fr.inrae.toulouse.metexplore.met4j_io.jsbml.refs;
package fr.inrae.toulouse.metexplore.met4j_io.refs;
import java.util.ArrayList;
import java.util.Arrays;
......