Package org.pathvisio.libgpml.model
Class GPML2021Reader
java.lang.Object
org.pathvisio.libgpml.model.GPMLFormatAbstract
org.pathvisio.libgpml.model.GPML2021FormatAbstract
org.pathvisio.libgpml.model.GPML2021Reader
- All Implemented Interfaces:
GPMLFormatReader,GPMLFormatVersion
public class GPML2021Reader extends GPML2021FormatAbstract implements GPMLFormatReader
This class reads a PathwayModel from an input source (GPML 2021).
- Author:
- finterly
-
Field Summary
Fields Modifier and Type Field Description static GPML2021ReaderGPML2021READERFields inherited from class org.pathvisio.libgpml.model.GPML2021FormatAbstract
ANCHORSHAPETYPE_DEFAULT, ANNOTATIONTYPE_DEFAULT, ARROWHEAD_DEFAULT, BACKGROUNDCOLOR_DEFAULT, BORDERCOLOR_DEFAULT, BORDERSTYLE_DEFAULT, BORDERWIDTH_DEFAULT, CONNECTORTYPE_DEFAULT, DATANODETYPE_DEFAULT, FILLCOLOR_DEFAULT, FONTDECORATION_DEFAULT, FONTNAME_DEFAULT, FONTSIZE_DEFAULT, FONTSTRIKETHRU_DEFAULT, FONTSTYLE_DEFAULT, FONTWEIGHT_DEFAULT, GROUPTYPE_DEFAULT, HALIGN_DEFAULT, LINECOLOR_DEFAULT, LINESTYLE_DEFAULT, LINEWIDTH_DEFAULT, SHAPETYPE_DEFAULT, STATETYPE_DEFAULT, TEXTCOLOR_DEFAULT, VALIGN_DEFAULTFields inherited from class org.pathvisio.libgpml.model.GPMLFormatAbstract
BIOPAX_NAMESPACE, OWL_NAMESPACE, RDF_NAMESPACE, RDF_STRING, RDFS_NAMESPACE -
Constructor Summary
Constructors Modifier Constructor Description protectedGPML2021Reader(java.lang.String xsdFile, org.jdom2.Namespace nsGPML)Constructor for GPML reader. -
Method Summary
Modifier and Type Method Description protected voidreadAnchors(LineElement lineElement, org.jdom2.Element wyps)Reads anchorLineElement.Anchorinformation for line element from jdom element.protected voidreadAnnotationRefs(PathwayModel pathwayModel, Referenceable.Annotatable annotatable, org.jdom2.Element e, java.util.Map<java.lang.String,org.jdom2.Element> refIdToJdomElement)protected voidreadAuthors(Pathway pathway, org.jdom2.Element root)Reads authorPathway.Authorinformation for pathway from root element.protected voidreadCitationRefs(PathwayModel pathwayModel, Referenceable.Citable citable, org.jdom2.Element e, java.util.Map<java.lang.String,org.jdom2.Element> refIdToJdomElement)protected voidreadCommentGroup(PathwayModel pathwayModel, PathwayElement pathwayElement, org.jdom2.Element e, java.util.Map<java.lang.String,org.jdom2.Element> refIdToJdomElement)Reads comment group (comment, dynamic property, annotationRef, citationRef, evidenceRef) information forPathwayElementfrom jdom element.protected voidreadComments(PathwayElement pathwayElement, org.jdom2.Element e)Reads commentPathwayElement.Commentinformation for pathway element from jdom element.protected voidreadDataNodes(PathwayModel pathwayModel, org.jdom2.Element root, java.util.Map<java.lang.String,org.jdom2.Element> refIdToJdomElement)Reads data nodeDataNodeinformation for pathway model from root element.protected voidreadDynamicProperties(PathwayElement pathwayElement, org.jdom2.Element e)Reads dynamic propertyPathwayElement.setDynamicProperty(java.lang.String, java.lang.String)information for pathway element from jdom element.protected voidreadEvidenceRefs(PathwayModel pathwayModel, Referenceable.Evidenceable evidenceable, org.jdom2.Element e, java.util.Map<java.lang.String,org.jdom2.Element> refIdToJdomElement)protected voidreadFontProperty(ShapedElement shapedElement, org.jdom2.Element gfx)Reads font property information.voidreadFromRoot(PathwayModel pathwayModel, org.jdom2.Element root)Reads information from root element of Jdom documentDocumentto the pathway modelPathwayModel.protected voidreadGraphicalLines(PathwayModel pathwayModel, org.jdom2.Element root, java.util.Map<java.lang.String,org.jdom2.Element> refIdToJdomElement, java.util.Map<org.jdom2.Element,LineElement.LinePoint> elementToPoint)Reads graphical lineGraphicalLineinformation for pathway model from root element.protected voidreadGroupRef(PathwayModel pathwayModel, ShapedElement shapedElement, org.jdom2.Element e)protected voidreadGroups(PathwayModel pathwayModel, org.jdom2.Element root, java.util.Map<java.lang.String,org.jdom2.Element> refIdToJdomElement)Reads groupGroupinformation for pathway model from root element.protected voidreadInfoMap(org.jdom2.Element root, java.util.Map<java.lang.String,org.jdom2.Element> refIdToJdomElement)Reads and maps ref (Annotation, Citation, and Evidence) elementId id to the corresponding jdom element inMaprefIdToJdomElement, to assist other reading methods:readAnnotationRefs(org.pathvisio.libgpml.model.PathwayModel, org.pathvisio.libgpml.model.Referenceable.Annotatable, org.jdom2.Element, java.util.Map<java.lang.String, org.jdom2.Element>),readCitationRefs(org.pathvisio.libgpml.model.PathwayModel, org.pathvisio.libgpml.model.Referenceable.Citable, org.jdom2.Element, java.util.Map<java.lang.String, org.jdom2.Element>), andreadEvidenceRefs(org.pathvisio.libgpml.model.PathwayModel, org.pathvisio.libgpml.model.Referenceable.Evidenceable, org.jdom2.Element, java.util.Map<java.lang.String, org.jdom2.Element>).protected voidreadInteractions(PathwayModel pathwayModel, org.jdom2.Element root, java.util.Map<java.lang.String,org.jdom2.Element> refIdToJdomElement, java.util.Map<org.jdom2.Element,LineElement.LinePoint> elementToPoint)Reads interactionInteractioninformation for pathway model from root element.protected voidreadLabels(PathwayModel pathwayModel, org.jdom2.Element root, java.util.Map<java.lang.String,org.jdom2.Element> refIdToJdomElement)Reads labelLabelinformation for pathway model from root element.protected voidreadLineElement(PathwayModel pathwayModel, LineElement lineElement, org.jdom2.Element ln, java.util.Map<java.lang.String,org.jdom2.Element> refIdToJdomElement, java.util.Map<org.jdom2.Element,LineElement.LinePoint> elementToPoint)Reads line elementLineElementinformation for interaction or graphical line from jdom element.protected voidreadLineStyleProperty(LineElement lineElement, org.jdom2.Element gfx)Reads line style property information.protected PathwayreadPathway(Pathway pathway, org.jdom2.Element root)Reads pathway information from jdom root element.protected voidreadPointElementRefs(PathwayModel pathwayModel, java.util.Map<org.jdom2.Element,LineElement.LinePoint> elementToPoint)Reads elementRefLineElement.LinePoint.setElementRef(org.pathvisio.libgpml.model.GraphLink.LinkableTo)for pathway model points.protected voidreadPoints(LineElement lineElement, org.jdom2.Element wyps, java.util.Map<org.jdom2.Element,LineElement.LinePoint> elementToPoint)Reads pointLineElement.LinePointinformation for line element.protected voidreadRectProperty(ShapedElement shapedElement, org.jdom2.Element gfx)Reads rect property information.protected voidreadShapedElement(PathwayModel pathwayModel, ShapedElement shapedElement, org.jdom2.Element se, java.util.Map<java.lang.String,org.jdom2.Element> refIdToJdomElement)Reads common properties for shaped pathway elementsShapedElement.protected voidreadShapes(PathwayModel pathwayModel, org.jdom2.Element root, java.util.Map<java.lang.String,org.jdom2.Element> refIdToJdomElement)Reads shapeShapeinformation for pathway model from root element.protected voidreadShapeStyleProperty(ShapedElement shapedElement, org.jdom2.Element gfx)Reads shape style property information.protected voidreadStates(PathwayModel pathwayModel, DataNode dataNode, org.jdom2.Element dn, java.util.Map<java.lang.String,org.jdom2.Element> refIdToJdomElement)Reads stateDataNode.Stateinformation for data node from element.protected java.lang.StringreadUrl(org.jdom2.Element e)Reads Url link information from element.protected org.bridgedb.XrefreadXref(org.jdom2.Element e)Reads xrefXrefinformation from jdom element.Methods inherited from class org.pathvisio.libgpml.model.GPMLFormatAbstract
getGpmlNamespace, getSchemaFile, refreshLineElements, updateGroups, validateDocumentMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.pathvisio.libgpml.model.GPMLFormatVersion
getGpmlNamespace, getSchemaFile, validateDocument
-
Field Details
-
GPML2021READER
-
-
Constructor Details
-
GPML2021Reader
protected GPML2021Reader(java.lang.String xsdFile, org.jdom2.Namespace nsGPML)Constructor for GPML reader.- Parameters:
xsdFile- the schema file.nsGPML- the GPML namespace.
-
-
Method Details
-
readFromRoot
public void readFromRoot(PathwayModel pathwayModel, org.jdom2.Element root) throws ConverterExceptionReads information from root element of Jdom documentDocumentto the pathway modelPathwayModel. NB: Order of reading is done in such as way that referenced elements are read first. Groups are read first as other pathway elements reference groupRef. Point and DataNode elementRef are read last to ensure the Pathway Elements referenced are already instantiated.- Specified by:
readFromRootin interfaceGPMLFormatReader- Parameters:
pathwayModel- the given pathway model.root- the root element of given Jdom document.- Throws:
ConverterException
-
readPathway
Reads pathway information from jdom root element. Instantiates and returns the pathway objectPathway.- Parameters:
root- the jdom root element.- Throws:
ConverterException
-
readXref
Reads xrefXrefinformation from jdom element. Xref is optional for Pathway, DataNodes, States, Interactions, Groups, Annotations, and Evidences. Citations must have either Xref or Url, or both.- Parameters:
e- the jdom element.- Returns:
- xref the new xref or null if no or invalid xref information.
- Throws:
ConverterException
-
readUrl
Reads Url link information from element. Url is optional for Annotations, Citations, and Evidences. Citations must have either Xref or Url, or both.- Parameters:
e- the element.- Returns:
- urlLink the link for the url.
- Throws:
ConverterException
-
readAuthors
Reads authorPathway.Authorinformation for pathway from root element.- Parameters:
pathway- the pathway.root- the jdom root element.- Throws:
ConverterException
-
readInfoMap
protected void readInfoMap(org.jdom2.Element root, java.util.Map<java.lang.String,org.jdom2.Element> refIdToJdomElement) throws ConverterExceptionReads and maps ref (Annotation, Citation, and Evidence) elementId id to the corresponding jdom element inMaprefIdToJdomElement, to assist other reading methods:readAnnotationRefs(org.pathvisio.libgpml.model.PathwayModel, org.pathvisio.libgpml.model.Referenceable.Annotatable, org.jdom2.Element, java.util.Map<java.lang.String, org.jdom2.Element>),readCitationRefs(org.pathvisio.libgpml.model.PathwayModel, org.pathvisio.libgpml.model.Referenceable.Citable, org.jdom2.Element, java.util.Map<java.lang.String, org.jdom2.Element>), andreadEvidenceRefs(org.pathvisio.libgpml.model.PathwayModel, org.pathvisio.libgpml.model.Referenceable.Evidenceable, org.jdom2.Element, java.util.Map<java.lang.String, org.jdom2.Element>).- Parameters:
root- the jdom root element.refIdToJdomElement- the map of ref elementId to jdom element.- Throws:
ConverterException
-
readAnnotationRefs
protected void readAnnotationRefs(PathwayModel pathwayModel, Referenceable.Annotatable annotatable, org.jdom2.Element e, java.util.Map<java.lang.String,org.jdom2.Element> refIdToJdomElement) throws ConverterException- Parameters:
pathwayModel- the pathway model.annotatable- the pathway object which can have annotation.e- the jdom element.refIdToJdomElement- the map of ref elementId to jdom element.- Throws:
ConverterException
-
readCitationRefs
protected void readCitationRefs(PathwayModel pathwayModel, Referenceable.Citable citable, org.jdom2.Element e, java.util.Map<java.lang.String,org.jdom2.Element> refIdToJdomElement) throws ConverterException- Parameters:
pathwayModel- the pathway model.citable- the pathway object which can have citation.e- the jdom element.refIdToJdomElement- the map of ref elementId to jdom element.- Throws:
ConverterException
-
readEvidenceRefs
protected void readEvidenceRefs(PathwayModel pathwayModel, Referenceable.Evidenceable evidenceable, org.jdom2.Element e, java.util.Map<java.lang.String,org.jdom2.Element> refIdToJdomElement) throws ConverterException- Parameters:
pathwayModel- the pathway model.evidenceable- the pathway object which can have evidence.e- the jdom element.refIdToJdomElement- the map of ref elementId to jdom element.- Throws:
ConverterException
-
readCommentGroup
protected void readCommentGroup(PathwayModel pathwayModel, PathwayElement pathwayElement, org.jdom2.Element e, java.util.Map<java.lang.String,org.jdom2.Element> refIdToJdomElement) throws ConverterExceptionReads comment group (comment, dynamic property, annotationRef, citationRef, evidenceRef) information forPathwayElementfrom jdom element.- Parameters:
pathwayElement- the element info pathway element object.e- the jdom element.refIdToJdomElement- the map of ref elementId to jdom element.- Throws:
ConverterException
-
readComments
protected void readComments(PathwayElement pathwayElement, org.jdom2.Element e) throws ConverterExceptionReads commentPathwayElement.Commentinformation for pathway element from jdom element.- Parameters:
pathwayElement- the pathway element.e- the jdom element.- Throws:
ConverterException
-
readDynamicProperties
protected void readDynamicProperties(PathwayElement pathwayElement, org.jdom2.Element e) throws ConverterExceptionReads dynamic propertyPathwayElement.setDynamicProperty(java.lang.String, java.lang.String)information for pathway element from jdom element.- Parameters:
pathwayElement- the the pathway element.e- the jdom element.- Throws:
ConverterException
-
readGroups
protected void readGroups(PathwayModel pathwayModel, org.jdom2.Element root, java.util.Map<java.lang.String,org.jdom2.Element> refIdToJdomElement) throws ConverterExceptionReads groupGroupinformation for pathway model from root element.- Parameters:
pathwayModel- the pathway model.root- the jdom root element.refIdToJdomElement- the map of ref elementId to jdom element.- Throws:
ConverterException
-
readLabels
protected void readLabels(PathwayModel pathwayModel, org.jdom2.Element root, java.util.Map<java.lang.String,org.jdom2.Element> refIdToJdomElement) throws ConverterExceptionReads labelLabelinformation for pathway model from root element.- Parameters:
pathwayModel- the pathway model.root- the jdom root element.refIdToJdomElement- the map of ref elementId to jdom element.- Throws:
ConverterException
-
readShapes
protected void readShapes(PathwayModel pathwayModel, org.jdom2.Element root, java.util.Map<java.lang.String,org.jdom2.Element> refIdToJdomElement) throws ConverterExceptionReads shapeShapeinformation for pathway model from root element.- Parameters:
pathwayModel- the pathway model.root- the root element.refIdToJdomElement- the map of ref elementId to jdom element.- Throws:
ConverterException
-
readDataNodes
protected void readDataNodes(PathwayModel pathwayModel, org.jdom2.Element root, java.util.Map<java.lang.String,org.jdom2.Element> refIdToJdomElement) throws ConverterExceptionReads data nodeDataNodeinformation for pathway model from root element.- Parameters:
pathwayModel- the pathway model.root- the jdom root element.refIdToJdomElement- the map of ref elementId to jdom element.- Throws:
ConverterException
-
readStates
protected void readStates(PathwayModel pathwayModel, DataNode dataNode, org.jdom2.Element dn, java.util.Map<java.lang.String,org.jdom2.Element> refIdToJdomElement) throws ConverterExceptionReads stateDataNode.Stateinformation for data node from element.- Parameters:
pathwayModel- the pathway model.dataNode- the data node objectDataNode.dn- the jdom data node element.refIdToJdomElement- the map of ref elementId to jdom element.- Throws:
ConverterException
-
readShapedElement
protected void readShapedElement(PathwayModel pathwayModel, ShapedElement shapedElement, org.jdom2.Element se, java.util.Map<java.lang.String,org.jdom2.Element> refIdToJdomElement) throws ConverterExceptionReads common properties for shaped pathway elementsShapedElement.- Parameters:
pathwayModel- the pathway model.shapedElement- the shaped pathway element.se- the jdom (shaped) pathway element.refIdToJdomElement- the map of ref elementId to jdom element.- Throws:
ConverterException
-
readGroupRef
protected void readGroupRef(PathwayModel pathwayModel, ShapedElement shapedElement, org.jdom2.Element e) throws ConverterException- Parameters:
pathwayModel- the pathway model.shapedElement- the shapedElement to read groupRef for.e- the jdom shaped element.- Throws:
ConverterException
-
readInteractions
protected void readInteractions(PathwayModel pathwayModel, org.jdom2.Element root, java.util.Map<java.lang.String,org.jdom2.Element> refIdToJdomElement, java.util.Map<org.jdom2.Element,LineElement.LinePoint> elementToPoint) throws ConverterExceptionReads interactionInteractioninformation for pathway model from root element.- Parameters:
pathwayModel- the pathway model.root- the jdom root element.refIdToJdomElement- the map of ref elementId to jdom element.- Throws:
ConverterException
-
readGraphicalLines
protected void readGraphicalLines(PathwayModel pathwayModel, org.jdom2.Element root, java.util.Map<java.lang.String,org.jdom2.Element> refIdToJdomElement, java.util.Map<org.jdom2.Element,LineElement.LinePoint> elementToPoint) throws ConverterExceptionReads graphical lineGraphicalLineinformation for pathway model from root element.- Parameters:
pathwayModel- the pathway model.root- the jdom root element.refIdToJdomElement- the map of ref elementId to jdom element.elementToPoint- the map of jdom element to line points.- Throws:
ConverterException
-
readPoints
protected void readPoints(LineElement lineElement, org.jdom2.Element wyps, java.util.Map<org.jdom2.Element,LineElement.LinePoint> elementToPoint) throws ConverterExceptionReads pointLineElement.LinePointinformation for line element.- Parameters:
lineElement- the line element object.wyps- the jdom waypoints element.elementToPoint- the map of jdom element to line points.- Throws:
ConverterException
-
readLineElement
protected void readLineElement(PathwayModel pathwayModel, LineElement lineElement, org.jdom2.Element ln, java.util.Map<java.lang.String,org.jdom2.Element> refIdToJdomElement, java.util.Map<org.jdom2.Element,LineElement.LinePoint> elementToPoint) throws ConverterExceptionReads line elementLineElementinformation for interaction or graphical line from jdom element.- Parameters:
lineElement- the line element object.ln- the jdom line element.refIdToJdomElement- the map of ref elementId to jdom element.elementToPoint- the map of jdom element to line points.- Throws:
ConverterException
-
readAnchors
protected void readAnchors(LineElement lineElement, org.jdom2.Element wyps) throws ConverterExceptionReads anchorLineElement.Anchorinformation for line element from jdom element.- Parameters:
lineElement- the line element object.wyps- the jdom waypoints element.- Throws:
ConverterException
-
readPointElementRefs
protected void readPointElementRefs(PathwayModel pathwayModel, java.util.Map<org.jdom2.Element,LineElement.LinePoint> elementToPoint) throws ConverterExceptionReads elementRefLineElement.LinePoint.setElementRef(org.pathvisio.libgpml.model.GraphLink.LinkableTo)for pathway model points.- Parameters:
pathwayModel- the pathway model.elementToPoint- the map of jdom element to line points.- 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.- Parameters:
shapedElement- the shaped pathway element.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.- Parameters:
shapedElement- the shaped pathway element.gfx- the jdom graphics element.- Throws:
ConverterException
-
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
-