Learn R Programming

rBiopaxParser

Parses BioPax files of Level 2 and Level 3 and represents them in R.

More concretely, rBiopaxParser:

  • Can download Biopax data from online resources

  • Parses Biopax owl files

  • Features many functions to select, add, modify and remove from the parsed Biopax models

  • Can produce regulatory graphs from Biopax pathway data and offers functions to merge, diff and transform these graphs in various ways

  • Visualization functions to layout ina a (more or less) beautiful way

  • Can export the (modified) Biopax models to OWL

rBiopaxParser has been published in Bioinformatics! rBiopaxParser - an R package to parse, modify and visualize BioPAX data. Kramer F, Bayerlova M, Klemm F, Bleckmann A, Beissbarth T. Bioinformatics (2013) 29(4): 520-522. http://bioinformatics.oxfordjournals.org/content/29/4/520.abstract

You can retrieve rBiopaxParser from Bioconductor or GitHub: http://www.bioconductor.org/packages/devel/bioc/html/rBiopaxParser.html https://github.com/frankkramer/rBiopaxParser

Prerequisites:

This package suggests package RCurl to download Biopax files from the web.
This package needs package XML to parse the Biopax .owl files.
This package needs package graph to build graphs/networks from the data.
This package suggests package Rgraphviz to visualize networks.
To install directly from github you need package devtools.

Installation or running certain functions MIGHT fail if these are not met. Please read carefully through the following instructions.

Installing prerequisites for Linux users:

XML:
Make sure your linux has library libxml2 installed. This is almost always the case. Otherwise run in your shell
sudo apt-get install libxml2
will fix this issue. You will now be able to install R package XML, this should be automatically done when you install rBiopaxParser, or you can run within R:
install.packages("XML")

RCurl:
RCurl is only needed for a convenience function to download Biopax files directly within R. You can skip this step if you already have the Biopax data downloaded.
Make sure your linux has library libcurl installed and curl-config in your path. Check out locate libcurl locate curl-config
If these are not found (usually the developer version is missing), most Linux users can usually fix this by running
sudo apt-get install libcurl4-openssl-dev
You will now be able to install R package RCurl, this should be automatically done when you install rBiopaxParser, or you can run within R:
install.packages("RCurl")
If you encounter more problems check out http://www.omegahat.org/RCurl/FAQ.html

graph:
Package graph has moved from CRAN to Bioconductor recently, you might encounter an error saying that package graph is not available for your distribution when calling install.packages("graph").
Check out http://bioconductor.org/packages/release/bioc/html/graph.html or call source("http://bioconductor.org/biocLite.R")
biocLite("graph")
to install it.

Rgraphviz:
Rgraphviz is used to layout the graphs generated in this package. You can layout and plot these yourself if you want to.
Since version 2.1 Rgraphviz now includes graphviz! You will now be able to install R package Rgraphviz using:
source("http://bioconductor.org/biocLite.R")
biocLite("Rgraphviz")
If you are forced to use an earlier version of Rgraphviz you have to make sure your Linux has package graphviz installed. If this is not the case, you can usually fix this by running: sudo apt-get install graphviz

If you encounter more problems check out http://www.bioconductor.org/packages/release/bioc/html/Rgraphviz.html

devtools:
Package devtools is available at CRAN. Call install.packages("devtools")
to install it.

Installing prerequisites for Windows users:

XML & RCurl:
These packages depend on linux libraries, however Brian Ripley has put some work into this to enable Windows users.
Check out http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/ for these two packages for your R version.
Download first XML...zip and then RCurl...zip and install them locally on your machine.

graph:
Package graph has moved from CRAN to Bioconductor recently, you might encounter an error saying that package graph is not available for your distribution when calling install.packages("graph").
Check out http://bioconductor.org/packages/release/bioc/html/graph.html or call source("http://bioconductor.org/biocLite.R")
biocLite("graph")
to install it.

Rgraphviz:
Rgraphviz is used to layout the graphs generated in this package. You can layout and plot these yourself if you want to.
Since version 2.1 Rgraphviz now includes graphviz! You will now be able to install R package Rgraphviz (including graphviz) using:
source("http://bioconductor.org/biocLite.R")
biocLite("Rgraphviz") If you are forced to use an earlier version of Rgraphviz you have to make sure your your machine has graphviz installed, it can be found at: http://www.graphviz.org
Click on Download -> Windows. After installing graphviz, even older version of Rgraphviz will work.
If you encounter more problems check out http://www.bioconductor.org/packages/release/bioc/html/Rgraphviz.html

devtools:
Package devtools is available at CRAN. For Windows this seems to depend on having Rtools for Windows installed. You can download and install this from:
http://cran.r-project.org/bin/windows/Rtools/
To install R package devtools call
install.packages("devtools")

Finally:

Installing rBiopaxParser from Bioconductor:

Installing rBiopaxParser from GitHub:

Copy Link

Version

Version

2.10.0

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Frank Kramer

Last Published

February 15th, 2017

Functions in rBiopaxParser (2.10.0)

getInstanceClass

This function returns the class name of the instance.
getSubClasses

This function returns the subclasses of the supplied biopax class.
getReferencedIDs

This function returns a vector of ids of all instances referenced by the specified instance.
CLASS_PROPERTIES_BP3

CLASS_PROPERTIES_BP3
addPathway

This function adds a new pathway to the biopax model.
listInstances

Lists all instances that conform to the selection criteria.
pathway2Geneset

This function generates the gene set of a pathway.
addPathwayComponents

This function adds pathway components to an existing pathway
downloadBiopaxData

This function downloads Biopax data from online databases
createBiopax

This function creates a new Biopax model from scratch
addControl

This function adds a new control to the biopax model.
generateNewUniqueID

This function generates a new unique id for a biopax model
colorGraphNodes

This function colors the nodes of a graph.
print.biopax

Print a biopax object.
addPhysicalEntity

This function adds a new physical entity.
listPathways

This function returns a list of all pathway ids.
rBiopaxParser-package

Parses BioPax level files and represents them in R
internal_propertyListToDF

Internal function to build a data.frame from the list of properties for a new instance
internal_getBiopaxModelAsDataFrame

This internal function parses the Biopax XML of the supplied biopax model and returns it in the data.frame format.
calcGraphOverlap

This function calculates the overlap of 2 graphs
transitiveReduction

This function generates the transitive reduction of the supplied graph.
DATABASE_BIOPAX

DATABASE_BIOPAX
pathway2AdjacancyMatrix

This function generates an adjacency matrix from the activations/inhibitions of a pathway in a biopax model.
addns

Add a namespace tag to the supplied classname string
checkValidity

This function checks the supplied biopax model for validity.
hasProperty

Checks if instances in the biopax data.table have a given property
removeInstance

This function removes an instance
isOfClass

Checks if instances in the biopax data.table are of the given class
internal_resolvePhysicalEntityParticipant

This function resolves physicalEntityParticipantIDs to their corresponding physicalEntityIDs
addBiopaxInstances

This function adds new instances to an existing biopax model.
getClassProperties

This function returns the properties of the supplied biopax class.
getNeighborhood

This function returns the neighborhood of a physicalEntity
mergePathways

This function merges two given pathways
CLASS_INHERITANCE_BP2

CLASS_INHERITANCE_BP2
CLASS_INHERITANCE_BP3

CLASS_INHERITANCE_BP3
addBiopaxInstance

This function adds a new instance to an existing biopax model.
addPhysicalEntityParticipant

This function adds a new physical entity participant.
internal_checkArguments

This function checks the supplied arguments if they abid to the given restrictions
intersectGraphs

This function returns a graph computed by the insection of supplied graph1 and graph2.
listInteractionComponents

This function lists all components of a given interaction.
listPathwayComponents

This function lists all pathway components of a given pathway.
splitComplex

This functions splits up a complex into its components.
diffGraphs

This function returns the different nodes and edges between graph1 and graph2.
getInstanceProperty

This function returns all properties of the specified type for an instance.
listComplexComponents

This function lists all components of a given complex.
removeProperties

This function removes a property
combineNodes

This function gracefully combines nodes of a regulatory graph.
CLASS_PROPERTIES_BP2

CLASS_PROPERTIES_BP2
addBiochemicalReaction

This function adds a new biochemical reaction to the biopax model.
transitiveClosure

This function generates the transitive closure of the supplied graph.
internal_NrOfXMLNodes

This function is an internal function to count the Number of nodes and child nodes of an XMLNode.
biopax

Biopax example data set
striphash

Strips a hash in front of a string
getReferencingIDs

This function returns a vector of ids of all instances that reference the supplied id.
addhash

Adds a hash in front of a string
internal_generateXMLfromBiopax

This function generates the xmlTree from the supplied biopax model.
plotRegulatoryGraph

This function layouts a regulatory graph and plots it using Rgraphviz.
pathway2RegulatoryGraph

This function generates the regulatory graph from the activations/inhibitions of a pathway in a biopax model.
unfactorize

Replace factors/levels in a data.frame and use plain strings instead
writeBiopax

This function writes out a biopax model.
uniteGraphs

This function unites two graphs.
stripns

Strips a namespace tag off a supplied classname string
addPropertiesToBiopaxInstance

This function adds new properties to an existing biopax instance.
internal_XMLInstance2DF

This function is an internal function that parses a Biopax XMLNode.
getSuperClasses

This function returns the superclasses of the supplied biopax class.
isOfNamespace

Check if a classname is preceeded by a certain namespace tag like in "namespace:classname"
removeNodes

This function gracefully removes nodes from a regulatory graph.
readBiopax

This function reads in a Biopax .owl file
getXrefAnnotations

This function returns the annotations of the supplied instances.
layoutRegulatoryGraph

This function generates a (more or less) beautiful layout for a regulatory graph.
selectInstances

Returns all instances that conform to the selection criteria.