sim_filter_generated_data: This function filters the generated gamete data so that the...

View source: R/sim_filter_generated_data.R

sim_filter_generated_dataR Documentation

This function filters the generated gamete data so that the sparse input data only reflects heterozygous SNPs

Description

This function is used to filter the generated data such that the sparse gamete data only reflects heterozygous SNPs (one 0 and one 1) Then we only keep these SNP indices for the full gamete data and the diploid donor haplotypes Further, if de novo mutations were simulated, we filter the list of DNM locations to reflect those that weren't filtered out. However, we don't return the filtered dnm list, we just output it as a message

Usage

sim_filter_generated_data(
  gam_na_df,
  gam_full_df,
  donor_haps,
  new_rows,
  add_de_novo_mut
)

Arguments

gam_na_df

the generated, sparsified gamete data with SNP indices in the first column

gam_full_df

the generated full gamete data with SNP indices in the first column

donor_haps

the generated diploid donor phased haplotypes

new_rows

a vector of the integer SNP indices for where de novo mutation were added if DNMs were simulated, this should be NULL otherwise

add_de_novo_mut

a bool, if TRUE de novo mutations were simulated in the generative model and then new_rows is also filtered

Value

out a named list with the filtered gam_na_df, filtered gam_full_df, filtered donor_haps, new number of snps after filtering num_snps


mccoy-lab/rhapsodi documentation built on July 27, 2022, 3:56 a.m.