xA2GraphML: Function to generate a graphml file from a pathway upon query

Description Usage Arguments Value Note See Also Examples

View source: R/xA2GraphML.r

Description

xA2GraphML is supposed to generate a graphml file from a pathway upon query. If data is provided, pathway gene members are color-coded.

Usage

1
2
3
4
5
6
7
8
9
xA2GraphML(data = NULL, query = "AA:hsa04672", curation = c("manual",
"automatic", "any"), node.label = "label", node.color = "lfc",
colormap = "deepskyblue-white-darkorange", ncolors = 64, nlegend = 11,
zlim = NULL, legend.title = "", title.thispath = NULL,
node.tooltip = "tooltip", node.highlight = "fdr",
node.highlight.cutoff = 0.05, edge.color = "#00000033", edge.width = 1,
color.gene = "#dddddd", color.thispath = "#bbbbbb",
color.otherpath = "#cccccc", filename = "xA2GraphML", verbose = TRUE,
RData.location = "http://galahad.well.ox.ac.uk/bigdata")

Arguments

data

a data frame

query

the identity of a pathway in query. The full list of pathways in human can be found at http://www.genome.jp/kegg-bin/show_organism?menu_type=pathway_maps&org=hsa. For example, 'AA:hsa04672' for 'NOD-like receptor signaling pathway', where the prefix 'AA:' can be ignored. Alternatively, it can be key words describing the pathway

curation

the type of curation. It can be one of "manual" (the manual one 'AA' followed by the semi-manual one 'AT'), "automatic" (only the automatic one) or "any" (first the manual one then the automatic one)

node.label

a character specifying which column used for node labelling. By default, it is 'label'

node.color

a character specifying which column used for node coloring. By default, it is 'lfc'

colormap

short name for the colormap. It can be one of "jet" (jet colormap), "bwr" (blue-white-red colormap), "gbr" (green-black-red colormap), "wyr" (white-yellow-red colormap), "br" (black-red colormap), "yr" (yellow-red colormap), "wb" (white-black colormap), "rainbow" (rainbow colormap, that is, red-yellow-green-cyan-blue-magenta), and "ggplot2" (emulating ggplot2 default color palette). Alternatively, any hyphen-separated HTML color names, e.g. "lightyellow-orange" (by default), "blue-black-yellow", "royalblue-white-sandybrown", "darkgreen-white-darkviolet". A list of standard color names can be found in http://html-color-codes.info/color-names

ncolors

the number of colors specified over the colormap

nlegend

the number of colors specified in the legend. By default, it is 11

zlim

the minimum and maximum z/patttern values for which colors should be plotted, defaulting to the range of the finite values of z. Each of the given colors will be used to color an equispaced interval of this range. The midpoints of the intervals cover the range, so that values just outside the range will be plotted

legend.title

the legend title. By default, it is ”

title.thispath

the appended title for this pathway. By default, it is NLULL

node.tooltip

a character specifying which column used for node tooltip. By default, it is 'tooltip'. If not found, it will be 'Symbol-Name-Color'

node.highlight

a character specifying which column used for node highlighting. By default, it is 'fdr'. If so, those highlighted will have bold and larger labels

node.highlight.cutoff

a numeric specifying the cutoff for node highlighting. By default, it is 0.05 meaninght those less than this cutoff will be highlighted

edge.color

a character specifying the edge colors. By default, it is '#00000033'

edge.width

the edge width. By default, it is 1

color.gene

a character specifying the gene node colors. By default, it is '#dddddd'

color.thispath

a character specifying the color for this pathway node. By default, it is '#bbbbbb'

color.otherpath

a character specifying the color for other pathway nodes. By default, it is '#cccccc'

filename

the without-extension part of the name of the output file. By default, it is 'xA2GraphML'

verbose

logical to indicate whether the messages will be displayed in the screen. By default, it sets to true for display

RData.location

the characters to tell the location of built-in RData files. See xRDataLoader for details

Value

invisible (a string storing graphml-formatted content). If the filename is not NULL, a graphml-formatted file is also output.

Note

none

See Also

xA2GraphML

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Load the library
library(A2)
RData.location <- "http://galahad.well.ox.ac.uk/bigdata_dev/"


xA2GraphML(query="AA:hsa04630", RData.location=RData.location)

## load GWAS genes
GWAS_Gene <- xRDataLoader(RData.customised='GWAS_Gene',
RData.location=RData.location)
data <- GWAS_Gene %>% dplyr::filter(Odds_Ratio!='NULL' &
Disease_ID=='RA') %>% dplyr::transmute(label=Symbol,
lfc=log2(as.numeric(Odds_Ratio)), fdr=Pvalue) %>%
dplyr::group_by(label) %>% dplyr::summarise(lfc=max(lfc),
fdr=min(fdr))

## manual one (the same as curation='any')
xA2GraphML(data, query="AA:hsa04630", curation='manual',
node.label="label", node.color="lfc", node.highlight='fdr',
node.highlight.cutoff=5e-8, filename='xA2GraphML',
legend.title='log2(Odds ratio)', zlim=c(-1,1),
RData.location=RData.location)
## automatic one
xA2GraphML(data, query="AA:hsa04630", curation='automatic',
node.label="label", node.color="lfc", node.highlight='fdr',
node.highlight.cutoff=5e-8, filename='xA2GraphML',
legend.title='log2(Odds ratio)', zlim=c(-1,1),
RData.location=RData.location)

## key words 
xA2GraphML(data, query="Asthma", curation='any', node.label="label",
node.color="lfc", node.highlight='fdr', node.highlight.cutoff=5e-8,
filename='xA2GraphML', RData.location=RData.location,
legend.title='log2(Odds ratio)', zlim=c(-1,1))

A2 documentation built on May 2, 2019, 5 p.m.

Related to xA2GraphML in A2...