Entering edit mode
9.2 years ago
bioguy24
▴
230
I am trying to run a bash loop on all bam files in a directory and having a bit of trouble. The bash so far as well as the individual picard command is below. Thank you :).
Bash loop so far
for f in /home/cmccabe/Desktop/NGS/pool_I_090215/*.bam ; do
bname=`basename $f`
pref=${bname%%.bam}
java \
-jar /home/cmccabe/Desktop/NGS/picard-tools-1.139/picard.jar \
CalculateHsMetrics \
BI=/home/cmccabe/Desktop/NGS/bed/sam_sorted_unix_5column_xgen_probes.bed \
TI=/home/cmccabe/Desktop/NGS/bed/sam_sorted_unix_5column_xgen_targets.bed \
I=/$f \
O=/home/cmccabe/Desktop/NGS/pool_I_090215/${pref}_all_IDT.CalculateHSmetrics
done
If the bam files were run individually here is the command
java \
-jar /home/cmccabe/Desktop/NGS/picard-tools-1.139/picard.jar \
CalculateHsMetrics \
BI=/home/cmccabe/Desktop/NGS/bed/sam_sorted_unix_5column_xgen_probes.bed \
TI=/home/cmccabe/Desktop/NGS/bed/sam_sorted_unix_5column_xgen_targets.bed \
I=/home/cmccabe/Desktop/NGS/pool_II_090115/IonXpress_015_150901_newheader.bam \
O=/home/cmccabe/Desktop/NGS/pool_II_090115/IonXpress_015_150901_all_IDT.CalculateHSmetrics
What is the problem? What is the question?
What error message are you getting?
Are you sharing this as a useful tip, bioguy24?