KoslickiLab / mutation-rate-ci-calculator

This software calculates a confidence interval for the mutation rate from a set of observed containment indices under a simple nucleotide mutation process.
Other
7 stars 1 forks source link

Separate ci estimation into function; use argparse for argument parsing #3

Closed bluegenes closed 3 years ago

bluegenes commented 3 years ago

Hi folks,

I wanted to be able to estimate the confidence interval within python, rather than needing to run the full script on the command line. To facilitate this, I pulled the main estimation functionality into a function called compute_confidence_intervals.

I also replaced manual argument parsing with python's argparse module. While this constrains how you write the options a bit more, it prevents needing to update both the usage and the manual parsing in the case of argument changes, and minimizes the potential for manual parsing errors. Lmk what you think.

I tried to stick as closely as possible to your implementation. The one exception is that --length (sequence length) and -L/--num-unique-kmers are now mutually exclusive: the script requires one and only one to be provided. Unfortunately, this means I can't set a default for either of them. Happy to change this back and do manual checking on these args if you really want a default.