epifluidlab / FinaleMe

MIT License
9 stars 1 forks source link

[step1] Exception in thread "main" java.lang.IllegalArgumentException: Invalid reference index -1 #7

Closed llb1600 closed 3 months ago

llb1600 commented 3 months ago

hello. I am downloading data through zenodo and working on the tutorial. The following error occurred while performing step 1.

INFO [2024-05-22 11:28:50,202]  [CpgMultiMetricsStats.java:556] [main]  Output value for each CpG in each DNA fragment ...
Exception in thread "main" java.lang.IllegalArgumentException: Invalid reference index -1
    at htsjdk.samtools.QueryInterval.<init>(QueryInterval.java:24)
    at htsjdk.samtools.SamReader$PrimitiveSamReaderToSamReaderAdapter.query(SamReader.java:503)
    at htsjdk.samtools.SamReader$PrimitiveSamReaderToSamReaderAdapter.queryOverlapping(SamReader.java:365)
    at org.cchmc.epifluidlab.finaleme.utils.CpgMultiMetricsStats.doMain(CpgMultiMetricsStats.java:598)
    at org.cchmc.epifluidlab.finaleme.utils.CpgMultiMetricsStats.main(CpgMultiMetricsStats.java:144)

Even though I checked the closed issues, they were not resolved.

Here is the code I used:

DIR=/data/path
java -Xmx20G -cp "target/FinaleMe-0.58-jar-with-dependencies.jar:lib/gatk-package-distribution-3.3.jar:lib/sis-jhdf5-batteries_included.jar:lib/java-genomics-io.jar:lib/igv.jar" \
        org.cchmc.epifluidlab.finaleme.utils.CpgMultiMetricsStats \
        ${DIR}/hg19.2bit \
        ${DIR}/CG_motif.hg19.common_chr.pos_only.bedgraph \
        ${DIR}/CG_motif.hg19.common_chr.pos_only.bedgraph \
        ${DIR}/BH01.chr22.sorted.bam \
        CpgMultiMetricsStats.hg19.details.bed.gz \
        -stringentPaired \
        -excludeRegions ${DIR}/wgEncodeDukeMapabilityRegionsExcludable_wgEncodeDacMapabilityConsensusExcludable.hg19.bed \
        -valueWigs methyPrior:0:${DIR}/wgbs_buffyCoat_jensen2015GB.methy.hg19.bw \
        -wgsMode

CG_motif.hg19.common_chr.pos_only.bedgraph is as follows.

chr1 28735 29810 1 chr1 135124 135563 1 chr1 327790 328229 1 chr1 437151 438164 1 chr1 449273 450544 1 chr1 533219 534114 1 chr1 544738 546649 1 chr1 713984 714547 1

Please can anyone help me. Thanks in advance.

llb1600 commented 3 months ago

I solved it. In my case, the error occurred because the chr column in the BH01.chr22.bam file was set to 22. I solved it by changing 22 to chr22.