Skip to content

Patch overflow with high BAM coverage - #212

Open
RenzoTale88 wants to merge 1 commit into
malonge:masterfrom
RenzoTale88:patch_overflow
Open

RenzoTale88 wants to merge 1 commit into
malonge:masterfrom
RenzoTale88:patch_overflow

Conversation

@RenzoTale88

Copy link
Copy Markdown

Hi,
I tried to run ragtag correct with a BAM file with the following command line:

ragtag.py correct \
        -R $READS \
        -T corr \
        -j ragtag_skip.txt \
        -t $SLURM_CPUS_PER_TASK \
        --aligner $( which nucmer ) \
        --nucmer-params '--maxmatch -l 100 -c 500 -t'"$SLURM_CPUS_PER_TASK"'' \
        -o $DNAME \
        $REF \
        $FASTA

This returned me the following log:

Fri Aug 28 10:39:35 2026 --- VERSION: RagTag v2.1.0
Fri Aug 28 10:39:35 2026 --- CMD: ragtag.py correct -R HOSTILE/rob1_29.clean.fasta.gz -T corr -j ragtag_skip.txt -t 32 --aligner /mnt/envs/ragtag/bin/nucmer --nucmer-params --maxmatch -l 100 -c 500 -t32 -o RAGTAG_FINAL_CORRECT/p_ctg/ REF/GCF_002263795.3_ARS-UCD2.0_genomic.fna FINAL/p_ctg.final.purged.fa
Fri Aug 28 10:39:35 2026 --- WARNING: Without '-u' invoked, some component/object AGP pairs might share the same ID. Some external programs/databases don't like this. To ensure valid AGP format, use '-u'.
Fri Aug 28 10:39:35 2026 --- INFO: Mapping the query genome to the reference genome
Fri Aug 28 10:39:35 2026 --- INFO: Running: /mnt/envs/ragtag/bin/nucmer --maxmatch -l 100 -c 500 -t32 -p /mnt/RAGTAG_FINAL_CORRECT/p_ctg/ragtag.correct.asm /mnt/REF/GCF_002263795.3_ARS-UCD2.0_genomic.fna /mnt/FINAL/p_ctg.final.purged.fa 2> /mnt/RAGTAG_FINAL_CORRECT/p_ctg/ragtag.correct.asm.delta.log
Fri Aug 28 18:30:41 2026 --- INFO: Finished running : /mnt/envs/ragtag/bin/nucmer --maxmatch -l 100 -c 500 -t32 -p /mnt/RAGTAG_FINAL_CORRECT/p_ctg/ragtag.correct.asm /mnt/REF/GCF_002263795.3_ARS-UCD2.0_genomic.fna /mnt/FINAL/p_ctg.final.purged.fa > /mnt/RAGTAG_FINAL_CORRECT/p_ctg/ragtag.correct.asm.delta.log
Fri Aug 28 18:30:41 2026 --- INFO: Running: ragtag_delta2paf.py /mnt/RAGTAG_FINAL_CORRECT/p_ctg/ragtag.correct.asm.delta > /mnt/RAGTAG_FINAL_CORRECT/p_ctg/ragtag.correct.asm.paf 2> /mnt/RAGTAG_FINAL_CORRECT/p_ctg/ragtag.correct.err
Fri Aug 28 18:42:19 2026 --- INFO: Finished running : ragtag_delta2paf.py /mnt/RAGTAG_FINAL_CORRECT/p_ctg/ragtag.correct.asm.delta > /mnt/RAGTAG_FINAL_CORRECT/p_ctg/ragtag.correct.asm.paf 2> /mnt/RAGTAG_FINAL_CORRECT/p_ctg/ragtag.correct.err
Fri Aug 28 18:42:19 2026 --- INFO: Reading whole genome alignments
Fri Aug 28 18:43:28 2026 --- INFO: Filtering and merging alignments
Fri Aug 28 18:44:28 2026 --- INFO: Validating putative query breakpoints via read alignment
Fri Aug 28 18:44:28 2026 --- INFO: Aligning reads to query sequences
Fri Aug 28 18:44:28 2026 --- INFO: Running: minimap2 -ax asm20 -t 32 /mnt/FINAL/p_ctg.final.purged.fa /mnt/HOSTILE/rob1_29.clean.fasta.gz > /mnt/RAGTAG_FINAL_CORRECT/p_ctg/ragtag.correct.reads.sam 2> /mnt/RAGTAG_FINAL_CORRECT/p_ctg/ragtag.correct.reads.sam.log
Fri Aug 28 21:10:02 2026 --- INFO: Finished running : minimap2 -ax asm20 -t 32 /mnt/FINAL/p_ctg.final.purged.fa /mnt/HOSTILE/rob1_29.clean.fasta.gz > /mnt/RAGTAG_FINAL_CORRECT/p_ctg/ragtag.correct.reads.sam 2> /mnt/RAGTAG_FINAL_CORRECT/p_ctg/ragtag.correct.reads.sam.log
Fri Aug 28 21:10:02 2026 --- INFO: Compressing, sorting, and indexing read alignments
Fri Aug 28 21:23:20 2026 --- INFO: Indexing read alignments
Fri Aug 28 21:29:07 2026 --- INFO: Validating putative query breakpoints
Fri Aug 28 21:29:07 2026 --- INFO: Calculating global read coverage
/mnt/envs/ragtag/bin/ragtag_correct.py:119: RuntimeWarning: overflow encountered in scalar add
  mid = sum(covs) // 2
Fri Aug 28 22:51:51 2026 --- INFO: The global median read coverage is 0X
Fri Aug 28 22:51:51 2026 --- INFO: The max and min coverage thresholds are 0X and 5X, respectively
Fri Aug 28 22:54:48 2026 --- INFO: Writing: /mnt/RAGTAG_FINAL_CORRECT/p_ctg/ragtag.correct.agp
Fri Aug 28 22:54:48 2026 --- INFO: Writing broken contigs
Fri Aug 28 22:54:48 2026 --- INFO: Running: ragtag_break_query.py /mnt/RAGTAG_FINAL_CORRECT/p_ctg/ragtag.correct.agp /mnt/FINAL/p_ctg.final.purged.fa > /mnt/RAGTAG_FINAL_CORRECT/p_ctg/ragtag.correct.fasta 2> /mnt/RAGTAG_FINAL_CORRECT/p_ctg/ragtag.correct.err
Fri Aug 28 22:54:54 2026 --- INFO: Finished running : ragtag_break_query.py /mnt/RAGTAG_FINAL_CORRECT/p_ctg/ragtag.correct.agp /mnt/FINAL/p_ctg.final.purged.fa > /mnt/RAGTAG_FINAL_CORRECT/p_ctg/ragtag.correct.fasta 2> /mnt/RAGTAG_FINAL_CORRECT/p_ctg/ragtag.correct.err
Fri Aug 28 22:54:54 2026 --- INFO: Goodbye

This causes an overflow due to the use of np.int32 here. Using np.int64 fixes the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant