Learn R Programming

GenoPop (version 1.0.0)

separateByPopulations: Separate Genotype Matrix by Populations

Description

This function separates a genotype matrix into two data frames based on population assignments. It's designed to work with the batches or windows processed by process_vcf_in_batches and process_vcf_in_windows.

Usage

separateByPopulations(
  sep_gt,
  pop1_names,
  pop2_names,
  ploidy = 2,
  rm_ref_alleles = TRUE
)

Value

A list containing two data frames, one for each population.

Arguments

sep_gt

A genotype matrix similar to the @sep_gt slot of a vcfR object.

pop1_names

A character vector of individual names for the first population.

pop2_names

A character vector of individual names for the second population.

rm_ref_alleles

Logical, whether variants that only have the reference allele should be removed from the respective subpopulations data frame. (Default = TRUE)