dcgerard / updog

Flexible Genotyping of Polyploids using Next Generation Sequencing Data
https://dcgerard.github.io/updog/
24 stars 8 forks source link

Add option to return either NA or the modal prior genotype for 0 read individuals #8

Closed dcgerard closed 4 years ago

dcgerard commented 4 years ago

Updog currently returns the modal prior genotype for individuals with 0 reads. For individuals with NA it returns NA.

It would be best if these types of data return the same results. We should allow the user to choose how we genotype missing individuals --- either by returning NA or the modal prior genotype. There are advantages to both, but consistency is important.

library(updog)

temp <- flexdog(refvec = c(2, 2, 0, 0, 1, 0, 0), sizevec = c(4, 4, 4, 4, 4, 0, NA), ploidy = 2)
temp$geno
temp$gene_dist

temp <- flexdog(refvec = c(2, 0, 0, 0, 1, 0, 0), sizevec = c(4, 4, 4, 4, 4, 0, NA), ploidy = 2)
temp$geno
temp$gene_dist
dcgerard commented 4 years ago

I've actually decided that I like this behavior. It allows researchers to be explicit on how they want to treat missing data.