LDparallel: Calculate Pairwise Linkage Disequilibrium with Multiple...

Description Usage Arguments Details Value References Examples

View source: R/LDparallel.R

Description

Performs calculation of pairwise linkage disequilibrium for a number of SNPs on multiple CPU cores using the package genetics. This function is deprecated, used of the r2fast function of GenABEL is recommended (and much faster).

Usage

1
2
LDparallel(g, num.processes, ...)
LDparallel.genotype(g1, g2, ...)

Arguments

g

list. Has to contain genotype objects. Each list element represents a SNP with its associated genotypes.

num.processes

integer. The number of parallel processes to use. Defaults to the number of cores.

g1

object(genotype). Contains all genotypes for a SNP.

g2

object(genotype). Second SNP, like g1.

...

Arguments passed to the 'genetics' LD function

Details

This function offers thread-parallel calculation of linkage disequilibrium for a list of genotypes. The returned matrix of r-square correlation values is symmetric since LD(snp1, snp2) == LD(snp2, snp1). Uses a number of cores as determined by the multicore:::detectCores() and distributes (non-symmetric) SNP pairs evenly on them. The LDparallel.genotype is basically a copy of the original function LD.genotype from the package genetics but does not return P and chi^2.

Value

A matrix containing r-square values (numeric datatype). Row and column names match the SNP names provided in parameter g.

References

http://cran.r-project.org/web/packages/genetics/index.html

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
genotypes <- getGenotypes(
               snps = c("rs13240", "rs2479", "rs8411", "rs35681"), 
               gts.source = system.file("extdata", "example.gwaa", package = "postgwas"), 
               return.genotypes = TRUE 
             )
if(any(installed.packages()[, "Package"] == "parallel") && Sys.info()[["sysname"]] == "Linux") {
  LDparallel(genotypes)
} else {
  cat("Error: Mandatory package 'parallel' not installed or not supported by operating system.\n")
}

merns/postgwas documentation built on May 22, 2017, 4:16 a.m.