Checks a genlight object to see if it complies with dartR expectations and amends it to comply if necessary
Source:R/gl.compliance.check.r
gl.compliance.check.Rd
This function will check to see that the genlight object conforms to expectation in regard to dartR requirements (see details), and if it does not, will rectify it.
Details
A genlight object used by dartR has a number of requirements that allow functions within the package to operate correctly. The genlight object comprises:
The SNP genotypes or Tag Presence/Absence data (SilicoDArT);
An associated dataframe (gl@other$loc.metrics) containing the locus metrics (e.g. Call Rate, Repeatability, etc);
An associated dataframe (gl@other$ind.metrics) containing the individual/sample metrics (e.g. sex, latitude (=lat), longitude(=lon), etc);
A specimen identity field (indNames(gl)) with the unique labels applied to each individual/sample;
A population assignment (popNames) for each individual/specimen;
Flags that indicate whether or not calculable locus metrics have been updated.
Author
Custodian: Luis Mijangos – Post to https://groups.google.com/d/forum/dartr
Examples
x <- gl.compliance.check(testset.gl)
#> Starting gl.compliance.check
#> Processing genlight object with SNP data
#> Checking coding of SNPs
#> SNP data scored NA, 0, 1 or 2 confirmed
#> Checking locus metrics and flags
#> Recalculating locus metrics
#> Checking for monomorphic loci
#> Dataset contains monomorphic loci
#> Checking for loci with all missing data
#> No loci with all missing data detected
#> Checking whether individual names are unique.
#> Checking for individual metrics
#> Individual metrics confirmed
#> Checking for population assignments
#> Population assignments confirmed
#> Spelling of coordinates checked and changed if necessary to
#> lat/lon
#> Completed: gl.compliance.check
#>
x <- gl.compliance.check(testset.gs)
#> Starting gl.compliance.check
#> Processing genlight object with Presence/Absence (SilicoDArT) data
#> Checking coding of Tag P/A data
#> Tag P/A data (SilicoDArT) scored 1, 0 (present or
#> absent) confirmed
#> Checking locus metrics and flags
#> Recalculating locus metrics
#> Checking for monomorphic loci
#> Dataset contains monomorphic loci
#> Checking for loci with all missing data
#> No loci with all missing data detected
#> Checking whether individual names are unique.
#> Checking for individual metrics
#> Individual metrics confirmed
#> Checking for population assignments
#> Population assignments confirmed
#> Spelling of coordinates checked and changed if necessary to
#> lat/lon
#> Completed: gl.compliance.check
#>