xSNP2nGenes | R Documentation |
xSNP2nGenes
is supposed to define nearby genes given a list of
SNPs within certain distance window. The distance weight is calcualted
as a decaying function of the gene-to-SNP distance.
xSNP2nGenes(data, distance.max = 2e+05, decay.kernel = c("slow", "linear", "rapid"), decay.exponent = 2, GR.SNP = "dbSNP_GWAS", GR.Gene = "UCSC_genes", verbose = T, RData.location = "https://github.com/hfang-bristol/RDataCentre/blob/master/Portal")
data |
a input vector containing SNPs |
distance.max |
the maximum distance between genes and SNPs. Only those genes no far way from this distance will be considered as seed genes. This parameter will influence the distance-component weights calculated for nearby SNPs per gene |
decay.kernel |
a character specifying a decay kernel function. It can be one of 'slow' for slow decay, 'linear' for linear decay, and 'rapid' for rapid decay |
decay.exponent |
a numeric specifying a decay exponent. By default, it sets to 2 |
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 |
a data frame with following columns:
Gene
: nearby genes
SNP
: SNPs
Dist
: the genomic distance between the gene and the SNP
Weight
: the distance weight based on the gnomic distance
For details on the decay kernels, please refer to
xVisKernels
xRDataLoader
, xVisKernels
## Not run: # Load the library library(Pi) library(GenomicRanges) # a) provide the SNPs with the significance info ## get lead SNPs reported in AS GWAS and their significance info (p-values) AS <- read.delim(file.path(path.package("Pi"),"AS.txt"), stringsAsFactors=FALSE) # b) define nearby genes df_nGenes <- xSNP2nGenes(data=AS$SNP, distance.max=200000, decay.kernel="slow", decay.exponent=2, RData.location=RData.location) ## End(Not run)