This function computes the number of reference reads over multiple loci and for a single population.
numberReference(genotypes, indContribution, error)
a list with one entry per locus. Each of those entries is a matrix with the number of reference allele reads contributed by each individual. Each matrix row represents a different individual and each column is a different site.
is a list, where each entry corresponds to a different locus. Each entry should be a matrix containing the genotypes (coded as 0, 1 or 2). Each column of that matrix should be a different site and each row a different individual.
either a list or a matrix (that the function will convert to a list). Each list entry should be a matrix of individual contributions. Each row of that matrix is a different individual and each column is a different site. Thus, each entry of the matrix should contain the number of reads contributed by that individual at that particular site.
a numeric value with error rate associated with the sequencing and mapping process. This error rate is assumed to be symmetric: error(reference -> alternative) = error(alternative -> reference). This number should be between 0 and 1.
Note that this function will also work on a single locus, provided that the input is in the list format.