Learn R Programming

snpEnrichment (version 1.2-3)

writeLD: Linkage Disequilibrium (LD) computation with PLINK

Description

writeLD write a '.ld' file for each chromosomes which contains the LD (r^2).

Usage

writeLD(pattern = "Chrom", snpInfoDir, signalFile, ldDir = NULL, 
        ldThresh = 0.8, mc.cores = 1)

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
ldDir
[character]: character string naming a directory where the linkage Disequilibrium files should be written (default ldDir=NULL is in temporary directory).
ldThresh
[numeric]: threshold value for LD calculation (PLINK).
mc.cores
[numeric]: The number of cores to use (default is mc.cores=1), i.e. at most how many child processes will be run simultaneously. Must be at least one, and parallelization requires at least two cores.

Value

  • One ".ld" file per chromosome is returned by writeLD in snpInfoDir directory.

See Also

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

Examples

Run this code
signalFile <- system.file("extdata/Signal/toySignal.txt", 
                          package = "snpEnrichment")
snpInfoDir <- system.file("extdata/snpInfo", 
                          package = "snpEnrichment")
snpListDir <- system.file("extdata/List", 
                          package = "snpEnrichment")
writeLD(pattern = "Chrom", snpInfoDir, signalFile, ldDir = NULL, 
        ldThresh = 0.8, mc.cores = 1)

Run the code above in your browser using DataLab