How do I run pal2nal.pl in batch mode ?
0
0
Entering edit mode
22 months ago
Ramana • 0

HI,

I had more than 4,500 orthologs, how do I run pal2nal.pl in batch mode. by taking two input files ?

pep.aln - OG0016582.mt.r.py.fa
nuc.fasta - all_OG0016582.fa.cds.fa 


pal2nal.pl aafasta/OG0016582.mt.r.py.fa  cdsfasta/all_OG0016582.fa.cds.fa -output paml > all_OG0016582.paml.fasta 

I wrote a script, can some one correct my script, thanks.

for i in $(ls -1 *.fa | sed 's/\.fa//'); do  pal2nal.pl  aafasta/$i\.fa  cdsfasta/$i\.fa -output paml > $i\.fasta ; done
gene genome protein • 489 views
ADD COMMENT
2
Entering edit mode
pal2nal.pl  OG0012884_out.fa OG0012884_out.txt -output paml > OG0012884_paml.txt

Script -

for txt in *_out.txt ; do
    sample=${txt%.txt}
    out=${sample%_out}
    pal2nal.pl "$sample".fa "$sample".txt -output paml > "$out"_paml.txt
done

You might add a check that the other file exists:

if [[ ! -e $sample.fa ]] ; then
    echo "$sample.fa missing, skipped." >&2
    continue
fi
ADD REPLY

Login before adding your answer.

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