Prodigal
Translate nucleotide sequences into amino acid sequences using as an input multi-fasta files.
Installation
Clone the repository:
git clone https://github.com/hyattpd/Prodigal.git
Move to the directory just created:
cd Prodigal
make install
Check the installation works:
prodigal -h
Run
for i in *.fna ; do prodigal -i $i -p meta -o $i.gbk -a $i.faa -d $i.ORF.fna ; done
Running this way will take more time, but it's optimized for metagenomic data.
After running, save the output.txt as it contains valuable information about the gene positioning on the nucleotide sequence.
Also create a file with the headers of the newly generated .faa files. This information will be deleted from the file in a following step, but it can be useful in the future. To create this file run the following command:
grep ">" *.faa >> Prodigal_header.txt
Delete all characters after the first space in the .faa files:
for i in *.faa; do sed -i 's/\s.*$//' $i; done
Prodigal generates a * character at the end of all amino acid sequences translated. Delete this before executing subsequent analyses:
for i in *.faa; do sed -i 's/*//g' $i; done
Put the amino acid sequences in one line:
for i in *.faa ; do perl -lne 'if(/^(>.*)/){ $head=$1 } else { $fa{$head} .= $_ } END{ foreach $s (sort(keys(%fa))){ print "$s\n$fa{$s}\n" }}' $i >> $i.1L.faa ; done