Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with the Bernoulli error model #2

Open
rsharris opened this issue Mar 14, 2022 · 2 comments
Open

Problems with the Bernoulli error model #2

rsharris opened this issue Mar 14, 2022 · 2 comments

Comments

@rsharris
Copy link
Collaborator

(Copied from a direct email to the authors)

I'd like to inform you that in the case of the 'BernoulliModel,' which is causing some errors (errors are listed below) while running, some correction or further development may be required. Without 'BernoulliModel,' it works fine.

Error list:
$ python3 $packg/simulate_unit_errors.py K=21 N=10000 S=4 T=2 P=0.001 B=0.6
Traceback (most recent call last):
File "/home/pijush/Desktop/mutation-rate-intervals/simulate_unit_errors.py", line 622, in
if name == "main": main()
File "/home/pijush/Desktop/mutation-rate-intervals/simulate_unit_errors.py", line 217, in main
mutationModel.set_sketch_prng(sketchSize,sketchPrngs[sketchSize])
AttributeError: 'BernoulliModel' object has no attribute 'set_sketch_prng'

$ cat FirstSeq.fasta | python3 $packg/simulate_nucleotide_errors.py K=21 S=4 T=2 P=0.001 B=0.6
the bernoulli noise model is not currently supported

$ python3 $packg/simulate_unit_errors_thm5.py K=21 L=10000 T=1 P=0.001 B=-0.6
Traceback (most recent call last):
File "/home/pijush/Desktop/mutation-rate-intervals/simulate_unit_errors_thm5.py", line 583, in
if name == "main": main()
File "/home/pijush/Desktop/mutation-rate-intervals/simulate_unit_errors_thm5.py", line 114, in main
pSubstitution = parse_probability(argVal)
File "/home/pijush/Desktop/mutation-rate-intervals/simulate_unit_errors_thm5.py", line 558, in parse_probability
raise ValueError
ValueError

$ cat $refg | python3 $packg/simulate_nucleotide_errors_thm5.py K=21 T=1 P=0.001 B=0.6 --stats='Simulated2.fasta'
the bernoulli noise model is not currently supported

@rsharris
Copy link
Collaborator Author

Thanks for reporting this.

The short answer is that we don't intend to support the Bernoulli error model.

Early in the project we were using both Bernoulli and Poisson error models. In some early programs (not included in the final repo) I implemented and used both models. As we moved away from Bernoulli, I still kept it as a command-line option as I wrote newer programs in case we later decided to use that model; but I rejected it if the user selected it (thus the "bernoulli noise model is not currently supported" message).

I neglected to reject Bernoulli in simulate_unit_errors. Option creep added features that I implemented for Poisson and never implemented for Bernoulli, which causes the "no attribute set_sketch_prng" error.

The ValueError was the result of an invalid probability, minus 0.6, on the command line. The code could/should do a better job of reporting such an error.

Looking at the usage text, I see that the descriptions of Poisson and Bernoulli are misleading, since both claim to be "required". In fact, they are exclusive, and exactly one should be chosen.

The upshoot of all this is that I will remove Bernoulli from the code, entirely.

@rsharris
Copy link
Collaborator Author

commit c92ce6f removes the incomplete support for the Bernoulli error model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant