Skip to content

Instantly share code, notes, and snippets.

@hardingnj
Last active August 29, 2015 14:00
Show Gist options
  • Save hardingnj/7c90f2833930b60e6806 to your computer and use it in GitHub Desktop.
Save hardingnj/7c90f2833930b60e6806 to your computer and use it in GitHub Desktop.
Mask regions in fasta where no coverage in a bam file. Useful for calculating null trinucleotide etc distributions
#!/bin/bash
BAM=this.bam
FASTA=that.fa
OUT=theother.fa
bedtools genomecov -ibam $BAM -bga | awk '$4>0' | bedtools maskfasta -fi $FASTA -bed - -fo $OUT;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment