simulateMOI: Simple simulation of MOI SNV data

Description Usage Arguments Value

View source: R/simple_moi_simulation.R

Description

Generate read count data in support of SNVs partioned by mixtures of clones within a host. This is done by setting true clonal mixture proportions and the underlying sampling probabilities for each clone. Then a random sample of underlying SNV probabilities is sampled from either a rbeta or rtexp distrubition with given parameters and read counts are generated by bionimial conditonal on the underlying SNV probability with the clone sampling probabilities.

Usage

1
2
3
4
5
6
7
8
9
simulateMOI(
  n.samples,
  n.snps,
  moi,
  mean_coverage,
  error_coverage,
  pi.true = NULL,
  mu.true = NULL
)

Arguments

n.samples

number of infected hosts in population

n.snps

number of SNPs observed

moi

number of clonal infections

mean_coverage

average coverage of reads

error_coverage

deviation in coverage of reads

pi.true

optional matrix of true mixture proportions

mu.true

optional matrix of true mixture components

Value

A list containing the following elements pi.true an n.samples by moi matrix containing true clonal proportions mu.true an n.samplps by moi matrix containing true genotype proportions aaf an n.snps vector of under SNV probabilities read.counts an n.samples by n.snps matrix containing read counts supporting each SNV error.counts an n.samples by n.snps matrix containing number of error reads


bahlolab/moimix documentation built on April 16, 2020, 8:40 a.m.