Question: Bash skript for mafft alignment
0
gravatar for ArusjakGevorgyan
2.9 years ago by
Sweden
ArusjakGevorgyan20 wrote:

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
bash alignment fasta • 1.6k views
ADD COMMENTlink modified 2.9 years ago by Pierre Lindenbaum131k • written 2.9 years ago by ArusjakGevorgyan20
0
gravatar for Pierre Lindenbaum
2.9 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum131k wrote:

you want

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

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

ADD COMMENTlink modified 2.9 years ago • written 2.9 years ago by Pierre Lindenbaum131k

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 REPLYlink modified 2.9 years ago • written 2.9 years ago by ArusjakGevorgyan20
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2054 users visited in the last hour