Learn R Programming

snpEnrichment (version 1.0-0)

initFiles: Initialize files for enrichment analysis

Description

initFiles create several files needed to run readEnrichment. ".ld", ".frq", ".signal" are created with PLINK. initFiles allow the user to run or not the LD computation with PLINK. LD computation can be run with a new execution of initFiles or with writeLD. When all files are created, this function is not needed anymore. Except if PLINK files (*.bed, *.bim and *.fam) or signalFile has changed.

Usage

initFiles(pattern = "Chrom", snpInfoDir, signalFile, 
          ldThresh = 0.8, LD = FALSE, 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).
snpInfoDir
[character]: character string naming a directory containing the reference data in a PLINK format (*.bed, *.bim and *.fam).
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
ldThresh
[numeric]: threshold value for LD calculation (PLINK).
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.
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

  • This function writes several files (".ld", ".frq", ".signal" and ".all"), in the snpInfoDir directory, nothing else is returned. These files are used to build an Enrichment object by readEnrichment in order to compute enrichment analysis (reSample).

See Also

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

Examples

Run this code
## Not run:
# snpInfoDir <- "./extdata/snpInfo/"
# signalFile <- "./extdata/Signal/toySignal.txt"
# initFiles(pattern = "Chrom", snpInfoDir, signalFile, 
#           ldThresh = 0.8, LD = FALSE, mc.cores = detectCores())
## End (Not run)

Run the code above in your browser using DataLab