random.snps: Generate random SnpMatrix

Description Usage Arguments Details Examples

View source: R/indata.R

Description

This function is purely for testing purposes. It can generate SnpMatrix objects which contain more than 2^31-1 elements.

Usage

1
random.snps(nrows, ncols)

Arguments

nrows

The number of rows to be generated

ncols

The number of columns to be generated

Details

All SNPs should be in Hardy-Weinberg equilibrium with an allele frequency of 0.5.

Note that, although the total number of elements can exceed 2^31-1, the numbers of rows and columns are still subject to this limit.

Examples

1
2
x <- random.snps(100,10)
col.summary(x)

Example output

Loading required package: survival
Loading required package: Matrix
      Calls Call.rate Certain.calls   RAF   MAF P.AA P.AB P.BB        z.HWE
Snp1    100         1             1 0.510 0.490 0.24 0.50 0.26  0.004001601
Snp2    100         1             1 0.450 0.450 0.29 0.52 0.19  0.505050505
Snp3    100         1             1 0.505 0.495 0.28 0.43 0.29 -1.399139914
Snp4    100         1             1 0.505 0.495 0.26 0.47 0.27 -0.599059906
Snp5    100         1             1 0.470 0.470 0.28 0.50 0.22  0.036130068
Snp6    100         1             1 0.480 0.480 0.29 0.46 0.25 -0.785256410
Snp7    100         1             1 0.495 0.495 0.24 0.53 0.23  0.601060106
Snp8    100         1             1 0.510 0.490 0.22 0.54 0.24  0.804321729
Snp9    100         1             1 0.445 0.445 0.29 0.53 0.18  0.729830955
Snp10   100         1             1 0.505 0.495 0.26 0.47 0.27 -0.599059906

snpStats documentation built on Nov. 8, 2020, 10:59 p.m.