View source: R/gt_order_loci.R
gt_order_loci | R Documentation |
This function reorders the loci table so that positions within a chromosome
are sequential. It also re-saves the genotypes into a new file backed matrix
with the new order, so that it can be used by functions such as
loci_ld_clump()
and gt_pca_autoSVD()
. If the loci table is already
ordered, the original gen_tibble
is returned.
gt_order_loci(
.x,
use_current_table = FALSE,
ignore_genetic_dist = TRUE,
quiet = FALSE,
...
)
.x |
a |
use_current_table |
boolean, if FALSE (the default), the table will be reordered; if TRUE, then the current loci table, which might have been reordered manually, will be used, but only if the positions within each chromosome are sequential |
ignore_genetic_dist |
boolean to ignore the genetic distance when
checking. Note that, if |
quiet |
boolean to suppress information about the files |
... |
other arguments |
A gen_tibble
example_gt <- load_example_gt("gen_tbl") %>% select_loci(c(1, 5, 2, 6, 4, 3))
# Loci are in the wrong order
show_loci(example_gt)
# Reorder the loci, ignoring genetic distance
example_gt_ordered <- gt_order_loci(example_gt, ignore_genetic_dist = TRUE)
# Loci are now in the correct order
show_loci(example_gt_ordered)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.