rwdavies / STITCH

STITCH - Sequencing To Imputation Through Constructing Haplotypes
http://www.nature.com/ng/journal/v48/n8/abs/ng.3594.html
GNU General Public License v3.0
73 stars 19 forks source link

It seems a bug in the function "findRecombinedReadsPerSample" at file "heuristics.R" #85

Closed wykkyle closed 10 months ago

wykkyle commented 10 months ago

t1 In the function "findRecombinedReadsPerSample", there's a loop on a selective subset of SampleReads. The body of the loop is mainly constructed of the function "split_a_read", goes into the function "split_a_read".

t2 In the function "split_a_read", the value of the expression "length(sampleReads)" takes part in the programming.

wykkyle commented 10 months ago

however, the length of the list "sampleReads" is changing during the iteration. reads are produced by splitting the original reads, and then the produced reads are appended to the list "SampleReads".

I think that the value of expression "length(sampleReads)" should be fixed at the beginning of the iteration, so that the newly appended reads should not take part the the splitting process recursively.

rwdavies commented 10 months ago

Hi,

Sorry for my slow reply, I was on vacation.

Thanks for the message and finding the specific bug! I've seen errors before around this section of the code but never tracked them down. This was a stupid mistake on my part. I'll go about fixing it now.

Thanks Robbie