Bash skript for mafft alignment
1
0
Entering edit mode
6.8 years ago

Hello everyone! I have just started working with bash scripting and need to align (Mafft alignment) my 2863 fasta files, but my code does not seem to work. Can you please help me? Thanks in advance :)

Folder:
aa_less10

Files :
E*.aa.fa

New File that I want to save my aligned files:

align

Here is my code:

 for FILE in `cat aa_less10/E*.aa.fa`; 
 do
 mafft --genafpair --maxiterate 1000 $FILE > $FILE.out;   
 cp $FILE.out/$FILE align/$FILE  
 done
Fasta alignment bash • 3.1k views
ADD COMMENT
0
Entering edit mode
6.8 years ago

you want

for FILE in aa_less10/E*.aa.fa
do
(...)

and just, in case, protect your variable with ${FILE}

ADD COMMENT
0
Entering edit mode

Hi again :D Thank you for the help.

Now I tried like this: (But the output dose not save in the current folder, do you know why? )

for FILE in aa_less10/E*.aa.fa; do

mafft --genafpair --maxiterate 1000 ${FILE} > $FILE.out;
done

ADD REPLY

Login before adding your answer.

Traffic: 2457 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6