lindenb / jvarkit

Java utilities for Bioinformatics
https://jvarkit.readthedocs.io/
Other
476 stars 131 forks source link

Minicaller OutOfBoundsException #203

Closed fernanarr closed 1 year ago

fernanarr commented 2 years ago

Verify

Subject of the issue

Executing minicaller after obtaining the .dic file from picard, we are getting this failure

[SEVERE][MiniCaller]offset 83, count 84, length 151 java.lang.StringIndexOutOfBoundsException: offset 83, count 84, length 151 at java.base/java.lang.String.checkBoundsOffCount(String.java:3304) at java.base/java.lang.String.<init>(String.java:591) at com.github.lindenb.jvarkit.tools.calling.MiniCaller.doWork(MiniCaller.java:433) at com.github.lindenb.jvarkit.util.jcommander.Launcher.instanceMain(Launcher.java:796) at com.github.lindenb.jvarkit.util.jcommander.Launcher.instanceMainWithExit(Launcher.java:959) at com.github.lindenb.jvarkit.tools.calling.MiniCaller.main(MiniCaller.java:681) [INFO][Launcher]minicaller Exited with failure (-1)

Your environment

Steps to reproduce

java -jar ./jvarkit/dist/minicaller.jar -R ./jvarkit/dist/Carrera29062022/plasmid_COL7A1/plasmid_COL7A1-BSaI.fa -r "U6927FI290-3:1-15000" ./jvarkit/dist/Carrera29062022/pCOL7A_S1/COL7A.bam > prueba.vcf

Expected behaviour

output prueba.vcf

Actual behaviour

[INFO][MiniCaller]Scanning ./jvarkit/dist/Carrera29062022/pCOL7A_S1/COL7A.bam WARNING: BAM index file /home/fer/./jvarkit/dist/Carrera29062022/pCOL7A_S1/COL7A.bam.bai is older than BAM /home/fer/./jvarkit/dist/Carrera29062022/pCOL7A_S1/COL7A.bam WARNING: BAM index file /home/fer/./jvarkit/dist/Carrera29062022/pCOL7A_S1/COL7A.bam.bai is older than BAM /home/fer/./jvarkit/dist/Carrera29062022/pCOL7A_S1/COL7A.bam [INFO][MiniCaller]Using default parameter for 'min.read.length'. [SEVERE][MiniCaller]offset 83, count 84, length 151 java.lang.StringIndexOutOfBoundsException: offset 83, count 84, length 151 at java.base/java.lang.String.checkBoundsOffCount(String.java:3304) at java.base/java.lang.String.<init>(String.java:591) at com.github.lindenb.jvarkit.tools.calling.MiniCaller.doWork(MiniCaller.java:433) at com.github.lindenb.jvarkit.util.jcommander.Launcher.instanceMain(Launcher.java:796) at com.github.lindenb.jvarkit.util.jcommander.Launcher.instanceMainWithExit(Launcher.java:959) at com.github.lindenb.jvarkit.tools.calling.MiniCaller.main(MiniCaller.java:681) [INFO][Launcher]minicaller Exited with failure (-1)

We don't know what could be happening. Might be because of the warning about the bam file?

Thanks in advance

lindenb commented 2 years ago

hi thanks for using this tool and thank you for submitting this issue. I wrote this mostly for fun. May I ask why do you use it instead of bcftools or gatk ?

fernanarr commented 2 years ago

Hi!

We are trying to use it because we've read your article and your tool's features seems to suit to our needings and our data volume.

We haven't tried bcftools or gatk

lindenb commented 2 years ago

@fernanarr I think I found the bug. I recently rewrote a large part of this software but my test was too simple. The bug is here:

https://github.com/lindenb/jvarkit/blob/master/src/main/java/com/github/lindenb/jvarkit/tools/calling/MiniCaller.java#L433

replace + new String(bases,readpos0,readpos0+len);

with + new String(bases,readpos0,len);

this fix is still in my dev branch (https://github.com/lindenb/jvarkit/tree/dev) , I'll move into master later.

fernanarr commented 2 years ago

great @lindenb!

It worked.

Thanks a lot for your help and for taking time to develop this tool.

Regards