-
Notifications
You must be signed in to change notification settings - Fork 10
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
CopywriteR crashes when "calculating extension cutoff for every peak" #17
Comments
Hi Clemens,
This might indeed be a serious mistake in the code, although we have never heard about this potential bug. Would it be possible to run one of your sample pairs that shows the error, up to line 426, and then save it as an image using save.image()? If you could then send me the image, that would be a great way to start debugging. Also, just to be sure, could you provide me with a sessionInfo() and the log file?
Thanks and best regards,
Thomas
…--------------------------------------------------
Thomas Kuilman, PhD
Department of Molecular Oncology & Immunology
Netherlands Cancer Institute
1066 CX Amsterdam
The Netherlands
Phone: +31-20-5121841
On 24 Aug 2017, at 16:47, Clemens Messerschmidt <notifications@github.com<mailto:notifications@github.com>> wrote:
We have found a few WES tumor/normal pairs where CopywriteR crashes. I don't quite understand why that happens, i.e. which input triggers this, but I tracked down the combinations of data that lead to this.
This is the error:
This analysis will be run on 8 cpus
Error in while (cov.chr[index] > lower.cutoff.peaks[i]) { :
argument is of length zero
Calls: do.all ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
This is the offending chunk of code (https://github.com/PeeperLab/CopywriteR/blob/master/R/CopywriteR.R#L447):
if (nrow(test) > 0) {
for (i in seq_len(nrow(test))) {
index <- test[i, "start"]
while (cov.chr[index] > lower.cutoff.peaks[i]) {
index = index - 1
}
test[i, "start"] <- index - read.length
index <- test[i, "end"]
while (cov.chr[index] > lower.cutoff.peaks[i]) {
index = index + 1
}
test[i, "end"] <- index + read.length
}
}
In the sample I am looking at, we start at test[i, "start"] = 154. The coverage at lower.cutoff.peaks[1] is 2. Now we move from position 154 down, until we find a position in cov.chr equal or smaller 2. If that does not happen, trying to get cov.chr[0] leads to the crash. I guess the function assumes that at least at cov.chr[1] the while loop should exit, but I don't know why this does not happen. In any case, this should be caught and dealt with.
I modified the code to print print(paste(cov.chr[index], lower.cutoff.peaks[i])), this is the output:
[1] "8 2"
[1] "7 2"
[1] "7 2"
[1] "7 2"
[1] "7 2"
[1] "7 2"
[1] "7 2"
[1] "7 2"
[1] "7 2"
[1] "7 2"
[1] "7 2"
[1] "7 2"
[1] "7 2"
[1] "7 2"
[1] "7 2"
[1] "7 2"
[1] "7 2"
[1] "7 2"
[1] "7 2"
[1] "6 2"
[1] "6 2"
[1] "6 2"
[1] "6 2"
[1] "6 2"
[1] "6 2"
[1] "6 2"
[1] "6 2"
[1] "6 2"
[1] "6 2"
[1] "6 2"
[1] "6 2"
[1] "6 2"
[1] "6 2"
[1] "6 2"
[1] "6 2"
[1] "6 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "4 2"
[1] "4 2"
[1] "4 2"
[1] "4 2"
[1] "4 2"
[1] "4 2"
[1] "4 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "3 2"
[1] "3 2"
[1] "3 2"
[1] "3 2"
[1] "3 2"
[1] "4 2"
[1] "4 2"
[1] "4 2"
[1] "4 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "4 2"
[1] "4 2"
[1] "4 2"
[1] "4 2"
[1] "4 2"
[1] "4 2"
[1] "4 2"
[1] "4 2"
[1] "4 2"
[1] "4 2"
[1] "4 2"
[1] "4 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "5 2"
[1] "3 2"
[1] "3 2"
[1] "3 2"
Best,
Clemens
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#17>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AIGKlh4HMtLJ1p4xn-g35z_eTkOpHLdmks5sbYzwgaJpZM4PBfAr>.
|
Hi Thomas, I would be happy to provide you with more information to debug this. First, here is the full log
Sorry, I should have added this in the beginning. If I do
though. If those are sufficient to research this, I would send those via email to you. Otherwise please tell me which other objects would be needed. Thanks for your help! |
Hi Clemens, Did you solve the problem? I have the same error in running CopywriteR in WES data. |
Hello Raey, unfortunately I was not able to solve this problem up to now. My suspicion at the moment is that we are using an incorrect bed file for the WES enrichment kit (the data are pretty old, were sequenced somewhere else and metadata is sparse). @thomasKuilman Do you think that this could be a reason for this crash? |
We have found a few WES tumor/normal pairs where CopywriteR crashes. I don't quite understand why that happens, i.e. which input triggers this, but I tracked down the combinations of data that lead to this.
This is the error:
This is the offending chunk of code (https://github.com/PeeperLab/CopywriteR/blob/master/R/CopywriteR.R#L447):
In the sample I am looking at, we start at
test[i, "start"] = 154
. The coverage atlower.cutoff.peaks[1]
is 2. Now we move from position 154 down, until we find a position incov.chr
equal or smaller 2. If that does not happen, trying to getcov.chr[0]
leads to the crash. I guess the function assumes that at least atcov.chr[1]
the while loop should exit, but I don't know why this does not happen. In any case, this should be caught and dealt with.I modified the code to print
print(paste(cov.chr[index], lower.cutoff.peaks[i]))
, this is the output:Best,
Clemens
The text was updated successfully, but these errors were encountered: