separateByPopulations: Separate Genotype Matrix by Populations

View source: R/convert_gt_data.R

separateByPopulationsR Documentation

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
)

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)

Value

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


GenoPop documentation built on April 3, 2025, 9:51 p.m.