View source: R/sim_add_seq_error.R
sim_add_seq_error | R Documentation |
This function takes as input a matrix and carries over its inverted data to a vector and its original data to a second vector After subsetting for just non-NA locations, the number of available genotypes to change is multiplied by the sequencing error rate to find the number of bits to flip Then these number of random (non NA) indices are sampled and the inverted bit data is used to replace the original input data in these locations Finallly, this data with the introduced sequencing errors is reshaped to a matrix of equal dimension and size as the input and returned
sim_add_seq_error(num_snps, num_gametes, seqError_add, gam_mat_with_na)
num_snps |
an integer; the number of snps or the number of rows of the input and output |
num_gametes |
an integer; the number of gametes or the number of columns of the input and output |
seqError_add |
a numeric; the sequencing error rate |
gam_mat_with_na |
a matrix; the input sparsified gamete data with nrow of |
gam_mat_with_na a matrix; reflecting the input with num_bits_to_flip
inverted bits with nrow of num_snps
and ncol of num_gametes
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.