Xinglab / espresso

Other
48 stars 4 forks source link

ESPRESSO_C.pl error #17

Closed yuejun-j-wang closed 10 months ago

yuejun-j-wang commented 1 year ago

Signal TERM received in thread 4, but no signal handler set. at /home/**/tools/espresso/src/ESPRESSO_C.pl line 2033. Worker 4 begins to scan sam.list3ad. Terminating worker 4. Perl exited with active threads: 3 running and unjoined 0 finished and unjoined 0 running and detached

EricKutschera commented 1 year ago

This is the line from the message: https://github.com/Xinglab/espresso/blob/v1.3.1/src/ESPRESSO_C.pl#L2033

The code found that some other thread had an error and it tried to cancel any threads that were still running by sending the TERM signal. I think there should be some other error message from the thread that originally had an error. Can you post the full output?

yuejun-j-wang commented 1 year ago

3.log

EricKutschera commented 1 year ago

This is the main error: Thread 5 terminated abnormally: substr outside of string at /home/yuejun/tools/espresso/src/ESPRESSO_C.pl line 774.: https://github.com/Xinglab/espresso/blob/v1.3.1/src/ESPRESSO_C.pl#L774

It's trying to operate on part of the read sequence, but the sequence isn't as long as expected. I've seen this happen before when filtering input bam files down to a specific region. In that case, secondary or supplementary alignments were in the filtered region but the primary alignment with the full sequence was not. If you filtered your bam files you could try to redo the filter so that all read IDs have a primary alignment. You could also try realigning your input with the minimap2 command from the README so that the alignments are in a format that ESPRESSO should work with: https://github.com/Xinglab/espresso/tree/v1.3.1#alignment

Unfortunately the error message doesn't give any information to identify the specific read causing the issue. You could try running on subsets of your input file(s) to narrow it down, or add some print statements near that line

yuejun-j-wang commented 1 year ago

Thank you. After filtering the bam by -F 0x900, it works now.

chrisamiller commented 11 months ago

I'm seeing this same error when splitting bams by chromosome to try to speed up analysis.

Thread 2 terminated abnormally: substr outside of string at /bin/espresso/src/ESPRESSO_C.pl line 774.

Filtering each bam by -F 0x900 does not fix the problem in my case. I'm not seeing an obvious way in the code to spit out the offending read name - do you have any suggestions on how to do that? Or for some kind of perl one liner that will look for the problematic case in a bam file? Thanks!

EricKutschera commented 11 months ago

The code in this commit should print out the read ID if that line gives an error: https://github.com/Xinglab/espresso/commit/2fa5b1cb14bd0d254d9948fc49048c0814524a81

I'm planning to update the S step code to filter out reads like this so that this error in the C step doesn't happen

chrisamiller commented 11 months ago

Thanks, this helped me track down the issue (which was due to some supplementary alignment chaff). Appreciate your help, and looking forward to the built-in filtering (as opposed to having to pre-filter bams)