This is a test version of Biostars. For the public version, visit https://www.biostars.org.
samtools reheader error

Hello, everybody. I used VG to align a pangenome and generate the original BAM file, where the header sequence order is chr1, chr10, chr11. I wanted to replace the header to chr1, chr2, chr3, so I generated a SAM file, manually adjusted the chromosome order, and then used samtools reheader to modify the BAM file. After modification, an issue occurred: the chromosome positions of the original sequences changed. I would like to know how to avoid this situation. error

samtools

I am using GATK to identify regions requiring local realignment, providing target intervals for the IndelRealigner tool to optimize the alignment quality around short insertions and deletions (indels). However, the following error occurred, so I want to adjust the order of the BAM file header.

gatk3.8) chiyong@chiyong-Super-Server:/mnt/h/gigas/data$       /home/chiyong/miniconda3/envs/gatk3.8/bin/gatk3 \
           -Xms20G -Xmx20G  \
           -T RealignerTargetCreator \
           --remove_program_records \
           --disable_bam_indexing \
           -nt 85 \
           -R /mnt/d/fugu/00.genome/hetun_t2t.fasta  \
           -I /mnt/c/pan-genome/Minigraph-Cactus/pangenome/sampling/bam/CF108.lefted.bam \
           -o /mnt/c/pan-genome/Minigraph-Cactus/pangenome/sampling/bam/CF108.left.shifted.intervals

##### ERROR   reads contigs = [chr1, chr10, chr11, chr12, chr13, chr14, chr15, chr16, chr17, chr18, chr19, chr2, chr20, chr21, chr22, chr3, chr4, chr5, chr6, chr7, chr8, chr9]
##### ERROR   reference contigs = [chr1, chr2, chr3, chr4, chr5, chr6, chr7, chr8, chr9, chr10, chr11, chr12, chr13, chr14, chr15, chr16, chr17, chr18, chr19, chr20, chr21, chr22]
##### ERROR ---

1 answer

You asked the same question on GitHub. It has been answered there.

Log in to answer this question.