contAF takes as input a true allele frequency and then adjusted its based on the given normal contamination, to give the allele frequencies actually expected from the mixture of tumor and normal cells present. decontAF does the reverse, taking contaminated AF and calculating the true AF that is implied for the given normal contamination. errorAF gives the adjusted allele frequencies to account for sequencing error.
allAF returns all the possible allele frequencies for a variant, namely (0:totalCopy)/totalCopy. For type="mutation", only alleles from (1:totalCopy)/totalCopy are calculated, since the assumption is that mutated (relative to germline) regions by definition are not expected to be present at 0 copies in the tumor. For `allAF', `normCont' can be a vector, in which case all the allele frequencies are calculated for all the values of `normCont'; for the remaining functions, it must be a single value.
Only integer values of `totalCopy' are allowed.
`type' refers to the type of variant, relative to the normal. Namely, how many copies of the variant are in the normal. Therefore `mutation' implies 0 copies in the normal, `SNPHet' implies 1 copy in the normal, and `SNPHomo' implies variant is in every copy of the normal (which could be not equal to 2 if totalCopyNormal is not 2).
For the functions seqError, contAF, and decontAF, `totalCopy', `normCont',`totalCopyNormal', and `seqError' can be vectors of the same length as the input.