Created
March 2, 2018 17:04
-
-
Save telatin/55fc0523ecf6cde0a7ea48ce445640c3 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# A first example of 'for loop' to iterate a set of commands over a list of files | |
SamFilesCount=$(ls *.sam | wc -l); | |
echo "In this directory you have ${SamFilesCount}" | |
for SamFile in *.sam | |
do | |
echo -n "Converting ${SamFile}... " | |
samtools view -bS ${SamFile} | samtools sort -o ${SamFile}.bam - | |
samtools index ${SamFile}.bam | |
echo "Done!" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment