genoprob_to_alleleprob_fst {qtl2fst} | R Documentation |
Convert genotype probabilities to allele probabilities and write to fst database
Description
Reduce genotype probabilities (as calculated by
qtl2::calc_genoprob()
) to allele probabilities, writing them to an fst database.
Usage
genoprob_to_alleleprob_fst(
probs,
fbase,
fdir = ".",
quiet = TRUE,
cores = 1,
compress = 0,
overwrite = FALSE
)
Arguments
probs |
Genotype probabilities, as calculated from
|
fbase |
Base of filename for fst database. |
fdir |
Directory for fst database. |
quiet |
IF |
cores |
Number of CPU cores to use, for parallel calculations.
(If |
compress |
Amount of compression to use (value in the range 0-100; lower values mean larger file sizes) |
overwrite |
If FALSE (the default), refuse to overwrite any files that already exist. |
Details
This is like calling qtl2::genoprob_to_alleleprob()
and then
fst_genoprob()
, but in a way that hopefully saves memory by
doing it one chromosome at a time.
Value
Link to fst database for the probs
input with probabilities
collapsed to alleles rather than genotypes.
See Also
qtl2::genoprob_to_alleleprob()
, fst_genoprob()
Examples
library(qtl2)
iron <- read_cross2(system.file("extdata", "iron.zip", package="qtl2"))
gmap_w_pmar <- insert_pseudomarkers(iron$gmap, step=1)
# genotype probabilities
fst_dir <- file.path(tempdir(), "iron_genoprob")
dir.create(fst_dir)
probs_fst <- calc_genoprob_fst(iron, "iron", fst_dir, gmap_w_pmar, error_prob=0.002)
# allele probabilities
fst_dir_apr <- file.path(tempdir(), "iron_alleleprob")
dir.create(fst_dir_apr)
aprobs_fst <- genoprob_to_alleleprob_fst(probs_fst, "iron", fst_dir_apr)
# clean up: remove all the files we created
unlink(fst_files(probs_fst))
unlink(fst_files(aprobs_fst))