subset_fst_genoprob: Subsetting genotype probabilities

Description Usage Arguments Value Examples

View source: R/subset_fst_genoprob.R

Description

Pull out a specified set of individuals and/or chromosomes from the results of fst_genoprob().

Usage

1
2
3
4
subset_fst_genoprob(x, ind = NULL, chr = NULL, mar = NULL, ...)

## S3 method for class 'fst_genoprob'
subset(x, ind = NULL, chr = NULL, mar = NULL, ...)

Arguments

x

Genotype probabilities as output from fst_genoprob().

ind

A vector of individuals: numeric indices, logical values, or character string IDs

chr

A vector of chromosomes: logical values, or character string IDs. Numbers are interpreted as character string IDs.

mar

A vector of marker names as character string IDs.

...

Ignored.

Value

The input genotype probabilities, with the selected individuals and/or chromsomes.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(qtl2)
grav2 <- read_cross2(system.file("extdata", "grav2.zip", package="qtl2"))

pr <- calc_genoprob(grav2)
dir <- tempdir()
fpr <- fst_genoprob(pr, "grav2", dir)

# keep just individuals 1:5, chromosome 2
prsub <- fpr[1:5,2]
# keep just chromosome 2
prsub2 <- fpr[,2]

# clean up: remove all the files we created
unlink(fst_files(fpr))

qtl2fst documentation built on Oct. 7, 2021, 5:09 p.m.