weissmanlab / BB_bottleneck

7 stars 8 forks source link

unexpected error #1

Open noamharel161 opened 4 years ago

noamharel161 commented 4 years ago

Hello, I am getting the following error when trying to run Bottleneck_size_estimation_approx.r, both when using my data file and your example data file:

Rscript Bottleneck_size_estimation_approx.r --file "example_data/donor_and_recipient_freqs.txt" --plot_bool TRUE --var_calling_threshold 0.03 --Nb_min 1 --Nb_max 200 --confidence_level .95 Error: unexpected input in: " likelihood_matrix[i, j] <- likelihood_matrix[i, j] + (dbeta(nu_recipient, k, (Nb_val - k))*dbinom(k,�" Execution halted

I am getting this error when I run this on Windows (R 3.6.2) as well as a linux machine (R 3.6.1). Do you know what the problem is?

Thank you!

tsmit58 commented 4 years ago

Hi, Can you try running again, but with Bottleneck_size_estimation_approx2.r instead (just added)? I'm not seeing this error on my mac, and am hoping it's a simple issue of argument formatting for dbinom. If you're still getting errors with this new script, please let me know.

Thanks!

noamharel161 commented 4 years ago

Hi, Still getting an error in the same line: Rscript Bottleneck_size_estimation_approx2.r --file "example_data/donor_and_recipient_freqs.txt" --plot_bool TRUE --var_calling_threshold 0.03 --Nb_min 1 --Nb_max 200 --confidence_level .95 Error: unexpected input in: " likelihood_matrix[i, j] <- likelihood_matrix[i, j] + (dbeta(nu_recipient, k, (Nb_val - k))*dbinom(k,Nb_val,nu_donor))�" Execution halted

Thanks

tsmit58 commented 4 years ago

Okay, I was able to reproduce the error you're receiving on windows. It was indeed a newline/space character issue, and the new version seems to run correctly. Please give Bottleneck_size_estimation_approx.r another try, and if you have any issues on windows or linux, let me know.

Thanks!