I am having issues creating a successful loop for processing ~200 files in the same directory. My BWA script runs successfully when run on individual scripts but I have been unsuccessful in creating a working loop that will process all files, not just one at a time. Below is an example script:
module load BWA/0.7.17-foss-2016b
for FNAME in $FILES
time bwa mem -t 12 -M /Directory/Folder/Reference/Lisp_final /Directory/Folder/$FNAME\.1.fq.gz /Directory/Folder/$FNAME\.2.fq.gz > /Directory/Folder/Lisp/align_output/$FNAME\.sam
Thank you for any help!