rearrange_genos {gscramble}R Documentation

rearrange genotypes into separate columns for each haplotype.

Description

This function first reorders individuals in the columns of the matrix so that every population is together. Then it rearranges genotypes into separate columns for each haplotype (or "halflotype" if they are unphased.) This prepares the matrix for different kinds of a permutation (within or between populations, for example).

Usage

rearrange_genos(G, Im, Mm)

Arguments

G

the genotype matrix (N rows and 2L columns)

Im

the meta data for the N samples.

Mm

the meta data for the L markers.

Details

It returns a list. One component is the matrix, another is the updated individual meta data, and the third is the marker meta data.

Value

Returns a list. 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:

Examples

RG <- rearrange_genos(Geno, I_meta, M_meta)

[Package gscramble version 1.0.1 Index]