AdamaJava / adamajava

Other
14 stars 5 forks source link

qmotif - SEVERE org.qcmg.motif.CoverageJob - Exception caught in run method of CoverageJob java.lang.IllegalArgumentException: Invalid reference index -1 #317

Closed ArashLab closed 2 years ago

ArashLab commented 2 years ago

The command I run

The ini file is the one mentioned in the documentation for telomere analysis (end of this page link: https://adamajava.readthedocs.io/en/latest/qmotif/qmotif/ )

java -jar ~/tools/adamajava/qmotif/build/flat/qmotif.jar --ini qmotif_telomere.ini --input-bam A.bam --input-bai A.bam.bai --output-xml out.xml --output-bam out.bam --log out.log --threads 1 --loglevel DEBUG

The Output (Logs)

12:14:14.722 [main] EXEC org.qcmg.motif.Motif - Uuid f8fa8655-198f-494a-8ffe-0d03ecf1aa58
12:14:14.722 [main] EXEC org.qcmg.motif.Motif - StartTime 2022-04-19 12:14:14
12:14:14.723 [main] EXEC org.qcmg.motif.Motif - OsName Linux
12:14:14.723 [main] EXEC org.qcmg.motif.Motif - OsArch amd64
12:14:14.723 [main] EXEC org.qcmg.motif.Motif - OsVersion 4.18.0-348.20.1.el8.nci.x86_64
12:14:14.723 [main] EXEC org.qcmg.motif.Motif - RunBy ab8341
12:14:14.724 [main] EXEC org.qcmg.motif.Motif - ToolName qmotif
12:14:14.724 [main] EXEC org.qcmg.motif.Motif - ToolVersion 108-2e5d8a4a
12:14:14.724 [main] EXEC org.qcmg.motif.Motif - CommandLine qmotif --ini qmotif_telomere.ini --input-bam A.bam --input-bai A.bam.bai --output-xml out.xml --output-bam out.bam --log out.log --threads 1 --loglevel DEBUG
12:14:14.724 [main] EXEC org.qcmg.motif.Motif - JavaHome /apps/java/jdk-8.40/jre
12:14:14.725 [main] EXEC org.qcmg.motif.Motif - JavaVendor Oracle Corporation
12:14:14.725 [main] EXEC org.qcmg.motif.Motif - JavaVersion 1.8.0_40
12:14:14.725 [main] EXEC org.qcmg.motif.Motif - host gadi-login-09.gadi.nci.org.au
12:14:14.885 [main] INFO org.qcmg.motif.JobQueue - running with invariants.isIncludesOnlyMode: true
12:14:14.888 [main] INFO org.qcmg.motif.JobQueue - Queueing jobs
12:14:15.223 [main] INFO org.qcmg.motif.JobQueue - Number of queued coverage jobs: 51
12:14:15.223 [main] INFO org.qcmg.motif.JobQueue - Queued jobs are: [chr1:10001-12464 coverage, chr1:249237907-249240620 coverage, chr2:10001-12592 coverage, chr2:243150480-243154648 coverage, chr2:243187373-243189372 coverage, chr3:60001-62000 coverage, chr3:197897576-197903397 coverage, chr3:197960430-197962429 coverage, chr4:10001-12193 coverage, chr4:191041613-191044275 coverage, chr5:10001-13806 coverage, chr5:180903260-180905259 coverage, chr6:60001-62000 coverage, chr6:171053067-171055066 coverage, chr7:10001-12238 coverage, chr7:159126558-159128662 coverage, chr8:10001-12000 coverage, chr8:146302022-146304021 coverage, chr9:10001-12359 coverage, chr9:141151431-141153430 coverage, chr10:60001-62000 coverage, chr10:135522469-135524746 coverage, chr11:60001-62000 coverage, chr11:134944458-134946515 coverage, chr12:60001-62000 coverage, chr12:93158-97735 coverage, chr12:133839458-133841894 coverage, chr13:19020001-19022000 coverage, chr13:115107878-115109877 coverage, chr14:19020001-19022000 coverage, chr14:107287540-107289539 coverage, chr15:20000001-20002000 coverage, chr15:102518969-102521391 coverage, chr16:60001-62033 coverage, chr16:90292753-90294752 coverage, chr17:1-2000 coverage, chr17:81193211-81195210 coverage, chr18:10001-12621 coverage, chr18:78014226-78017247 coverage, chr19:60001-62000 coverage, chr19:59116822-59118982 coverage, chr20:60001-62000 coverage, chr20:62963520-62965519 coverage, chr21:9411194-9413193 coverage, chr21:48117788-48119894 coverage, chr22:16050001-16052000 coverage, chr22:51242566-51244565 coverage, chrX:60001-62033 coverage, chrX:155257733-155260559 coverage, chrY:10001-12033 coverage, chrY:59360739-59363565 coverage]
12:14:15.224 [main] INFO org.qcmg.motif.JobQueue - Commencing processing of jobs...
12:14:15.230 [Thread-1] INFO org.qcmg.motif.WorkerThread - Thread-1 obtained job [chr1:10001-12464 coverage]
12:14:15.230 [Thread-1] INFO org.qcmg.motif.WorkerThread - Thread-1 running job [chr1:10001-12464 coverage]
12:14:15.231 [Thread-1] INFO org.qcmg.motif.CoverageJob - Starting job for: chr1:10001-12464
12:14:15.240 [Thread-1] INFO org.qcmg.motif.CoverageJob - created 1 regions for chr1:10001-12464 with 1 includes and 0 excludes
12:14:15.241 [Thread-1] INFO org.qcmg.motif.CoverageJob - Performing coverage for: chr1:10001-12464
12:14:15.242 [Thread-1] SEVERE org.qcmg.motif.CoverageJob - Exception caught in run method of CoverageJob
java.lang.IllegalArgumentException: Invalid reference index -1
    htsjdk.samtools.QueryInterval.<init>(QueryInterval.java:24)
    htsjdk.samtools.SamReader$PrimitiveSamReaderToSamReaderAdapter.query(SamReader.java:555)
    org.qcmg.motif.CoverageJob.performCoverage(CoverageJob.java:115)
    org.qcmg.motif.CoverageJob.run(CoverageJob.java:95)
    org.qcmg.motif.WorkerThread.run(WorkerThread.java:50)
qmotif: java.lang.InterruptedException
12:14:15.243 [Thread-1] INFO org.qcmg.motif.WorkerThread - Thread-1 obtained job [chr1:249237907-249240620 coverage]
12:14:15.243 [Thread-1] INFO org.qcmg.motif.WorkerThread - Thread-1 running job [chr1:249237907-249240620 coverage]
java.lang.InterruptedException
    at java.lang.Object.wait(Native Method)
    at java.lang.Thread.join(Thread.java:1245)
    at java.lang.Thread.join(Thread.java:1319)
    at org.qcmg.motif.JobQueue.processJobs(JobQueue.java:323)
    at org.qcmg.motif.JobQueue.execute(JobQueue.java:160)
    at org.qcmg.motif.JobQueue.<init>(JobQueue.java:144)
    at org.qcmg.motif.Motif.<init>(Motif.java:57)
    at org.qcmg.motif.Motif.main(Motif.java:316)
12:14:15.243 [Thread-1] INFO org.qcmg.motif.CoverageJob - Starting job for: chr1:249237907-249240620
12:14:15.244 [main] SEVERE org.qcmg.motif.Motif - java.lang.InterruptedException
java.lang.InterruptedException
    java.lang.Object.wait(Native Method)
    java.lang.Thread.join(Thread.java:1245)
    java.lang.Thread.join(Thread.java:1319)
    org.qcmg.motif.JobQueue.processJobs(JobQueue.java:323)
    org.qcmg.motif.JobQueue.execute(JobQueue.java:160)
    org.qcmg.motif.JobQueue.<init>(JobQueue.java:144)
    org.qcmg.motif.Motif.<init>(Motif.java:57)
    org.qcmg.motif.Motif.main(Motif.java:316)
12:14:15.244 [main] SEVERE org.qcmg.motif.Motif - java.lang.Object.wait(Native Method)
12:14:15.244 [main] SEVERE org.qcmg.motif.Motif - java.lang.Thread.join(Thread.java:1245)
12:14:15.244 [Thread-1] INFO org.qcmg.motif.CoverageJob - created 1 regions for chr1:249237907-249240620 with 1 includes and 0 excludes
12:14:15.244 [main] SEVERE org.qcmg.motif.Motif - java.lang.Thread.join(Thread.java:1319)
12:14:15.245 [main] SEVERE org.qcmg.motif.Motif - org.qcmg.motif.JobQueue.processJobs(JobQueue.java:323)
12:14:15.245 [Thread-1] INFO org.qcmg.motif.CoverageJob - Performing coverage for: chr1:249237907-249240620
12:14:15.245 [main] SEVERE org.qcmg.motif.Motif - org.qcmg.motif.JobQueue.execute(JobQueue.java:160)
12:14:15.245 [main] SEVERE org.qcmg.motif.Motif - org.qcmg.motif.JobQueue.<init>(JobQueue.java:144)
12:14:15.245 [Thread-1] SEVERE org.qcmg.motif.CoverageJob - Exception caught in run method of CoverageJob
java.lang.IllegalArgumentException: Invalid reference index -1
    htsjdk.samtools.QueryInterval.<init>(QueryInterval.java:24)
    htsjdk.samtools.SamReader$PrimitiveSamReaderToSamReaderAdapter.query(SamReader.java:555)
    org.qcmg.motif.CoverageJob.performCoverage(CoverageJob.java:115)
    org.qcmg.motif.CoverageJob.run(CoverageJob.java:95)
    org.qcmg.motif.WorkerThread.run(WorkerThread.java:50)
12:14:15.246 [main] SEVERE org.qcmg.motif.Motif - org.qcmg.motif.Motif.<init>(Motif.java:57)
12:14:15.246 [main] SEVERE org.qcmg.motif.Motif - org.qcmg.motif.Motif.main(Motif.java:316)
12:14:15.246 [Thread-1] INFO org.qcmg.motif.WorkerThread - Thread-1 obtained job [chr2:10001-12592 coverage]
12:14:15.246 [Thread-1] INFO org.qcmg.motif.WorkerThread - Thread-1 running job [chr2:10001-12592 coverage]
12:14:15.246 [main] EXEC org.qcmg.motif.Motif - StopTime 2022-04-19 12:14:15
12:14:15.246 [Thread-1] INFO org.qcmg.motif.CoverageJob - Starting job for: chr2:10001-12592
12:14:15.247 [main] EXEC org.qcmg.motif.Motif - TimeTaken 00:00:00
12:14:15.247 [Thread-1] INFO org.qcmg.motif.CoverageJob - created 1 regions for chr2:10001-12592 with 1 includes and 0 excludes
12:14:15.247 [main] EXEC org.qcmg.motif.Motif - ExitStatus 1
12:14:15.247 [Thread-1] INFO org.qcmg.motif.CoverageJob - Performing coverage for: chr2:10001-12592
12:14:15.248 [Thread-1] SEVERE org.qcmg.motif.CoverageJob - Exception caught in run method of CoverageJob
java.lang.IllegalArgumentException: Invalid reference index -1
    htsjdk.samtools.QueryInterval.<init>(QueryInterval.java:24)
    htsjdk.samtools.SamReader$PrimitiveSamReaderToSamReaderAdapter.query(SamReader.java:555)
    org.qcmg.motif.CoverageJob.performCoverage(CoverageJob.java:115)
    org.qcmg.motif.CoverageJob.run(CoverageJob.java:95)
    org.qcmg.motif.WorkerThread.run(WorkerThread.java:50)
ArashLab commented 2 years ago

I get the similar issue when I process the attached small bam file (input, output, script, and config files are included)

temp.tar.gz

holmeso commented 2 years ago

It looks like the reference that was used to align your BAM file doesn't have the "chr" at the start of the chromosome names. 2 options:

HTH

holmeso commented 2 years ago

closing - please re-open if your issues persist