| gi2gl | R Documentation |
Converts a genind object (package adegenet) containing biallelic SNP data into a genlight object, retaining individual names, populations and the contents of the other slot.
gi2gl(gi, parallel = FALSE, verbose = NULL)
gi |
A genind object [required]. |
parallel |
Switch to deactivate parallel version. It might not be worth to run it parallel most of the times [default FALSE]. |
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]. |
Only diploid genind objects with at most two alleles per locus can be converted; loci with more than two alleles cannot be represented in a genlight object and raise a fatal error naming the offending loci.
Allele spellings are reconstructed from the genind allele names: each
locus receives loc.all of the form second/first allele of the
genind tab, so the 0/1/2 dosages and the allele pair are mutually
consistent. Be aware that due to ambiguity over which allele is the
reference, a combination of gi2gl(gl2gi(gl)) does not return an
identical object (loci can come back with the complementary dosage and
the reversed allele pair), but in terms of analysis the conversions
are equivalent.
A genlight object, with all slots filled.
Author(s): Bernd Gruber. Custodian: Bernd Gruber – Post to https://groups.google.com/d/forum/dartr
Other linker:
gl2bayesAss(),
gl2bayescan(),
gl2bpp(),
gl2demerelate(),
gl2eigenstrat(),
gl2faststructure(),
gl2gapit(),
gl2gds(),
gl2genalex(),
gl2genepop(),
gl2geno(),
gl2gi(),
gl2hapmap(),
gl2hiphop(),
gl2related(),
gl2snapper(),
gl2structure(),
gl2treemix(),
gl2vcf()
gi <- gl2gi(gl.filter.allna(testset.gl[1:20, 1:50], verbose = 0),
verbose = 0)
gl <- gi2gl(gi, verbose = 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.