Skip to content

Instantly share code, notes, and snippets.

@cmdcolin
Last active September 25, 2015 22:20
Show Gist options
  • Save cmdcolin/202b7aa2a91c3bc0024c to your computer and use it in GitHub Desktop.
Save cmdcolin/202b7aa2a91c3bc0024c to your computer and use it in GitHub Desktop.
Convert BAM to bigwig (parallel)
#!/bin/bash
samtools faidx reference_genome.fa
cut -f1,2 reference_genome.fa.fai > chrom.sizes
parallel "bedtools genomecov -ibam {} -g chrom.sizes -bg -split > {.}.bg" ::: *.bam;
parallel "bedGraphToBigWig {} chrom.sizes {.}.bw" ::: *.bg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment