xCircosR Documentation

Function to visualise a network as a circos plot

Description

xCircos is used to visualise a network as a circos plot. The network must be a 'igraph' object.

Usage

xCircos(g, entity = c("SNP", "Gene"), top_num = 50, ideogram = T,
chr.exclude = "auto", entity.label.cex = 0.8, GR.SNP = "dbSNP_GWAS",
GR.Gene = "UCSC_genes", verbose = T,
RData.location =
"https://github.com/hfang-bristol/RDataCentre/blob/master/Portal")

Arguments

g

an object of class "igraph". For example, it stores semantic similarity results with nodes for genes/SNPs and edges for pair-wise semantic similarity between them

entity

the entity of similarity analysis for which results are being plotted. It can be either "SNP" or "Gene"

top_num

the top number of similarity edges to be plotted

ideogram

logical to indicate whether chromosome banding is plotted

chr.exclude

a character vector of chromosomes to exclude from the plot, e.g. c("chrX", "chrY"). By defautl, it is 'auto' meaning those chromosomes without data will be excluded. If NULL, no chromosome is excluded

entity.label.cex

the font size of genes/SNPs labels. Default is 0.8

GR.SNP

the genomic regions of SNPs. By default, it is 'dbSNP_GWAS', that is, SNPs from dbSNP (version 146) restricted to GWAS SNPs and their LD SNPs (hg19). It can be 'dbSNP_Common', that is, Common SNPs from dbSNP (version 146) plus GWAS SNPs and their LD SNPs (hg19). Alternatively, the user can specify the customised input. To do so, first save your RData file (containing an GR object) into your local computer, and make sure the GR object content names refer to dbSNP IDs. Then, tell "GR.SNP" with your RData file name (with or without extension), plus specify your file RData path in "RData.location"

GR.Gene

the genomic regions of genes. By default, it is 'UCSC_genes', that is, UCSC known canonical genes (together with genomic locations) based on human genome assembly hg19. Even the user can specify the customised input. To do so, first save your RData file (containing an GR object) into your local computer, and make sure the GR object content names refer to Gene Symbols. Then, tell "GR.Gene" with your RData file name (with or without extension), plus specify your file RData path in "RData.location"

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

a circos plot with edge weights between input snps/genes represented by the colour of the links

Note

none

See Also

xSocialiserGenes, xSocialiserSNPs

Examples

## Not run: 
# Load the library
library(XGR)
library(igraph)
library(RCircos)
library(GenomicRanges)

# provide genes and SNPs reported in AS GWAS studies
ImmunoBase <- xRDataLoader(RData.customised='ImmunoBase')

# 1) SNP-based similarity analysis using GWAS Catalog traits (mapped to EF)
## Get lead SNPs reported in AS GWAS
example.snps <- names(ImmunoBase$AS$variants)
SNP.g <- xSocialiserSNPs(example.snps, include.LD=NA)
# Circos plot of the EF-based SNP similarity network
#out.file <- "SNP_Circos.pdf"
#pdf(file=out.file, height=12, width=12, compress=TRUE)
xCircos(g=SNP.g, entity="SNP")
#dev.off()

# 2) Gene-based similarity analysis using Disease Ontology (DO)
## Get genes within 10kb away from AS GWAS lead SNPs
example.genes <- names(which(ImmunoBase$AS$genes_variants<=10000))
gene.g <- xSocialiserGenes(example.genes, ontology=c("DO")
# Circos plot of the DO-based gene similarity network
#out.file <- "Gene_Circos.pdf"
#pdf(file=out.file, height=12, width=12, compress=TRUE)
xCircos(g=gene.g, entity="Gene", chr.exclude="chrY")
#dev.off()

## End(Not run)