I'm trying to run a bioinformatics command line tool on all .bam files in a directory. This is what I'm using:
#!/bin/sh
reference='/path/Homo_sapiens_assembly19.fasta'
for f in *.bam
do
base_name=${f%.bam}
java -jar /ppath/GenomeAnalysisTK.jar -R $reference \
-T ASEReadCounter \
-o $base_name.csv \
-I $f \
-sites $base_name.vcf \
-U ALLOW_N_CIGAR_READS \
-minDepth 10 \
--minMappingQuality 10 \
--minBaseQuality 2
done;
The problem is that the loop stops after iterating over the first bam file. I will eventually like this to go over a set of 2000 .bam files, and I don't want to have to enter them all manually (it will take >30 hours).