Learn R Programming

gaston (version 1.2)

select.snps: Subsetting from a bed.matrix

Description

Return subset of SNPs satisfying a condition.

Usage

select.snps(x, condition)

Arguments

Value

A bed.matrix similar to x, containing the selected SNPs only

Details

The conditions can involve global variables, and all variables defined in the data frame x@snps, that is
  • chr,id,dist,pos,A1,A2
  • If basic stats have been computed (seeset.stats),N0,N1,N2,NAs,callrate,maf,hz.
  • If Hardy-Weinberg Equilibrium test has been performed (seeset.hwe),hwe.

See Also

select.snps, set.stats, set.hwe

Examples

Run this code
# Load data
data(LCT)
x <- as.bed.matrix(LCT.gen, LCT.fam, LCT.bim)
x <- set.stats(x)

# Select SNPs with a maf > 5%
y <- select.snps(x, maf > 0.05)
y

Run the code above in your browser using DataLab