Skip to content

Instantly share code, notes, and snippets.

@danielecook
Created August 7, 2021 00:49
Show Gist options
  • Save danielecook/4b58517edbbac67e33e5fe318a243ac8 to your computer and use it in GitHub Desktop.
Save danielecook/4b58517edbbac67e33e5fe318a243ac8 to your computer and use it in GitHub Desktop.
Remapping an aligned bam
# Source: https://lh3.github.io/2021/07/06/remapping-an-aligned-bam
samtools collate -Oun128 in.bam | samtools fastq -OT RG,BC - \
| bwa mem -pt8 -CH <(samtools view -H in.bam|grep ^@RG) ref.fa - \
| samtools sort -@4 -m4g -o out.bam -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment