Learn R Programming

snpEnrichment (version 1.1-3)

readEnrichment: Read and create EnrichmentRatio object

Description

Read files created by initFiles and create an Enrichment object.

Usage

readEnrichment(pattern = "Chrom", signalFile, 
               transcriptFile = "FALSE", snpListDir, 
               snpInfoDir, distThresh = 1000, 
               sigThresh = 0.05, LD = "FALSE", 
               extendMethod = "ld", mc.cores = detectCores())

Arguments

pattern
[character]: character string containing a expression to be matched with all chromosomes files (e.g."Chrom" for files which start by "Chrom" followed by the chromosome number).
signalFile
[character]: the name of the signal file which the data are to be read from (2 columns: "SNP" and "PVALUE"). Each row of the table appears as one line of the file. If it does not contain an _absolute_ path, the file name is _re
transcriptFile
[character or data.frame]: character string naming a file or a data.frame with four columns: Chromomosome, trancript's name, Starting and Ending positions. data(trancript) can be use as parameters. Default is FALSE
snpListDir
[character]: character string naming a directory containing a list of SNPs for each chromosomes.
snpInfoDir
[character]: character string naming a directory containing the reference data in a PLINK format (*.bed, *.bim and *.fam).
distThresh
[numeric]: maximal distance (kb) between SNP and gene. distThresh is used if transcriptFile is set.
sigThresh
[numeric]: statistical threshold for signal (e.g. sigThresh = 0.05 for a given GWAS signal) used to compute an Enrichment Ratio.
LD
[logical]: LD=TRUE (default is FALSE) compute LD with PLINK. Note that, this setting can increase the computation's time, depending on number of SNPs in the signal file.
extendMethod
[character]: character string naming the method to be used to extend the list of eSNPs. Default is "ld", the list of eSNPs is extended with all SNPs in LD (r^2 threshold, defined in initFiles). O
mc.cores
[numeric]: The number of cores to use, i.e. at most how many child processes will be run simultaneously. The option is initialized with detectCores. Must be at least one, and parallelization requires at least two cores.

Value

  • Return an object of class Enrichment partly filled.

See Also

Overview : snpEnrichment-package Classes : Enrichment, Chromosome, SNP Methods : plot, reSample, excludeSNP, compareEnrichment, enrichment, is.enrichment, chromosome, is.chromosome Functions : initFiles, writeLD, readEnrichment

Examples

Run this code
## Not run:
# snpListDir <- "./extData/List/"
# signalFile <- "./extData/Signal/toySignal.txt"
# excludeFile <- "./extData/Exclude/toyExclude.txt"
# snpInfoDir <- "./extData/snpInfo/"
# data(transcript)
# transcriptFile <- transcript

# toy_M1 <- readEnrichment(pattern = "Chrom", signalFile, 
#                          transcriptFile, snpListDir, 
#                          snpInfoDir, distThresh = 1000, 
#                          sigThresh = 0.05, LD = "FALSE", 
#                          extendMethod = "ld", 
#                          mc.cores = detectCores())
# toy_M1
## End (Not run)

Run the code above in your browser using DataLab