Created
May 15, 2014 06:17
-
-
Save SamBuckberry/cac8ff90a6a39bc8c185 to your computer and use it in GitHub Desktop.
Create .bam file indexes for all bam files in a directory using samtools and parallel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Write a bash script for looping through the bam files | |
#! /bin/bash | |
for i in *accepted_hits.bam | |
do | |
samtools index ${i} | |
done | |
## Save this files as indexBamFiles.sh | |
## To run in parallel (with 4 cores) | |
ls *.bam | parallel -j4 -k bash indexBamFiles.sh {} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment