This functions checks that all SNPs in a chromosome are adjacent in the loci
table, and that positions (and, unless ignore_genetic_dist = TRUE,
genetic distances) are sorted within chromosomes. Missing positions (or
missing genetic distances, if they are checked) are an error, as the order
of those loci is unknown.
Usage
is_loci_table_ordered(
.x,
error_on_false = FALSE,
ignore_genetic_dist = TRUE,
...
)
# S3 method for class 'tbl_df'
is_loci_table_ordered(
.x,
error_on_false = FALSE,
ignore_genetic_dist = TRUE,
...
)
# S3 method for class 'vctrs_bigSNP'
is_loci_table_ordered(
.x,
error_on_false = FALSE,
ignore_genetic_dist = TRUE,
...
)Arguments
- .x
a vector of class
vctrs_bigSNP(usually thegenotypecolumn of agen_tibbleobject), or agen_tibble.- error_on_false
logical, if
TRUEan error is thrown if the loci are not ordered.- ignore_genetic_dist
logical, if
TRUE(the default) only the positions are checked, and genetic distances are ignored (they can then be missing).- ...
other arguments passed to specific methods.
Examples
example_gt <- load_example_gt("gen_tbl")
example_gt %>% is_loci_table_ordered()
#> [1] TRUE
