| gl.fbm2gen | R Documentation |
'gl.fbm2gen()' converts a 'dartR' whose genotypes live in the '@fbm' slot into a 'dartR' with genotypes in the '@gen' (list of SNPbin) slot. At the end, '@fbm' is set to 'NULL' and '@gen' holds the SNPbin list.
The conversion reads the FBM in **blocks of loci** (the order in which the
backing file is stored, so reading is fast) and packs each block directly
into the bits of the SNPbin objects; the full genotype matrix is never
decoded at once. The block size follows the bigstatsr option
bigstatsr.block.sizeGB (default 1): a block holds one sixteenth of
bigstatsr::block_size(nInd(x)) loci (at least 512). Beyond the
result itself, the conversion needs a few hundred Mb with the default
(about 370 Mb for 2,000 individuals x 200,000 loci); lower the option to
convert with less memory.
Genotypes must be 0, 1, 2 or missing (0 or 1 for haploid individuals); other values give an error.
gl.fbm2gen(x, chunk = NULL, quiet = TRUE, verbose = NULL)
x |
A 'dartR' or 'genlight' object. If it holds no FBM, it is returned unchanged. |
chunk |
Deprecated and ignored: the blocks are now blocks of loci
whose size follows |
quiet |
Logical; if 'TRUE', suppress the non-critical "no FBM found" message regardless of verbosity [default TRUE]. |
verbose |
Verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress log; 3, progress and results summary; 5, full report [default NULL, adopting the global verbosity set by gl.set.verbosity(), or 2 if no global is set]. |
A 'dartR' object with **'@gen' populated** and **'@fbm = NULL'**.
Author(s): Luis Mijangos. Custodian: Luis Mijangos – Post to https://groups.google.com/d/forum/dartr
gl.gen2fbm
Other data manipulation:
gl.add.indmetrics(),
gl.define.pop(),
gl.drop.ind(),
gl.drop.loc(),
gl.drop.pop(),
gl.edit.recode.pop(),
gl.fbm.cleanup(),
gl.gen2fbm(),
gl.impute(),
gl.join(),
gl.keep.ind(),
gl.keep.loc(),
gl.keep.pop(),
gl.make.recode.ind(),
gl.make.recode.pop(),
gl.merge.pop(),
gl.reassign.ind(),
gl.reassign.pop(),
gl.recode.ind(),
gl.recode.pop(),
gl.rename.pop(),
gl.sample(),
gl.sim.genotypes(),
gl.sort(),
gl.subsample.ind(),
gl.subsample.loc(),
gl.subsample.loci()
x <- gl.gen2fbm(testset.gl)
y <- gl.fbm2gen(x)
length(y@gen) # one SNPbin per individual
identical(as.matrix(y), as.matrix(testset.gl))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.