Hi, I hope someone can help me with this, I don't know what I am missing.
I would like to swap positive and negative strands in a BAM file. Below is the steps I am taking:
samtools view -H mybam.bam > header.sam samtools view -h mybam.bam | awk -F ' ' '$2=($2=="16"?"0":"16")' > Swapped.bam samtools reheader header.sam Swapped.bam or samtools reheader header.sam Swapped.bam > newBam.bam
But when I want to see the file, I get:
[bam_header_read] EOF marker is absent. The input is probably truncated. [main_samview] truncated file.
Any ideas are appreciated!