codon alignment with pal2nal
1
3
Entering edit mode
6.2 years ago
erick_rc93 ▴ 30

I'm trying to do multiple alignment with pal2nal, which requires two input files, I have a folder with multiple files whose extensions are -e1-e2_aa_aln.faa and -e1-e2.fasta, for a single alignment the command would be

pal2nal.pl file_one-e1-e2_aa_aln.faa file_one-e1-e2.fasta> file_one-e1-e2_nuc_aln.fasta

So, I'm trying with the next for loop to do all the alignments with all the files in the directory

for file in *.faa; do pal2nal.pl "$file" "${f%.faa}.fasta" -output fasta > "${file/-e1-e2_aa_aln.faa/one-e1-e2_nuc_aln.fasta}"; done

but, I get the next error message:

Can't open .fasta at /Users/user/Desktop/pal2nal.v14/pal2nal.pl line 335.

and I don't know where's my mistake in the for loop, can anyone help me ? please

alignment • 2.6k views
ADD COMMENT
3
Entering edit mode
6.2 years ago
h.mon 35k

Debug your code with:

for file in *.faa
do 
    echo "$file"
    echo "${f%.faa}.fasta"
done

Then think variable name.

ADD COMMENT

Login before adding your answer.

Traffic: 1679 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