| fst_genoprob | R Documentation |
Save an R/qtl2 genotype probabilities object to a set of fst files for fast access with reduced memory usage.
fst_genoprob(
genoprob,
fbase,
fdir = ".",
compress = 0,
verbose = TRUE,
overwrite = FALSE,
quiet = !verbose
)
genoprob |
Object of class |
fbase |
Base of filename for fst database. |
fdir |
Directory for fst database. |
compress |
Amount of compression to use (value in the range 0-100; lower values mean larger file sizes) |
verbose |
Opposite of |
overwrite |
If FALSE (the default), refuse to overwrite any files that already exist. |
quiet |
If FALSE (the default), show messages about fst database creation. |
The genotype probabilities are stored in separate databases for each chromosome
as tables of (indivduals*genotypes) x (positions) in directory fst.
The dim, dimnames and is_x_chr elements of the object
have information about the entire fst database.
If a fst_genoprob object is a subset of another such object,
the chr, ind, and mar contain information about what is in the subset.
However, the fst databases are not altered in a subset, and can be restored by
fst_restore(). The actual elements of an "fst_genoprob"
object are only accessible to the user after a call to unclass(); instead
the usual access to elements of the object invoke subset.fst_genoprob().
A list containing the attributes of genoprob
and the address for the created fst database.
Components are:
dim - List of all dimensions of 3-D arrays.
dimnames - List of all dimension names of 3-D arrays.
is_x_chr - Vector of all is_x_chr attributes.
chr - Vector of (subset of) chromosome names for this object.
ind - Vector of (subset of) individual names for this object.
mar - Vector of (subset of) marker names for this object.
fst - Path and base of file names for the fst database.
fst_genoprob(): Deprecated version (to be deleted)
fst_path(), fst_extract(), fst_files(), replace_path(), fst_restore()
library(qtl2)
grav2 <- read_cross2(system.file("extdata", "grav2.zip", package="qtl2"))
map <- insert_pseudomarkers(grav2$gmap, step=1)
probs <- calc_genoprob(grav2, map, error_prob=0.002)
dir <- tempdir()
fprobs <- fst_genoprob(probs, "grav2", dir, overwrite=TRUE)
# clean up: remove all the files we created
unlink(fst_files(fprobs))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.