dcgerard / updog

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

Provide in-house Filtering Functions #10

Closed dcgerard closed 4 years ago

dcgerard commented 4 years ago

Right now, if you want to filter out SNPs with certain properties (too high bias, prop_mis, etc), then you need to do it manually. E.g.:

mout$snpdf <- mout$snpdf[mout$snpdf$prop_mis < 0.2, ]
mout$inddf <- mout$inddf[mout$inddf$snp %in% mout$snpdf$snp, ]

It would be nice to have built-in functions to jointly filter inddf and snpdf based on the values of the terms in snpdf. This would reduce the potential for errors on the part of the user. I am thinking of something along the same lines as the filter() function from dplyr. Say, call it filter_snp():

mout %>%
  filter_snp(prop_mis < 0.2) ->
  mout
dcgerard commented 4 years ago

Fixed by 2df4eb3eb5d1f03e74ef53725b65d9ee88decfe7