View source: R/is_loci_table_ordered.R
find_duplicated_loci | R Documentation |
This function finds duplicated SNPs by checking the positions within each chromosome. It can return a list of duplicated SNPs or a logical value indicating whether there are any duplicated loci.
find_duplicated_loci(.x, error_on_false = FALSE, list_duplicates = TRUE, ...)
.x |
a vector of class |
error_on_false |
logical, if |
list_duplicates |
logical, if |
... |
other arguments passed to specific methods. |
if list_duplicates
is TRUE, returns a vector of duplicated loci.
If list_duplicates
is FALSE, returns a logical value indicating whether
there are any duplicated loci. If error_on_false
is TRUE and there are
duplicates, an error is thrown.
example_gt <- load_example_gt("gen_tbl")
show_loci(example_gt) <- test_loci <- data.frame(
big_index = c(1:6),
name = paste0("rs", 1:6),
chromosome = paste0("chr", c(1, 1, 1, 1, 1, 1)),
position = as.integer(c(3, 3, 5, 65, 343, 46)),
genetic_dist = as.double(rep(0, 6)),
allele_ref = c("A", "T", "C", "G", "C", "T"),
allele_alt = c("T", "C", NA, "C", "G", "A"),
chr_int = rep(1, 6)
)
show_loci(example_gt)
# Find which loci are duplicated
example_gt %>% find_duplicated_loci()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.