utils.fbm.decode: Decodes the whole genotype matrix, with a memory guard for...

View source: R/utils.fbm.export.r

utils.fbm.decodeR Documentation

Decodes the whole genotype matrix, with a memory guard for file-backed objects

Description

WARNING: UTILITY SCRIPTS ARE FOR INTERNAL USE ONLY AND SHOULD NOT BE USED BY END USERS AS THEIR USE OUT OF CONTEXT COULD LEAD TO UNPREDICTABLE OUTCOMES.

For functions whose algorithm needs the whole genotype matrix in memory. Returns as.matrix(x). For a gen-backed object nothing else happens. For a file-backed object the memory the matrix needs is estimated first (nInd(x) * nLoc(x) * bytes): it is reported at verbose >= 2, and if it exceeds getOption("dartR_fbm_max_decode_gb", 4) Gb the function stops with an informative error instead of exhausting memory. The limit can be raised, e.g. options(dartR_fbm_max_decode_gb = 16).

Usage

utils.fbm.decode(x, what = "this function", bytes = 8, copies = 1, verbose = 2)

Arguments

x

A dartR object [required].

what

Name of the calling function, for the messages [default "this function"].

bytes

Bytes per genotype of the matrix the caller works with (4 for integers, 8 for doubles) [default 8].

copies

Number of such matrices the caller holds at once [default 1].

verbose

Verbosity [default 2].

Value

The decoded genotype matrix, as as.matrix(x).

Author(s)

Custodian: Bernd Gruber – Post to https://groups.google.com/d/forum/dartr

See Also

Other utilities: gl.He(), gl.Ho(), gl.alf(), utils.allelic.richness(), utils.basic.stats(), utils.check.datatype(), utils.collapse.matrix(), utils.dart2genlight(), utils.dist.binary(), utils.fbm.amat(), utils.fbm.blocks(), utils.fbm.colblocks(), utils.fbm.colwise(), utils.fbm.copy(), utils.fbm.count.mean(), utils.fbm.grm(), utils.fbm.has(), utils.fbm.new(), utils.fbm.pair.counts(), utils.fbm.reader(), utils.fbm.rowwise(), utils.fbm.tempfile(), utils.flag.start(), utils.het.pop(), utils.history.call(), utils.is.fixed(), utils.jackknife(), utils.n.var.invariant(), utils.plot.save(), utils.read.fasta(), utils.read.ped(), utils.recalc.avgpic(), utils.recalc.callrate(), utils.recalc.freqhets(), utils.recalc.freqhomref(), utils.recalc.freqhomsnp(), utils.recalc.maf(), utils.reset.flags(), utils.transpose(), utils.vcf.depth(), utils.vcfr2genlight.polyploid()


dartR.base documentation built on Nov. 18, 2026, 9:06 a.m.