select.snps | R Documentation |
bed.matrix
Returns subset of SNPs satisfying a condition.
select.snps(x, condition)
x |
A |
condition |
Condition used to select SNPs |
The conditions can involve global variables and all variables defined
in the data frame x@snps
, in particular
chr
, id
, dist
, pos
, A1
, A2
If basic stats have been computed (see set.stats
), N0
, N1
, N2
, NAs
, callrate
, maf
, hz
, etc.
If Hardy-Weinberg Equilibrium test has been performed (see set.hwe
), hwe
.
If some condition evaluate to NA
(e.g. maf > 0
when maf
is undefined for some SNPs),
a warning is issued and the corresponding SNPs are removed.
A bed.matrix
similar to x
, containing the selected SNPs only
Hervé Perdry and Claire Dandine-Roulland
select.snps
, set.stats
, set.hwe
# Load data
data(LCT)
x <- as.bed.matrix(LCT.gen, LCT.fam, LCT.bim)
# Select SNPs with a maf > 5%
y <- select.snps(x, maf > 0.05)
y
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.