If the condition A can be contaminated with reads from the condition B, its expected mean read number will be \((1-p)r_a + p r_b\), where \(p\) is cross-contamination rate and \(r_a,r_b\) are expected mean read numbers for conditions A and B, correspondingly.

contaminate(formulas, target_condition, contaminant_condition, coef_name)

Arguments

formulas

list, generated by MeanFormulas

target_condition

character; a condition, for which a new formulas is to be generated

contaminant_condition

character; a condition, which reads can contaminate fraction corresponding to target_condition

coef_name

character; the name of the cross-contamination rate

Value

unevaluated call, as from quote function

Examples

# NOT RUN {
forms <- MeanFormulas(A=r_a, B=r_b)
forms[["A"]] <- contaminate(forms, "A", "B", "p")
# }