rmarduga / amplicon-finder

AmpliconFinder - an HMM-based method for detecting double minute chromosomes amplicons.
MIT License
1 stars 1 forks source link

IndexError: list index out of range #2

Open jamesdalg opened 2 years ago

jamesdalg commented 2 years ago

I'm having some issues with the calculateChromosomeRelativeCoverage function running with the tumor_cov object being addressed at a nonexistent index. What do you believe could cause this?

           mkdir -p /lscratch/$SLURM_JOB_ID/af_cache/;
           module load python samtools;
           #samtools index -@ 64 /data/CCRBioinfo/dalgleishjl/sv_mapping/gridss_pipeline/bam_hg38/TINYPATUXZ_N.bam;
           #samtools index -@ 64 /data/CCRBioinfo/dalgleishjl/sv_mapping/gridss_pipeline/bam_hg38/TINYPATUXZ_T.bam;
           python /data/CCRBioinfo/dalgleishjl/amplicon-finder/amplicon_finder.py -t $SLURM_CPUS_PER_TASK -k 3 -i 100                    -g 1000 -l 1000 -c /lscratch/$SLURM_JOB_ID/af_cache/                    /data/CCRBioinfo/dalgleishjl/sv_mapping/gridss_pipeline/bam_hg38/TINYPATUXZ_T.bam /data/CCRBioinfo/dalgleishjl/sv_mapping/gridss_pipeline/bam_hg38/TINYPATUXZ_N.bam > /data/CCRBioinfo/dalgleishjl/sv_mapping/ampliconfinder/TINYPATUXZ_amplicons.bed;

[+] Loading python 3.8  ... 
[+] Loading samtools 1.15.1  ... 
Traceback (most recent call last):
  File "/data/CCRBioinfo/dalgleishjl/amplicon-finder/amplicon_finder.py", line 215, in <module>
    for chromosome, predictedAmplicons in pool.map(getAmpliconsInChromosome, chromosomeList):
  File "/usr/local/Anaconda/envs/py3.8/lib/python3.8/multiprocessing/pool.py", line 364, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/usr/local/Anaconda/envs/py3.8/lib/python3.8/multiprocessing/pool.py", line 771, in get
    raise self._value
  File "/usr/local/Anaconda/envs/py3.8/lib/python3.8/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/usr/local/Anaconda/envs/py3.8/lib/python3.8/multiprocessing/pool.py", line 48, in mapstar
    return list(map(*args))
  File "/data/CCRBioinfo/dalgleishjl/amplicon-finder/amplicon_finder.py", line 166, in getAmpliconsInChromosome
    cov, coord = calculateChromosomeRelativeCoverage(tumorCoverageData, germlineCoverageData, chromosome, chromosomeSize, args.window)
  File "/data/CCRBioinfo/dalgleishjl/amplicon-finder/amplicon_finder.py", line 61, in calculateChromosomeRelativeCoverage
    tumor_cov[i // windowSize] += tumorCoverageData[i]
IndexError: list index out of range
lainemarrah commented 1 year ago

I know it's been while since you posted this but I have encountered the same issue, I tried pretty hard to debug it but didn't come up with anything. Interestingly it only happened for some samples of mine but not others. Seemingly it's trying to index the object tumorCoverageData out of bounds, but when I tested it the length of tumorCoverageData was longer than the maximum i in the for loop (and there seems to be code to ensure this) so I'm not sure what to make of it.