Package org.pathvisio.libgpml.model
Class GPML2013aReader
java.lang.Object
org.pathvisio.libgpml.model.GPMLFormatAbstract
org.pathvisio.libgpml.model.GPML2013aFormatAbstract
org.pathvisio.libgpml.model.GPML2013aReader
- All Implemented Interfaces:
GPMLFormatReader
,GPMLFormatVersion
public class GPML2013aReader extends GPML2013aFormatAbstract implements GPMLFormatReader
This class reads a PathwayModel from an input source (GPML 2013a).
NB:
- In GPML2013a, there are two kinds of gpml:Biopax
Element
bp:openControlledVocabulary and bp:PublicationXref which correspond toAnnotation
andCitation
respectively. - gpml:CommentGroup:Biopax holds references to bp:PublicationXref rdf:id.
- All openControlledVocabulary belong to the pathway in GPML2013a.
- Author:
- finterly
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
GPML2013aReader.PublicationXref
Local class to help with reading gpml:Biopax:bp:PublicationXref.Nested classes/interfaces inherited from class org.pathvisio.libgpml.model.GPML2013aFormatAbstract
GPML2013aFormatAbstract.AttributeInfo
-
Field Summary
Fields Modifier and Type Field Description static GPML2013aReader
GPML2013aREADER
Fields inherited from class org.pathvisio.libgpml.model.GPML2013aFormatAbstract
BINDING_LIST, BIOPAX_NAMESPACE, CATALYSIS_LIST, CELL_CMPNT_KEY, CELL_CMPNT_MAP, CONVERSION_LIST, DEPRECATED_MAP, DIRECTED_LIST, DIRECTION, DOUBLE_LINE_KEY, GPML2013A_KEY_SET, IA_PANEL_MAP, INFOBOX_CENTER_X, INFOBOX_CENTER_Y, INHIBITION_LIST, LEGEND_CENTER_X, LEGEND_CENTER_Y, OCV_ONTOLOGY_MAP, OWL_NAMESPACE, PARENT, PARENTID, PARENTID_DB, PARENTSYMBOL, PARENTSYMBOL_DB, PATHWAY_AUTHOR, PATHWAY_EMAIL, PATHWAY_LASTMODIFIED, PATHWAY_MAINTAINER, POSITION, PTM, RDF_NAMESPACE, RDF_STRING, RDFS_NAMESPACE, SHAPETYPE_TO_CAMELCASE, SITE, SITEGRPID, SITEGRPID_DB, STATE_DIRECTION_MAP, STATE_PTM_MAP, STATE_REF_LIST, STATE_ROTATION, STIMULATION_LIST, TRANSCRIPTION_TRANSLATION_LIST, TRANSLOCATION_LIST, UNDIRECTED_LIST, WP_DESCRIPTION
-
Constructor Summary
Constructors Modifier Constructor Description protected
GPML2013aReader(java.lang.String xsdFile, org.jdom2.Namespace nsGPML)
-
Method Summary
Modifier and Type Method Description protected void
convertStateCommentToRefs(DataNode.State state, java.util.Set<java.lang.String> elementIdSet)
This method is used to handleDataNode.State
PathwayElement.Comment
which were manually added to encode phosphosite information.protected void
readAllElementIds(org.jdom2.Element root, java.util.Set<java.lang.String> elementIdSet)
Reads elementIds (GraphIds in GPML2013a) of root element and adds to elementIdSet.protected void
readAnchors(LineElement lineElement, org.jdom2.Element gfx, java.util.Set<java.lang.String> elementIdSet)
Reads anchorLineElement.Anchor
information for line element from element.protected ArrowHeadType
readArrowHeadType(org.jdom2.Element pt, java.lang.String base)
Returns the arrowHead for give jdom point element.protected void
readCommentGroup(PathwayElement pathwayElement, org.jdom2.Element e, java.util.Map<java.lang.String,GPML2013aReader.PublicationXref> idToPublicationXref)
Reads comment group (comment, biopaxref/citationRef, dynamic property) for pathway element from jdom element.protected void
readComments(PathwayElement pathwayElement, org.jdom2.Element e)
Reads commentPathwayElement.Comment
information for pathway element from jdom element.protected void
readDataNodes(PathwayModel pathwayModel, org.jdom2.Element root, java.util.Set<java.lang.String> elementIdSet, java.util.Map<java.lang.String,GPML2013aReader.PublicationXref> idToPublicationXref, java.util.Map<java.lang.String,Group> groupIdToGroup)
Reads data nodeDataNode
information for pathway model from root element.protected void
readDynamicProperties(PathwayElement pathwayElement, org.jdom2.Element root)
Reads gpml:Attribute or dynamic property information forPathwayElement
from jdom element.protected java.lang.String
readElementId(java.lang.String tag, org.jdom2.Element e, java.util.Set<java.lang.String> elementIdSet)
Returns elementId read for given Element.protected void
readFontProperty(ShapedElement shapedElement, org.jdom2.Element gfx)
Reads font property information.void
readFromRoot(PathwayModel pathwayModel, org.jdom2.Element root)
Reads information from root element of Jdom documentDocument
to the pathway modelPathwayModel
.protected void
readGraphicalLines(PathwayModel pathwayModel, org.jdom2.Element root, java.util.Set<java.lang.String> elementIdSet, java.util.Map<java.lang.String,GPML2013aReader.PublicationXref> idToPublicationXref, java.util.Map<java.lang.String,Group> groupIdToGroup, java.util.Map<org.jdom2.Element,LineElement.LinePoint> elementToPoint)
Reads graphical lineGraphicalLine
information for pathway model from root element.protected void
readGroupGroupRef(PathwayModel pathwayModel, org.jdom2.Element root, java.util.Map<java.lang.String,Group> groupIdToGroup)
Reads groupRef propertyShapedElement.setGroupRef(org.pathvisio.libgpml.model.Group)
information of group pathway element.protected void
readGroupRef(ShapedElement shapedElement, org.jdom2.Element se, java.util.Map<java.lang.String,Group> groupIdToGroup)
Reads and sets groupRef for given (shaped) pathway element and jdom Element.protected void
readGroups(PathwayModel pathwayModel, org.jdom2.Element root, java.util.Set<java.lang.String> elementIdSet, java.util.Map<java.lang.String,GPML2013aReader.PublicationXref> idToPublicationXref, java.util.Map<java.lang.String,Group> groupIdToGroup, java.util.Map<java.lang.String,Group> graphIdToGroup)
Reads groupGroup
information for pathway model from root element.protected void
readInfoBox(Pathway pathway, org.jdom2.Element root)
Reads the infobox x and y coordinate information.protected void
readInteractions(PathwayModel pathwayModel, org.jdom2.Element root, java.util.Set<java.lang.String> elementIdSet, java.util.Map<java.lang.String,GPML2013aReader.PublicationXref> idToPublicationXref, java.util.Map<java.lang.String,Group> groupIdToGroup, java.util.Map<org.jdom2.Element,LineElement.LinePoint> elementToPoint)
Reads interactionInteraction
information for pathway model from root element.protected void
readLabels(PathwayModel pathwayModel, org.jdom2.Element root, java.util.Set<java.lang.String> elementIdSet, java.util.Map<java.lang.String,GPML2013aReader.PublicationXref> idToPublicationXref, java.util.Map<java.lang.String,Group> groupIdToGroup)
Reads labelLabel
information for pathway model from root element.protected void
readLegend(Pathway pathway, org.jdom2.Element root)
Reads the Legend CenterX and CenterY to pathway dynamic propertiesPathwayElement.setDynamicProperty(java.lang.String, java.lang.String)
.protected void
readLineElement(LineElement lineElement, org.jdom2.Element ln, java.util.Set<java.lang.String> elementIdSet, java.util.Map<java.lang.String,GPML2013aReader.PublicationXref> idToPublicationXref, java.util.Map<java.lang.String,Group> groupIdToGroup)
Reads line elementLineElement
information for interaction or graphical line from jdom element.protected void
readLineStyleProperty(LineElement lineElement, org.jdom2.Element gfx)
Reads line style property information.protected void
readOpenControlledVocabulary(PathwayModel pathwayModel, org.jdom2.Element root, java.util.Set<java.lang.String> elementIdSet)
Reads gpml:Biopax bp:OpenControlledVocabulary information toAnnotation
for pathway model from root element.protected Pathway
readPathway(Pathway pathway, org.jdom2.Element root)
Reads pathway information from root element.protected void
readPointElementRefs(PathwayModel pathwayModel, java.util.Map<java.lang.String,Group> graphIdToGroup, java.util.Map<org.jdom2.Element,LineElement.LinePoint> elementToPoint)
ReadsLineElement.LinePoint
elementRefs.protected void
readPoints(LineElement lineElement, org.jdom2.Element ln, java.util.Set<java.lang.String> elementIdSet, java.util.Map<org.jdom2.Element,LineElement.LinePoint> elementToPoint)
Reads pointsLineElement.LinePoint
for pathway model line pathway elements.protected java.lang.String
readPublicationXrefInfo(java.util.List<org.jdom2.Element> pubxfElements)
Reads Biopax PublicationXref information from PublicationXref children elements.protected void
readPublicationXrefMap(org.jdom2.Element root, java.util.Set<java.lang.String> elementIdSet, java.util.Map<java.lang.String,GPML2013aReader.PublicationXref> idToPublicationXref)
Reads gpml:Biopax:bp:PublicationXref and maps "id" toGPML2013aReader.PublicationXref
in idToPublicationXref.protected void
readPublicationXrefs(PathwayElement pathwayElement, org.jdom2.Element e, java.util.Map<java.lang.String,GPML2013aReader.PublicationXref> idToPublicationXref)
Reads gpml:Biopax:bp:PublicationXref and BiopaxRef information for pathway element from jdom element.protected void
readRectProperty(ShapedElement shapedElement, org.jdom2.Element gfx)
Reads rect property information.protected void
readShapedElement(ShapedElement shapedElement, org.jdom2.Element se, java.util.Map<java.lang.String,GPML2013aReader.PublicationXref> idToPublicationXref)
Reads shaped pathway elementShapedElement
information: graphics and comment group (comments, biopaxRefs (equivalent to citationRefs), and dynamic properties).protected void
readShapes(PathwayModel pathwayModel, org.jdom2.Element root, java.util.Set<java.lang.String> elementIdSet, java.util.Map<java.lang.String,GPML2013aReader.PublicationXref> idToPublicationXref, java.util.Map<java.lang.String,Group> groupIdToGroup)
Reads shapeShape
information for pathway model from root element.protected void
readShapeStyleProperty(ShapedElement shapedElement, org.jdom2.Element gfx)
Reads shape style property information.protected void
readStates(PathwayModel pathwayModel, org.jdom2.Element root, java.util.Set<java.lang.String> elementIdSet, java.util.Map<java.lang.String,GPML2013aReader.PublicationXref> idToPublicationXref)
Reads stateDataNode.State
information for pathway model from root element.protected org.bridgedb.Xref
readXref(org.jdom2.Element e)
Reads xrefXref
information from element.protected void
setGroupGraphicsProperty(Group group, GroupType type)
Reads and sets graphics properties forGroup
.Methods inherited from class org.pathvisio.libgpml.model.GPML2013aFormatAbstract
fromCamelCase, getArrowHeadTypeStr, getAttr, getAttributeInfo, getInteractionPanelType, setAttr, toCamelCase
Methods inherited from class org.pathvisio.libgpml.model.GPMLFormatAbstract
getGpmlNamespace, getSchemaFile, refreshLineElements, updateGroups, validateDocument
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.pathvisio.libgpml.model.GPMLFormatVersion
getGpmlNamespace, getSchemaFile, validateDocument
-
Field Details
-
GPML2013aREADER
-
-
Constructor Details
-
GPML2013aReader
protected GPML2013aReader(java.lang.String xsdFile, org.jdom2.Namespace nsGPML)
-
-
Method Details
-
readFromRoot
public void readFromRoot(PathwayModel pathwayModel, org.jdom2.Element root) throws ConverterExceptionReads information from root element of Jdom documentDocument
to the pathway modelPathwayModel
. Referenced objects or pathway elements are read first. For example, Groups are read before other pathway element. DataNodes are read before States. And Points are read last.NB: In GPML2013a, GraphIds (elementIds) are missing for some pathway elements, or may conflict with Biopax rdf:id or GroupId
- elementIdSet: stores all ids for a reading session to ensure unique
elementIds,
readAllElementIds(org.jdom2.Element, java.util.Set<java.lang.String>)
- idToPublicationXref: stores Biopax:PublicationXref id and element
information,
readPublicationXrefMap(org.jdom2.Element, java.util.Set<java.lang.String>, java.util.Map<java.lang.String, org.pathvisio.libgpml.model.GPML2013aReader.PublicationXref>)
- groupIdToNew: stores GroupId and newly assigned elementIds,
readGroups(org.pathvisio.libgpml.model.PathwayModel, org.jdom2.Element, java.util.Set<java.lang.String>, java.util.Map<java.lang.String, org.pathvisio.libgpml.model.GPML2013aReader.PublicationXref>, java.util.Map<java.lang.String, org.pathvisio.libgpml.model.Group>, java.util.Map<java.lang.String, org.pathvisio.libgpml.model.Group>)
- lineList: stores line elementIds in the order read,
readGraphicalLines(org.pathvisio.libgpml.model.PathwayModel, org.jdom2.Element, java.util.Set<java.lang.String>, java.util.Map<java.lang.String, org.pathvisio.libgpml.model.GPML2013aReader.PublicationXref>, java.util.Map<java.lang.String, org.pathvisio.libgpml.model.Group>, java.util.Map<org.jdom2.Element, org.pathvisio.libgpml.model.LineElement.LinePoint>)
,readInteractions(org.pathvisio.libgpml.model.PathwayModel, org.jdom2.Element, java.util.Set<java.lang.String>, java.util.Map<java.lang.String, org.pathvisio.libgpml.model.GPML2013aReader.PublicationXref>, java.util.Map<java.lang.String, org.pathvisio.libgpml.model.Group>, java.util.Map<org.jdom2.Element, org.pathvisio.libgpml.model.LineElement.LinePoint>)
,readPoints(org.pathvisio.libgpml.model.LineElement, org.jdom2.Element, java.util.Set<java.lang.String>, java.util.Map<org.jdom2.Element, org.pathvisio.libgpml.model.LineElement.LinePoint>)
.
- Specified by:
readFromRoot
in interfaceGPMLFormatReader
- Parameters:
pathwayModel
- the given pathway model.root
- the root element of given Jdom document.- Throws:
ConverterException
- elementIdSet: stores all ids for a reading session to ensure unique
elementIds,
-
readAllElementIds
protected void readAllElementIds(org.jdom2.Element root, java.util.Set<java.lang.String> elementIdSet)Reads elementIds (GraphIds in GPML2013a) of root element and adds to elementIdSet. In GPML2013a, elementId (previously named GraphId) is sometimes missing. In order to assign unique new elementIds, we must first read all elementIds from the Jdom document to store in elementIdSet.- Parameters:
root
- the root element.elementIdSet
- the set of all elementIds.
-
readPathway
Reads pathway information from root element. Instantiates and returns the pathway objectPathway
.- Parameters:
root
- the root element.- Returns:
- pathway the pathway object.
- Throws:
ConverterException
-
readInfoBox
Reads the infobox x and y coordinate information. NB: Infobox is removed in GPML2021, as the info box is always located in the top left corner (0,0).- Parameters:
pathway
- the pathway.root
- the root element.
-
readLegend
Reads the Legend CenterX and CenterY to pathway dynamic propertiesPathwayElement.setDynamicProperty(java.lang.String, java.lang.String)
.- Parameters:
pathway
- the pathway.root
- the root element.
-
readOpenControlledVocabulary
protected void readOpenControlledVocabulary(PathwayModel pathwayModel, org.jdom2.Element root, java.util.Set<java.lang.String> elementIdSet) throws ConverterExceptionReads gpml:Biopax bp:OpenControlledVocabulary information toAnnotation
for pathway model from root element. NB:- In GPML2013a, all annotations are by default added to
Pathway
usingPathwayElement.AnnotationRef
. - New unique elementIds are assigned (missing in GPML2013a).
- Parameters:
pathwayModel
- the pathway model.root
- the jdom root element.elementIdSet
- the set of all elementIds.- Throws:
ConverterException
- In GPML2013a, all annotations are by default added to
-
readPublicationXrefMap
protected void readPublicationXrefMap(org.jdom2.Element root, java.util.Set<java.lang.String> elementIdSet, java.util.Map<java.lang.String,GPML2013aReader.PublicationXref> idToPublicationXref) throws ConverterExceptionReads gpml:Biopax:bp:PublicationXref and maps "id" toGPML2013aReader.PublicationXref
in idToPublicationXref. PublicationXref stores jdomElement
information. NB: If biopax "id" is not unique, a new unique elementId (value) is assigned, added to elementIdSet.- Parameters:
root
- the jdom root element.elementIdSet
- the set of all elementIds.idToPublicationXref
- the map of id to biopax jdom element.- Throws:
ConverterException
-
readPublicationXrefs
protected void readPublicationXrefs(PathwayElement pathwayElement, org.jdom2.Element e, java.util.Map<java.lang.String,GPML2013aReader.PublicationXref> idToPublicationXref) throws ConverterExceptionReads gpml:Biopax:bp:PublicationXref and BiopaxRef information for pathway element from jdom element. Creates and addsPathwayElement.CitationRef
andCitation
.NB:
- gpml:CommentGroup:BiopaxRef
PathwayElement.CitationRef
holds reference to gpml:Biopax:PublicationXrefCitation
. - BiopaxRef was an attribute (not the element) of many of the pathway elements in the GPML2013a schema, but was never used/implemented.
- Biopax PublicationXref which do not have a BiopaxRef will not be read.
- Parameters:
pathwayElement
- the element info pathway element object.e
- the jdom element.idToPublicationXref
- the map of id to biopax jdom element.- Throws:
ConverterException
- gpml:CommentGroup:BiopaxRef
-
readPublicationXrefInfo
protected java.lang.String readPublicationXrefInfo(java.util.List<org.jdom2.Element> pubxfElements) throws ConverterExceptionReads Biopax PublicationXref information from PublicationXref children elements. In GPML2013a there are some duplicated and/or empty gpml:Biopax PublicationXref information. This method reads the list of child elements until a valid value is obtained.- Parameters:
pubxfElements
- the pubxf children elements with the same local name.- Returns:
- elementText the string text value for the element.
- Throws:
ConverterException
-
readCommentGroup
protected void readCommentGroup(PathwayElement pathwayElement, org.jdom2.Element e, java.util.Map<java.lang.String,GPML2013aReader.PublicationXref> idToPublicationXref) throws ConverterExceptionReads comment group (comment, biopaxref/citationRef, dynamic property) for pathway element from jdom element.NB about CommentGroup:
- In GPML2013a, gpml:CommentGroup:PublicationXref was not implemented.
- The element gpml:CommentGroup:BiopaxRef acts as
PathwayElement.CitationRef
and holds the reference to to gpml:Biopax:PublicationXref equivalent toCitation
. - In GPML2021, Evidence and EvidenceRef was added.
- BiopaxRef was an attribute (not the element) of many of the pathway elements in the GPML2013a schema, but was never used/implemented.
- Parameters:
pathwayElement
- the pathway element.e
- the jdom element.- Throws:
ConverterException
-
readShapedElement
protected void readShapedElement(ShapedElement shapedElement, org.jdom2.Element se, java.util.Map<java.lang.String,GPML2013aReader.PublicationXref> idToPublicationXref) throws ConverterExceptionReads shaped pathway elementShapedElement
information: graphics and comment group (comments, biopaxRefs (equivalent to citationRefs), and dynamic properties). NB:readGroups(org.pathvisio.libgpml.model.PathwayModel, org.jdom2.Element, java.util.Set<java.lang.String>, java.util.Map<java.lang.String, org.pathvisio.libgpml.model.GPML2013aReader.PublicationXref>, java.util.Map<java.lang.String, org.pathvisio.libgpml.model.Group>, java.util.Map<java.lang.String, org.pathvisio.libgpml.model.Group>)
does not call this method and instead callsreadCommentGroup(org.pathvisio.libgpml.model.PathwayElement, org.jdom2.Element, java.util.Map<java.lang.String, org.pathvisio.libgpml.model.GPML2013aReader.PublicationXref>)
. In GPML2013a, Group graphics properties were hard coded and were not written to the gpml.- Parameters:
shapedElement
- the shaped pathway element.se
- the jdom element.idToPublicationXref
- the map of id to biopax jdom element.- Throws:
ConverterException
-
readComments
protected void readComments(PathwayElement pathwayElement, org.jdom2.Element e) throws ConverterExceptionReads commentPathwayElement.Comment
information for pathway element from jdom element. NB: If pathway element isPathway
and source is WikiPathways-description, set comment as pathway description instead!- Parameters:
pathwayElement
- the pathway element.e
- the jdom element.- Throws:
ConverterException
-
readDynamicProperties
protected void readDynamicProperties(PathwayElement pathwayElement, org.jdom2.Element root) throws ConverterExceptionReads gpml:Attribute or dynamic property information forPathwayElement
from jdom element.NB:
- For
ShapedElement
, if dynamic property codes for DoubleLineProperty or CellularComponentProperty, updates/overrides borderStyle or shapeType. Otherwise, sets dynamic property. - For
LineElement
, if dynamic property codes for DoubleLineProperty, updates lineStyle. Otherwise, sets dynamic property.
- Parameters:
pathwayElement
- the pathway element.root
- the jdom root element.- Throws:
ConverterException
- For
-
readGroups
protected void readGroups(PathwayModel pathwayModel, org.jdom2.Element root, java.util.Set<java.lang.String> elementIdSet, java.util.Map<java.lang.String,GPML2013aReader.PublicationXref> idToPublicationXref, java.util.Map<java.lang.String,Group> groupIdToGroup, java.util.Map<java.lang.String,Group> graphIdToGroup) throws ConverterExceptionReads groupGroup
information for pathway model from root element.NB:
- A group has identifier GroupId (essentially ElementId), while GraphId is
optional. A group has GraphId if there is at least one
LineElement.LinePoint
referring to this group by GraphRef. Because GroupIds may conflict with an elementId, new unique elementIds (value) can be assigned with reference back to the original GroupIds (key) in groupIdToNew map. - Group type "None" (GPML2013a) is replaced with "Group" (GPML2021).
- Group type "Group" (GPML2013a) is replaced with "Transparent" (GPML2021).
- Rect properties (centerX, centerY, width, height) are not set but calculated when needed.
- Parameters:
pathwayModel
- the pathway model.root
- the root element.elementIdSet
- the set of all elementIds.idToPublicationXref
- the map of id to biopax jdom element.groupIdToGroup
- the map of groupId to group.- Throws:
ConverterException
- A group has identifier GroupId (essentially ElementId), while GraphId is
optional. A group has GraphId if there is at least one
-
readGroupGroupRef
protected void readGroupGroupRef(PathwayModel pathwayModel, org.jdom2.Element root, java.util.Map<java.lang.String,Group> groupIdToGroup) throws ConverterExceptionReads groupRef propertyShapedElement.setGroupRef(org.pathvisio.libgpml.model.Group)
information of group pathway element. Because a group may refer to another group not yet initialized. We read and set groupRef after reading all group elements. The groupRef is the "parent" group to which this group refers.- Parameters:
pathwayModel
- the pathway model.root
- the root element.groupIdToGroup
- the map of groupId to group.- Throws:
ConverterException
-
setGroupGraphicsProperty
Reads and sets graphics properties forGroup
.Graphics depends on group type:
- Below Group colors from Pathvisio3...
- TRANSPARENT: transparent rectangle
- COMPLEX: gray #b4b46419 octagon with gray #808080 solid border
- PATHWAY: green #00ff000c rectangle with gray #808080 dashed border
- GROUP (DEFAULT): gray #b4b46419 rectangle with gray #808080 dashed border
- Parameters:
group
- the group pathway element.type
- the group type.- Throws:
ConverterException
-
readLabels
protected void readLabels(PathwayModel pathwayModel, org.jdom2.Element root, java.util.Set<java.lang.String> elementIdSet, java.util.Map<java.lang.String,GPML2013aReader.PublicationXref> idToPublicationXref, java.util.Map<java.lang.String,Group> groupIdToGroup) throws ConverterExceptionReads labelLabel
information for pathway model from root element.- Parameters:
pathwayModel
- the pathway model.root
- the root element.elementIdSet
- the set of all elementIds.idToPublicationXref
- the map of id to biopax jdom element.groupIdToGroup
- the map of groupId to group.- Throws:
ConverterException
-
readShapes
protected void readShapes(PathwayModel pathwayModel, org.jdom2.Element root, java.util.Set<java.lang.String> elementIdSet, java.util.Map<java.lang.String,GPML2013aReader.PublicationXref> idToPublicationXref, java.util.Map<java.lang.String,Group> groupIdToGroup) throws ConverterExceptionReads shapeShape
information for pathway model from root element.- Parameters:
pathwayModel
- the pathway model.root
- the root element.elementIdSet
- the set of all elementIds.idToPublicationXref
- the map of id to biopax jdom element.groupIdToGroup
- the map of groupId to group.- Throws:
ConverterException
-
readDataNodes
protected void readDataNodes(PathwayModel pathwayModel, org.jdom2.Element root, java.util.Set<java.lang.String> elementIdSet, java.util.Map<java.lang.String,GPML2013aReader.PublicationXref> idToPublicationXref, java.util.Map<java.lang.String,Group> groupIdToGroup) throws ConverterExceptionReads data nodeDataNode
information for pathway model from root element.- Parameters:
pathwayModel
- the pathway model.root
- the root element.elementIdSet
- the set of all elementIds.idToPublicationXref
- the map of id to biopax jdom element.groupIdToGroup
- the map of groupId to group.- Throws:
ConverterException
-
readStates
protected void readStates(PathwayModel pathwayModel, org.jdom2.Element root, java.util.Set<java.lang.String> elementIdSet, java.util.Map<java.lang.String,GPML2013aReader.PublicationXref> idToPublicationXref) throws ConverterExceptionReads stateDataNode.State
information for pathway model from root element.- Parameters:
pathwayModel
- the pathway model.root
- the root element.elementIdSet
- the set of all elementIds.idToPublicationXref
- the map of id to biopax jdom element.- Throws:
ConverterException
-
convertStateCommentToRefs
protected void convertStateCommentToRefs(DataNode.State state, java.util.Set<java.lang.String> elementIdSet) throws ConverterExceptionThis method is used to handleDataNode.State
PathwayElement.Comment
which were manually added to encode phosphosite information. This method first checks whether a comment for a state is indeed phosphosite information. The phosphosite information is parsed and stored in aLinkedHashMap
annotationsMap. For each key value pair in annotationsMap, a newXref
orAnnotation
is created. The annotation is added to the pathway model after checking for annotations with equivalent properties. A newPathwayElement.AnnotationRef
is created for the annotation and added to the state. Lastly the comment itself is removed from the state so that information is not duplicated. NB: "sitegrpid", "ptm" and "direction" are specially handled.- Parameters:
state
-elementIdSet
-- Throws:
ConverterException
-
readInteractions
protected void readInteractions(PathwayModel pathwayModel, org.jdom2.Element root, java.util.Set<java.lang.String> elementIdSet, java.util.Map<java.lang.String,GPML2013aReader.PublicationXref> idToPublicationXref, java.util.Map<java.lang.String,Group> groupIdToGroup, java.util.Map<org.jdom2.Element,LineElement.LinePoint> elementToPoint) throws ConverterExceptionReads interactionInteraction
information for pathway model from root element. New unique elementIds are assigned to line pathway elements are stored in the ordered lineList so that line pathway elements can be retrieved based on previous read order. NB: points are read byreadPoints(org.pathvisio.libgpml.model.LineElement, org.jdom2.Element, java.util.Set<java.lang.String>, java.util.Map<org.jdom2.Element, org.pathvisio.libgpml.model.LineElement.LinePoint>)
.- Parameters:
pathwayModel
- the pathway model.root
- the root element.elementIdSet
- the set of all elementIds.idToPublicationXref
- the map of id to biopax jdom element.groupIdToGroup
- the map of groupId to group.elementToPoint
- the map of jdom element to line points.- Throws:
ConverterException
-
readGraphicalLines
protected void readGraphicalLines(PathwayModel pathwayModel, org.jdom2.Element root, java.util.Set<java.lang.String> elementIdSet, java.util.Map<java.lang.String,GPML2013aReader.PublicationXref> idToPublicationXref, java.util.Map<java.lang.String,Group> groupIdToGroup, java.util.Map<org.jdom2.Element,LineElement.LinePoint> elementToPoint) throws ConverterExceptionReads graphical lineGraphicalLine
information for pathway model from root element. New unique elementIds are assigned to line pathway elements are stored in the ordered lineList so that line pathway elements can be retrieved based on previous read order. NB: points are read byreadPoints(org.pathvisio.libgpml.model.LineElement, org.jdom2.Element, java.util.Set<java.lang.String>, java.util.Map<org.jdom2.Element, org.pathvisio.libgpml.model.LineElement.LinePoint>)
.- Parameters:
pathwayModel
- the pathway model.root
- the root element.elementIdSet
- the set of all elementIds.idToPublicationXref
- the map of id to biopax jdom element.groupIdToGroup
- the map of groupId to group.elementToPoint
- the map of jdom element to line points.- Throws:
ConverterException
-
readPointElementRefs
protected void readPointElementRefs(PathwayModel pathwayModel, java.util.Map<java.lang.String,Group> graphIdToGroup, java.util.Map<org.jdom2.Element,LineElement.LinePoint> elementToPoint) throws ConverterExceptionReadsLineElement.LinePoint
elementRefs. ElementRefs must be read after the pathway elements they refer to.Map
elementToPoint stores jdom elements for Points and their corresponding LinePoint pathway element so that elementRef information can be easily added. NB: points refer to a group by its GraphId not GroupId(essentially elementId). If the pathway element referenced by a point is a group, we must search for the group by its GraphId inMap
graphIdToGroup.- Parameters:
pathwayModel
- the pathway model.graphIdToGroup
- the map of graphId to group.elementToPoint
- the map of jdom element to line points.- Throws:
ConverterException
-
readLineElement
protected void readLineElement(LineElement lineElement, org.jdom2.Element ln, java.util.Set<java.lang.String> elementIdSet, java.util.Map<java.lang.String,GPML2013aReader.PublicationXref> idToPublicationXref, java.util.Map<java.lang.String,Group> groupIdToGroup) throws ConverterExceptionReads line elementLineElement
information for interaction or graphical line from jdom element. NB: points are read byreadPoints(org.pathvisio.libgpml.model.LineElement, org.jdom2.Element, java.util.Set<java.lang.String>, java.util.Map<org.jdom2.Element, org.pathvisio.libgpml.model.LineElement.LinePoint>)
.- Parameters:
lineElement
- the line pathway element.ln
- the jdom line element.elementIdSet
- the set of all elementIds.idToPublicationXref
- the map of id to biopax jdom element.groupIdToGroup
- the map of groupId to group.- Throws:
ConverterException
-
readPoints
protected void readPoints(LineElement lineElement, org.jdom2.Element ln, java.util.Set<java.lang.String> elementIdSet, java.util.Map<org.jdom2.Element,LineElement.LinePoint> elementToPoint) throws ConverterExceptionReads pointsLineElement.LinePoint
for pathway model line pathway elements. Point elementRefs must be read after the pathway elements they refer to. Therefore points are read last inreadPointElementRefs(org.pathvisio.libgpml.model.PathwayModel, java.util.Map<java.lang.String, org.pathvisio.libgpml.model.Group>, java.util.Map<org.jdom2.Element, org.pathvisio.libgpml.model.LineElement.LinePoint>)
.- Parameters:
lineElement
- the line pathway element.ln
- the jdom line element.elementIdSet
- the set of all elementIds.elementToPoint
- the map of jdom element to line points.- Throws:
ConverterException
-
readArrowHeadType
protected ArrowHeadType readArrowHeadType(org.jdom2.Element pt, java.lang.String base) throws ConverterExceptionReturns the arrowHead for give jdom point element.- Parameters:
pt
- the jdom point element.base
- the string for either "Interaction" or "GraphicalLine"- Returns:
- the arrowhead for given jdom point element.
- Throws:
ConverterException
-
readAnchors
protected void readAnchors(LineElement lineElement, org.jdom2.Element gfx, java.util.Set<java.lang.String> elementIdSet) throws ConverterExceptionReads anchorLineElement.Anchor
information for line element from element.- Parameters:
lineElement
- the line element object.gfx
- the jdom graphics element.elementIdSet
- the set of all elementIds.- Throws:
ConverterException
-
readXref
Reads xrefXref
information from element. In GPML2013a, Xref is required for DataNodes, Interactions, and optional for States.- Parameters:
e
- the element.- Throws:
ConverterException
-
readElementId
protected java.lang.String readElementId(java.lang.String tag, org.jdom2.Element e, java.util.Set<java.lang.String> elementIdSet) throws ConverterExceptionReturns elementId read for given Element. If elementId is missing (null), generates and returns a new unique elementId. New unique elementIds are added to elementIdSet.- Parameters:
tag
- the string tag forGPML2013aFormatAbstract.getAttr(java.lang.String, java.lang.String, org.jdom2.Element)
e
- the jdom element.elementIdSet
- the set of all elementIds.- Returns:
- elementId the elementId for given element.
- Throws:
ConverterException
-
readGroupRef
protected void readGroupRef(ShapedElement shapedElement, org.jdom2.Element se, java.util.Map<java.lang.String,Group> groupIdToGroup) throws ConverterExceptionReads and sets groupRef for given (shaped) pathway element and jdom Element.- Parameters:
shapedElement
- the (shaped) pathway element.se
- the jdom (shaped) pathway element.groupIdToGroup
- the map of groupId to group.- Throws:
ConverterException
-
readRectProperty
protected void readRectProperty(ShapedElement shapedElement, org.jdom2.Element gfx) throws ConverterExceptionReads rect property information. Jdom handles schema default values.- Parameters:
shapedElement
- the shaped pathway element.gfx
- the jdom graphics element.- Throws:
ConverterException
-
readFontProperty
protected void readFontProperty(ShapedElement shapedElement, org.jdom2.Element gfx) throws ConverterExceptionReads font property information. Jdom handles schema default values. NB: State has no font properties in GPML2013a, set basically default values.- Parameters:
shapedElement
- the shaped pathwayElement.gfx
- the jdom graphics element.- Throws:
ConverterException
-
readShapeStyleProperty
protected void readShapeStyleProperty(ShapedElement shapedElement, org.jdom2.Element gfx) throws ConverterExceptionReads shape style property information. Jdom handles schema default values. If shape type is a key inGPML2013aFormatAbstract.DEPRECATED_MAP
, replaces deprecated shape type with newer value.NB:
- If pathway element has dynamic property key CellularComponentProperty,
shape type is again replaced, this time with the dynamic property value in
readDynamicProperties(org.pathvisio.libgpml.model.PathwayElement, org.jdom2.Element)
. - If state pathway element has dynamic property key
- Parameters:
shapedElement
- the shaped pathway element.gfx
- the jdom graphics element.- Throws:
ConverterException
- If pathway element has dynamic property key CellularComponentProperty,
shape type is again replaced, this time with the dynamic property value in
-
readLineStyleProperty
protected void readLineStyleProperty(LineElement lineElement, org.jdom2.Element gfx) throws ConverterExceptionReads line style property information. Jdom handles schema default values.- Parameters:
lineElement
- the line pathway element.gfx
- the jdom graphics element.- Throws:
ConverterException
-