This is a test version of Biostars. For the public version, visit https://www.biostars.org.
bash script to run clustalw and fetching sequences

Hello,

I'm trying to run a bash script. I need to execute on all the files in the folder.

Here I'm posting the script

#!/bin/bash
module bash load clustalw pal2nal exonerate
file_path="/dirname/"
source=`pwd`
dir=`mktemp -d` && cd $dir
for file in file_path;do
echo "processsing "$file" file";
ln -fs "$file" pep
clustalw -INFILE=pep -PWGAPOPEN=10 PWGAPEXT=1 > pep.out
extract_value.py pep.out
fastaindex pep pep.idx
fastafetch -f pep -i pep.idx -q sequence_lst -F > $source/$1pep.fa

rm -r $dir
done

When I run this I get

processsing file_path file
Error: unknown option -wgapext.

My understanding is that it is not reading the files one by one at all.Any input will be appreciated. Thanks in advance

software-error

1 answer

You've missed a hyphen near PWGAPEXT:

#!/bin/bash
module bash load clustalw pal2nal exonerate
file_path="/dirname/"
source=`pwd`
dir=`mktemp -d` && cd $dir
for file in file_path;do
echo "processsing "$file" file";
ln -fs "$file" pep
clustalw -INFILE=pep -PWGAPOPEN=10 -PWGAPEXT=1 > pep.out
# ---------------------------here--^
extract_value.py pep.out
fastaindex pep pep.idx
fastafetch -f pep -i pep.idx -q sequence_lst -F > $source/$1pep.fa

rm -r $dir
done

Log in to answer this question.