mdcao/japsa

Formula for estimating changes in repeat units

a113n opened this issue · 2 comments

a113n commented

I am trying to understand your code as part of my personal learning exercise, and I noticed that the formula for estimating changes in repeat units is different from what you wrote in Nucl. Acids Res. (2014) 42 (3): e16. Could you please enlighten me on the rationale of such changes?

In line 632 of japsa/src/main/java/japsa/bio/tr/Fragment2TRV.java, you wrote:

double eMean = ((meanP / varP) - (counts[i] * trv.getPeriod() * (mean - gMean) / gVar)) * eVar;

Whereas the original formula was commented out in line 388:

//double eMean = ((meanP / varP) - (counts[i] * (mean - gMean) / gVar)) * eVar;

Looking forward to your reply soon, thanks!

mdcao commented

The previous version (now commented out) worked with number of bases, while the current version works with number of repeat copies.
Hope that makes sense.
Cheers
-M

a113n commented

Thanks for your reply earlier!

Do you actually mean the reverse, where the commented out version worked with the change in number of repeat copies (i.e. the most likely value about Δ), and the current version works with the change in repeat length in nucleotides (i.e. uΔ)?

However in line 130 of japsa/src/main/java/japsa/bio/tr/TRV2VCF.java, it looks like you are multiplying the value again with period to get the change in repeat length. Isn't that unnecessary if trv.var is already representing uΔ? Or Is it?

int nuc = (int) Math.round(trv.var * period);