r2fast: Estimates r2 between multiple markers

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Given a set of SNPs, computes a matrix of r2

Usage

1
r2fast(data, snpsubset, cross.snpsubset, idsubset)

Arguments

data

object of snp.data-class

snpsubset

Index, character or logical vector with subset of SNPs to run analysis on. If missing, all SNPs from data are used for analysis.

cross.snpsubset

Parameter allowing parallel implementation. Not to be used normally. If supplied together with snpsubset, the r2 for all pairs between snpsubset and cross.snpsubset computed.

idsubset

Index, character or logical vector with subset of IDs to run analysis on. If missing, all people from data are used for analysis.

Details

The function is based on slightly modified code of Hao et al.

Value

A (Nsnps X Nsnps) matrix giving r2 values between a pairs of SNPs above the diagonal and number of SNP genotype measured for both SNPs below the diagonal

Author(s)

Yurii Aulchenko

References

Hao K, Di X, Cawley S. (2006) LdCompare: rapid computation of single- and multiple-marker r2 and genetic coverage. Bioinformatics, 23: 252-254.

See Also

rhofast

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
require(GenABEL.data)
data(ge03d2)
# r2s using r2fast
a <- r2fast(ge03d2,snps=c(1:10))
## Not run: 
library(genetics)
# r2s using package genetics
b <- LD(as.genotype(ge03d2[,1:10]))$"R^2"
# see that the r2s are not exactly the same
cor(a[upper.tri(a)],b[upper.tri(b)])
plot(a[upper.tri(a)],b[upper.tri(b)])

## End(Not run)

Example output

Loading required package: MASS
Loading required package: GenABEL.data
Warning message:
In r2fast(ge03d2, snps = c(1:10)) : X-chromosome data dropped
Loading required package: combinat

Attaching package: 'combinat'

The following object is masked from 'package:utils':

    combn

Loading required package: gdata
sh: 1: cannot create /dev/null: Permission denied
gdata: Unable to locate valid perl interpreter
gdata: 
gdata: read.xls() will be unable to read Excel XLS and XLSX files
gdata: unless the 'perl=' argument is used to specify the location of a
gdata: valid perl intrpreter.
gdata: 
gdata: (To avoid display of this message in the future, please ensure
gdata: perl is installed and available on the executable search path.)
sh: 1: cannot create /dev/null: Permission denied
gdata: Unable to load perl libaries needed by read.xls()
gdata: to support 'XLX' (Excel 97-2004) files.

gdata: Unable to load perl libaries needed by read.xls()
gdata: to support 'XLSX' (Excel 2007+) files.

gdata: Run the function 'installXLSXsupport()'
gdata: to automatically download and install the perl
gdata: libaries needed to support Excel XLS and XLSX formats.

Attaching package: 'gdata'

The following object is masked from 'package:stats':

    nobs

The following object is masked from 'package:utils':

    object.size

The following object is masked from 'package:base':

    startsWith

Loading required package: gtools
Loading required package: mvtnorm


NOTE: THIS PACKAGE IS NOW OBSOLETE.



  The R-Genetics project has developed an set of enhanced genetics

  packages to replace 'genetics'. Please visit the project homepage

  at http://rgenetics.org for informtion.




Attaching package: 'genetics'

The following object is masked from 'package:GenABEL':

    as.genotype

The following objects are masked from 'package:base':

    %in%, as.factor, order

[1] 0.9919542

GenABEL documentation built on May 30, 2017, 3:36 a.m.

Related to r2fast in GenABEL...