Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

subset.mppData

Subset mppData object


Description

Pull out a specified set of markers and/or genotypes from a mppData object.

Usage

## S3 method for class 'mppData'
subset(x, mk.list = NULL, gen.list = NULL, ...)

Arguments

x

An object of class mppData.

mk.list

Optional character vector, numeric position vector or logical vector representing marker to keep. Default = NULL.

gen.list

Optional character vector, numeric position vector or logical vector representing genotypes to keep. Default = NULL.

...

Ignored.

Value

Return:

The mppData object but with only the specified subset of data.

Author(s)

Vincent Garin

Examples

### Marker subset

data(mppData)

# Random selection of markers
mk.list <-  sample(mppData$map[, 1], 50)
mppData_sub <- subset(x = mppData, mk.list = mk.list)

# Selection of chromosome 1 marker
mk.list <-  (mppData$map[, 2] == 1)
mppData_sub <- subset(x = mppData, mk.list = mk.list)

### Genotype subset

# Random selection of genotypes
gen.list <-  sample(mppData$geno.id, 200)
mppData_sub <- subset(x = mppData, gen.list = gen.list)

# Selection of genotype from cross 2 and 5
crosses <- unique(mppData$cross.ind)
gen.list <-  mppData$geno.id[mppData$cross.ind %in% crosses[c(2, 5)]]
mppData_sub <- subset(x = mppData, gen.list = gen.list)

### Marker and genotype subset

mk.list <-  sample(mppData$map[, 1], 50)
gen.list <-  sample(mppData$geno.id, 200)
mppData_sub <- subset(x = mppData, mk.list = mk.list,
gen.list = gen.list)

mppR

Multi-Parent Population QTL Analysis

v1.2.1
GPL-3
Authors
Vincent Garin [aut, cre], Valentin Wimmer [aut], Dietrich Borchardt [ctb, dtc], Fred van Eeuwijk [ctb, ths], Marcos Malosetti [ctb, ths]
Initial release
2020-02-10

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.