dcgerard / updog

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

Missing Parental Data #21

Open dcgerard opened 2 years ago

dcgerard commented 2 years ago

I should allow parental data to be encoded as missing with NA rather than only accepting 0 counts.

Generate data

library(updog)
nsamp <- 191
genovec <- rgeno(n = nsamp, ploidy = 4, model = "f1", p1geno = 2, p2geno = 2)
sizevec <- rep(6, nsamp)
refvec <- rflexdog(sizevec = sizevec, 
                   geno = genovec, 
                   ploidy = 4, 
                   seq = 0.001, 
                   bias = 1, 
                   od = 0.001)

Errors if you give it NA

fout <- flexdog(refvec = refvec, 
                sizevec = sizevec, 
                ploidy = 4, 
                model = "f1",
                p1ref = NA, 
                p1size = NA)

OK if you have 0 ref and 0 size.

fout <- flexdog(refvec = refvec, 
                sizevec = sizevec, 
                ploidy = 4, 
                model = "f1",
                p1ref = 0, 
                p1size = 0)
plot(fout)