reindex_markers | R Documentation |
The data frame should be of the format of long_markers
.
This function will reset the values of AlleIdx and LocIdx in case
some markers (or some alleles) were removed. It also rescales the
allele frequencies to sum to one, and, of course, sorts the loci into
map order along the chromosomes.
reindex_markers(M)
M |
a data frame of markers. |
# subsample alleles from the long_markers data frame.
# Note, you would never subsample alleles like this but it
# helps to demonstrate the function.
set.seed(5); # for reproducibility
A_few_markers <- long_markers %>%
dplyr::sample_n(1000) %>% # subsample 4000 alleles
dplyr::group_by(Chrom, Locus) %>%
dplyr::mutate(NumAlle = dplyr::n()) %>%
dplyr::filter(NumAlle > 1) %>% # chuck out loci only one allele now...
dplyr::select(-NumAlle) # get rid of the NumAlle column we created
reindex_markers(A_few_markers) # then reindex them
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.