repair
repair is a pair-order repairer for SAM/BAM. It rewrites output as BAM, optionally adds dummy mates for singletons/unpaired reads, and is designed to make the output acceptable to featureCounts.
Quick Start
- Command:
repair -i input.bam -o output.bam - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/repair - SAM input switch: add
-Swhen the input is SAM rather than BAM
When To Use This Tool
- Reordering paired-end reads so mates from the same pair appear next to each other in the output
- Adding dummy reads for singleton reads that lack a pair, making output compatible with featureCounts
- Converting SAM to BAM while repairing pair order
- Processing BAM/SAM files to ensure proper paired-read alignment for downstream counting tools
Common Patterns
# 1) Repair a BAM file with default dummy-read behavior
repair -i input.bam -o repaired.bam
# 2) Repair SAM input
repair -S -i input.sam -o repaired.bam
# 3) Suppress dummy mates for singleton reads
repair -d -S -i input.sam -o repaired.bam
Recommended Workflow
- Decide whether you want featureCounts-compatible dummy mates; if not, add
-d. - Use
-Sexplicitly for SAM input and leave it off for BAM input. - Write to a fresh BAM path and inspect the output with
samtools view. - Only then pass the repaired BAM into counting or other pair-sensitive downstream tools.
Guardrails
- Input and output files must be specified with
-iand-o(no defaults) - Output is always BAM format; there is no SAM output option
-hand--helpare not clean help flags; they are treated as invalid options and then the program prints its usage banner (repair Version 2.1.1).- In local tests, singleton or unpaired reads caused
repairto add dummy mates with sequenceNand qualityA. -dreally suppresses dummy-read insertion: a singleton SAM stayed singleton in the repaired BAM when this flag was used.- A two-read smoke test with flags
73and137was treated as two unpaired reads and produced one dummy mate for each, so pair interpretation is strict. - The binary's own strings include
ERROR: featureCounts does not support counting long paired-end reads., which is a clue that this tool is narrowly targeted at featureCounts compatibility rather than general duplicate/repair logic.