Plots the predicted PPI in three different ways. Depending on the type
argument it manages the specific layout settings and finally uses the plot
function of the igraph package.
An object from the class Path2PPI where the PPI network already has
been predicted.
type
Character string. Which graph type to plot. "ppi": plots only the predicted
PPI. "hybrid": plots the hybrid network which consists of all relevant
interactions from the reference species, the predicted interactions in the
target species and all relevant homologous relationships.
multiple.edges
Logical. Is only considered if type="ppi". If TRUE then each
reference interaction is depicted in the species-specific color (raw mode),
in contrast, if set to FALSE only the finalized / combined interactions
are depicted.
scores
Logical. If TRUE the edge scores will be shown.
species.colors
Named vector, to specify the species colors. If no value is given then default
colors are used.
vertices.opacity
Numeric value between 0 and 1 defining the opacity of the vertices.
use.identifiers
Logical. If TRUE then only the proteins identifiers are used as the
vertex labels.
protein.labels
Named vector to define the labels of the vertices. If no value is given then
the protein identifiers are used. The vector does not have to be complete,
i.e. not each protein has to be defined.
show.legend
Logical. If TRUE then a legend is depicted.
vertices.coordinates
Data frame containing the coordinates of the vertices. If no value is given
then coordinates are computed using the layout.auto function.
return.coordinates
Logical. If TRUE the coordinates of the vertices are returned.
tkplot
Logical. If TRUE the graph is drawn in the interactive graph drawing
facility tkplot.
...
Additional plotting parameters.
Details
The argument return.coordinates only works correctly if
tkplot=FALSE. If you want to get the coordinates of the tkplot device
use tkplot.getcoords.
Value
If return.coordinates=TRUE the coordinates of the vertices are
returned.
Note
If you want to export the plotted graph to postscript you have to consider
that the default font family is set to sans for vertex and edge labels.
Please change the default font family of postscript to sans before you
call the plot method: ps.options(family="sans").
Additionally, you have to consider that the default value for
vertices.opacity is set to 0.8 in order to enhance the
visibility of the graph, since some edges may be hidden by the vertices.
Postscript does not support semi-transparencies. Hence, please change the
vertices.opacity argument to 1 if you want to export the graph
using postscript.
data(ai) #Load test data set
ppi <- Path2PPI("Autophagy induction", "Podospora anserina", "5145")
ppi <- addReference(ppi, "Homo sapiens", "9606", human.ai.proteins,
human.ai.irefindex, pa2human.ai.homologs)
ppi <- addReference(ppi, "Saccharomyces cerevisiae (S288c)", "559292",
yeast.ai.proteins, yeast.ai.irefindex,
pa2yeast.ai.homologs)
ppi <- predictPPI(ppi,h.range=c(1e-60,1e-20))
#Plot the predicted PPI with the default settings and return
#the coordinates of the vertices
set.seed(12)
coordinates <- plot(ppi, return.coordinates=TRUE)
#Plot the predicted PPI and show each underlying reference interaction.
#Use different species specific colors. To compare both graphs,
#use the coordinates computed before
plot(ppi,multiple.edges=TRUE,vertices.coordinates=coordinates)
#Plot the corresponding hybrid network with predefined species colors.
#Also define some labels for the proteins of the target species.
#Keep in mind: You can not use the data in "coordinates" since
#the hybrid network consists of more vertices than the default PPI
set.seed(40)
target.labels<-c("B2AE79"="PaTOR","B2AXK6"="PaATG1",
"B2AUW3"="PaATG17","B2AM44"="PaATG11",
"B2AQV0"="PaATG13","B2B5M3"="PaVAC8")
species.colors <- c("5145"="red","9606"="blue","559292"="green")
plot(ppi,type="hybrid",species.colors=species.colors,
protein.labels=target.labels)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(Path2PPI)
Loading required package: igraph
Attaching package: 'igraph'
The following objects are masked from 'package:stats':
decompose, spectrum
The following object is masked from 'package:base':
union
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/Path2PPI/plot.Path2PPI.Rd_%03d_medium.png", width=480, height=480)
> ### Name: plot.Path2PPI
> ### Title: Plots the predicted PPI
> ### Aliases: plot.Path2PPI
>
> ### ** Examples
>
> data(ai) #Load test data set
>
> ppi <- Path2PPI("Autophagy induction", "Podospora anserina", "5145")
> ppi <- addReference(ppi, "Homo sapiens", "9606", human.ai.proteins,
+ human.ai.irefindex, pa2human.ai.homologs)
Search for all relevant interactions:
0%--25%--50%--75%--100%
Remove irrelevant homologs.
> ppi <- addReference(ppi, "Saccharomyces cerevisiae (S288c)", "559292",
+ yeast.ai.proteins, yeast.ai.irefindex,
+ pa2yeast.ai.homologs)
Search for all relevant interactions:
0%--25%--50%--75%--100%
Remove irrelevant homologs.
>
> ppi <- predictPPI(ppi,h.range=c(1e-60,1e-20))
Begin with Homo sapiens
6 interactions processed. These lead to 5 interactions in target species.
-------------------------------
Begin with Saccharomyces cerevisiae (S288c)
15 interactions processed. These lead to 22 interactions in target species.
-------------------------------
Combine results to one single PPI.
A total of 13 putative interactions were predicted in target species.
>
> #Plot the predicted PPI with the default settings and return
> #the coordinates of the vertices
> set.seed(12)
> coordinates <- plot(ppi, return.coordinates=TRUE)
>
> #Plot the predicted PPI and show each underlying reference interaction.
> #Use different species specific colors. To compare both graphs,
> #use the coordinates computed before
> plot(ppi,multiple.edges=TRUE,vertices.coordinates=coordinates)
>
> #Plot the corresponding hybrid network with predefined species colors.
> #Also define some labels for the proteins of the target species.
> #Keep in mind: You can not use the data in "coordinates" since
> #the hybrid network consists of more vertices than the default PPI
> set.seed(40)
> target.labels<-c("B2AE79"="PaTOR","B2AXK6"="PaATG1",
+ "B2AUW3"="PaATG17","B2AM44"="PaATG11",
+ "B2AQV0"="PaATG13","B2B5M3"="PaVAC8")
> species.colors <- c("5145"="red","9606"="blue","559292"="green")
> plot(ppi,type="hybrid",species.colors=species.colors,
+ protein.labels=target.labels)
>
>
>
>
>
> dev.off()
null device
1
>