nQuire: a statistical framework for ploidy estimation using next generation sequencing