All of the scripts and R commands required to run our analysis and create the figures are contained within this repository.
First off, the downloaded sequences are converted from Genbank to FASTA format if required by extract_cds.pl
. Then remove_N_and_STOPs.pl
is used to remove any sequences with an ambiguous nucleotide ('N') or an internal STOP codon. These sequences are available here. To identify orthologs we used BLASTX, an example is shown below.
perl translate.pl Alligator_mississippiensis.cds_clean
makeblastdb -in Alligator_mississippiensis.cds_clean_prot -dbtype prot
blastx -query Alligator_sinensis.cds_clean -db Alligator_mississippiensis.cds_clean_prot -evalue 1e-06 -max_target_seqs 1 -outfmt 6 -out AS_vs_AM.txt
Once all pairwise BLASTs were done, we pulled out the reciprocal top hits for each pair, 3-way, 4-way and 5-way group. The orthologs that we identified are listed here.
# To pullout the pairwise and 4-way orthologs:
perl pullout_orthos.pl AM_vs_AS.txt,AS_vs_AM.txt FC_vs_FP.txt,FP_vs_FC.txt AM_vs_FP.txt,FP_vs_AM.txt
# To pullout the 3-way orthologs used for the Relative-rate test:
perl pullout_orthos_3way.pl AM_vs_FP.txt,FP_vs_AM.txt AM_vs_PT.txt,PT_vs_AM.txt 0
# To pullout the 5-way orthologs:
perl pullout_orthos_5way.pl Archosaur_4way.txt PT_vs_AM.txt,AM_vs_PT.txt
We first re-ran our original relative-rate tests on the independent, pairwise Falcon-Alligator-Chimp orthologs.
# First we run the RRT using the protein sequences
perl relative_rate3_prot.pl AM_FP_PT.txt Alligator_mississippiensis.cds_clean,Falco_peregrinus.cds_clean,Pan_troglodytes.CHIMP2.1.4.cds.all.fa_clean
# We then run the relative-rate test on the whole ORF, first two codon positions and third codon position
perl relative_rate3_cod.pl AM_FP_PT.txt orf Alligator_mississippiensis.cds_clean,Falco_peregrinus.cds_clean,Pan_troglodytes.CHIMP2.1.4.cds.all.fa_clean
perl relative_rate3_cod.pl AM_FP_PT.txt first Alligator_mississippiensis.cds_clean,Falco_peregrinus.cds_clean,Pan_troglodytes.CHIMP2.1.4.cds.all.fa_clean
perl relative_rate3_cod.pl AM_FP_PT.txt third Alligator_mississippiensis.cds_clean,Falco_peregrinus.cds_clean,Pan_troglodytes.CHIMP2.1.4.cds.all.fa_clean
Next, we recreated the data from Whittle and Extavour, running MEGA-CC on the pairs and 4-way groups of orthologs.
# We first run MEGA-CC on each pairwise and 4-way group:
perl run_megacc.pl Alligator_pairs.txt Files/ Alligator_mississippiensis.cds_clean,Alligator_sinensis.cds_clean
perl run_megacc.pl Archosaur_4way.txt Files/ Alligator_mississippiensis.cds_clean,Alligator_sinensis.cds_clean,Falco_peregrinus.cds_clean,Falco_cherrug.cds_clean
# We then pullout the dN, dS and dN/dS for the pairwise alignments:
perl get_dnds_pair.pl Alligators 15502 34469 Files/
mv summary.txt Alligator_summary.txt
# We then pullout the information from the 4-way alignments:
perl get_dnds_4way.pl Archosaurs 34470 43844 Files/
mv summary.txt Archosaur_summary.txt
Finally, we build the 5-way alignments and run codeml to generate the dN/dS values, and HyPhy to run the relative rate test. All of the output files from each step are included here.
# We initially run the relative-rate test on the whole ORF
perl run_5way_analysis.pl 5way.txt Alligator_mississippiensis.cds_clean,Alligator_sinensis.cds_clean,Falco_peregrinus.cds_clean,Falco_cherrug.cds_clean,Pan_troglodytes.CHIMP2.1.4.cds.all.fa_clean
# We then additionally run the relative-rate test on just the first two codon positions
perl run_5way_first_rrt.pl 5way.txt Alligator_mississippiensis.cds_clean,Alligator_sinensis.cds_clean,Falco_peregrinus.cds_clean,Falco_cherrug.cds_clean,Pan_troglodytes.CHIMP2.1.4.cds.all.fa_clean
Most of the figures were created in R
and can be regenerated by running the following script. This will use the files currently in the Output_files directory. Note that many of these figures were subsequently edited in Illustrator, prior to publication.
Rscript generate_R_plots.R