Permalink
Browse files

added annotations to the species elements

  • Loading branch information...
applecool committed Aug 24, 2013
1 parent 8aa6bb8 commit 1aa31c3b004543bc4525e5ede80a299b14c0932c
Showing with 22 additions and 1 deletion.
  1. +22 −1 src/org/pathvisio/sbml/peer/PeerModel.java
@@ -20,7 +20,10 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.bridgedb.DataSource;
import org.bridgedb.Xref;
import org.pathvisio.core.model.ObjectType;
import org.pathvisio.core.model.Pathway;
@@ -31,6 +34,7 @@
import org.pathvisio.sbgn.SbgnTemplates;
import org.sbgn.ArcClazz;
import org.sbgn.GlyphClazz;
import org.sbml.jsbml.Annotation;
import org.sbml.jsbml.CVTerm;
import org.sbml.jsbml.Model;
import org.sbml.jsbml.ModifierSpeciesReference;
@@ -313,7 +317,7 @@ private void doReactions()
double x = xco;
double y = yco;
PeerReaction pr = PeerReaction.createFromSbml(this, re, x, y);
boolean next = true;
if (re.getListOfReactants().size() > 0)
{
@@ -377,12 +381,29 @@ private PathwayElement createOrGetSpecies (String sId, double prefX, double pref
if (pelt == null)
{
Species sp = doc.getModel().getSpecies(sId);
PeerSpecies sbr = PeerSpecies.createFromSpecies(this, sp, gc);
putSpeciesPeer (sId, sbr);
pelt = sbr.getSpeciesElement();
pelt.setMCenterX(prefX);
pelt.setMCenterY(prefY);
pelt.setTextLabel(sId);
Annotation annotation = doc.getModel().getSpecies(sId).getAnnotation();
for (int i = 0; i < annotation.getCVTermCount(); i++) {
List<String> li = annotation.getCVTerm(i).getResources();
for (String string : li) {
String[] de = string.split("org/",2 );
String[] xe = de[1].split("/",2);
DataSource ds = DataSource.getByFullName(xe[0]);
pelt.setDataSource(ds);
pelt.setGeneID(xe[1]);
}
}
pwy.add(pelt);
}
return pelt;

0 comments on commit 1aa31c3

Please sign in to comment.