yjx1217 / simuG

simuG: a general-purpose genome simulator
MIT License
86 stars 12 forks source link

Changing power-law distribution alpha and constant #4

Closed meerachotai closed 3 years ago

meerachotai commented 3 years ago

Hi,

I am trying to change the power-law distribution alpha and constant values to introduce random indels, but I keep getting the following error for values other than the default values of alpha = 2.0 and constant = 0.5:

Introducing random INDELs based on the following parameters:

indel_count = 300 ins_del_ratio = 1 indel_size_powerlaw_alpha = 3.0 indel_size_powerlaw_constant = 1.0 Argument "9.42357754532298e" isn't numeric in numeric ge (>=) at simuG/simuG.pl line 1242.

I was hoping you could look into it!

Another note, the manual mentions that the power-law-fitted indel size distribution is p = C * (size) * (alpha) but referring to the simuG script (line 1616) I realized the distribution is actually set to be p = C (size) ** (-alpha). Maybe this is a typo?

Best, Meera

yjx1217 commented 3 years ago

Hi Meera,

Thank you very much for reporting this issue!

This problem is triggered when the calculated probability gets really small and Perl switches to use exponential notation to denote numeric numbers. In this case, the character '-' will be unexpectedly introduced and therefore breaks the code. This issue has been fixed with the latest commit now. Also, I've corrected the typos in the Manual as well. Please let me know if you encounter any further problems.

Best, Jia-Xing

meerachotai commented 3 years ago

Hi Jia-Xing,

Thank you so much for your quick response! It works perfectly now!

Best, Meera