perm_gs_by_pops {gscramble} | R Documentation |
Take the output of rearrange_genos and permute everyone by population
Description
This is done prior to assigning random genomic fragments of individuals in the sample to the founders of the GSP, to be dropped to the samples.
Usage
perm_gs_by_pops(GS, preserve_haplotypes = FALSE, preserve_individuals = FALSE)
Arguments
GS |
the tibble that is the output from rearrange_genos |
preserve_haplotypes |
If TRUE then the Geno data is assumed phased (first allele at an individual on one haplotype and second allele on the other) and those haplotypes are preserved in this permutation of genomic material amongst the founders. |
preserve_individuals |
If TRUE then whole individuals are permuted
around the data set and the two gene copies at each locus are randomly
permuted within each individual. If |
Value
Returns a list of the same format as the output of rearrange_genos
.
Plus one additional component. Each component of the return list is itself
an unnamed list with one component (makes it easier to use bind_rows
to
create a tibble of list columns from these). The components, once unlisted are:
-
G
: a matrix—the original genotype data matrix -
I
: the I_meta tibble -
M
: the M_meta tibble -
G_permed
: the genotype matrix after permutation.
Examples
# first get the output of rearrange_genos
RG <- rearrange_genos(Geno, I_meta, M_meta)
# then permute by the populations
PG <- perm_gs_by_pops(RG)