rbind.fst_genoprob: Join genotype probabilities for different individuals

View source: R/rbind_fst_genoprob.R

rbind.fst_genoprobR Documentation

Join genotype probabilities for different individuals

Description

Join multiple genotype probability objects, as produced by fst_genoprob() for different individuals.

Usage

## S3 method for class 'fst_genoprob'
rbind(..., fbase = NULL, fdir = NULL, overwrite = FALSE, quiet = FALSE)

Arguments

...

Genotype probability objects as produced by fst_genoprob(). Must have the same set of markers and genotypes.

fbase

Base of fileame for fst database. Needed if objects have different fst databases.

fdir

Directory for fst database.

overwrite

If FALSE (the default), refuse to overwrite existing .fst files

quiet

If TRUE, don't show any messages. Passed to fst_genoprob().

Value

A single genotype probability object.

See Also

cbind.fst_genoprob()

Examples

library(qtl2)
grav2 <- read_cross2(system.file("extdata", "grav2.zip", package="qtl2"))
map <- insert_pseudomarkers(grav2$gmap, step=1)
probsA <- calc_genoprob(grav2[1:5,], map, error_prob=0.002)
probsB <- calc_genoprob(grav2[6:12,], map, error_prob=0.002)
dir <- tempdir()
fprobsA <- fst_genoprob(probsA, "exampleAr", dir, overwrite=TRUE)
fprobsB <- fst_genoprob(probsB, "exampleBr", dir, overwrite=TRUE)

# use rbind to combine probabilities for same chromosomes but different individuals
fprobs <- rbind(fprobsA, fprobsB, fbase = "exampleABr")

# clean up: remove all the files we created
unlink(fst_files(fprobsA))
unlink(fst_files(fprobsB))
unlink(fst_files(fprobs))


kbroman/qtl2fst documentation built on May 3, 2023, 11:12 a.m.