TITLE: Mitogenome (or other Multi-gene) Maximum Likelihood Phylogenetic Analyses 
AUTHORS: Dakota Betz

[DESCRIPTION]
A guide to doing maximum likelhood whole mitogenome (or multigene) analyses in RaXML. This was written after Avery's instructions!

[STEPS]
1. Create text files in FASTA format with all of each of the genes you want to use (i.e. Pilargidae_12S.txt, Gastropods_ATP6.txt, etc.). Make sure the same organism has the same name for ALL of the genes (spaces included - there should be none, but sometimes they sneak up on you).
2. Open Mesquite, create a new file, make sure to check “Make Character Matrix” and then select “DNA Data” as the type of data. Drag any one of your gene text files into it and import as FASTA, click “Don’t Adjust”. Delete the top empty taxa that were there by default.
3. For non-protein-coding genes (12S, 16S) or if you're doing a nucleotide only analysis, align the sequences using MUSCLE (Click on “Matrix”, “Align Multiple Sequences”, then “MUSCLE Align”. Select “No” for running on multiple threads, and then click okay. Check to see if everything is fine.), then export in phylip (DNA/RNA) format. Repeat this for all non-protein-coding genes, or all genes for a nucleotide only analysis.
 
 

4. If you're doing an amino acid only or nucleotide for non-protein-coding genes and amino acid for protein-coding genes analysis, follow these next steps:
4.1. Create a nexus file like before, DO NOT yet align it, save it, then duplicate it. Name the duplicated file something like “Gastropods_ATP6_NT.nex”. The file you have open can stay “Gastropods_ATP6.nex” or be something like “Gastropods_ATP6_AA.nex”. As long as you know which one will be the nucleotide only and which one will be the protein only file.
4.2. 2. Click on “Character Matrix” on the left sidebar and select “List & Manage Characters”
 

4.3. In the toolbar, select “Columns”, then “Current Genetic Codes”.
 

4.4. Click on the “Genetic Code” tab in your file window, then under “Genetic Code” choose Invertebrate Mitochondrial (or whatever applies, but in our lab it should mostly be that one). Make sure you actually selected the column, so the values all change from displaying “Standard” to “Invertebrate Mitochondrial”.
 

4.5. Click on “Codon Position”, select “Minimize Stop Codons”. When you do this, MAKE SURE that the column is selected! The values should change from “N” to numbers 1-3, depending on the position.
 
Your window should look like this:
 

4.6. In the toolbar, go to “Characters”, select “Make New Matrix From”, and then “Translate DNA to Protein”. Click “OK”. This should open a new tab with your data displayed as amino acids. You should only have stop codons (black with asterisks) at the ends of your sequences if they are complete, but sometimes if the sequence doesn’t start on the first codon, there may be more stop codons throughout. This only means this one sequence needs to be removed, not that all of the others are wrong, too. They’re fine!
 

4.7. It’s a good idea to save your file here, in case you run into issues in this next step, because Mesquite doesn’t have a useful undo feature. Go to the end of the sequences. Delete any empty columns, and then delete all of the stop codons, because they interfere with the RaXML analysis. You should be able to delete the stop codons by just selecting them and deleting them using the “Select” tool, but if that doesn’t work for some reason, you can use the “Edit” tool and click on each stop codon and type “-“ instead of “*” and the end result is the same. Make sure you get ALL of them! Even those from shorter sequences that may be hiding more towards the beginning of the sequences.

You go from this:
 
        
To this:
 

4.8. You want a file with just the nucleotides and a file with just the amino acids to not confuse RaXML. Because you duplicated this file in the beginning and already have a nucleotide version, go ahead and delete the character matrix from the side bar by clicking on it, then selecting “Delete Matrix”. You should be left with just the “Protein Translation of Character Matrix” tab.
 

4.9. Now align the sequences. Click on “Matrix”, “Align Multiple Sequences”, then “MUSCLE Align”. Select “No” for running on multiple threads, and then click okay. Check to see if everything is fine (depending on how related your organisms are, the alignment might also look nicer or not as nice). Then, delete any empty columns at the end of the alignment. Save the file.
 

4.10. Export as a Phylip (protein) file. MAKE SURE it says “protein” in parentheses next to it! You can name it something like “Gastropods_ATP6_AA.phy”. Change the number for “Maximum length of taxon names” so that you will get the whole name of the sequence in the phylip file. I usually put something large like 100 or 200 just to be safe.
 
You might get an error saying “Sorry, this data matrix can't be exported to this format (some character states aren't represented by a single symbol [char. 91, taxon 24])”. In that case, find the character and change the value (which will be something like “W/M/V/C”) to a “?” using the “Edit” tool. Make sure to save the file again before retrying to export.
 

4.11. Repeat this for every protein coding gene you want to use amino acids for.
5. Open RaXML GUI and load all of your alignments - the two non protein coding gene nucleotide phylip files, and the protein coding gene amino acid phylip files (or whatever applies for your analysis). Drag the first one in, then select the rest of them with the “ADD ALIGNMENT” feature.

 

6. Select “RUN MODELTEST” for all of them (each gene you've added should have a separate option to click "RUN MODELTEST"). Make sure you have 15 genes if you’re doing a mitogenome analysis, and make sure you have really ran the model test function for all of them.
 

7. Set the analysis to “ML + thorough bootstrap + consensus”, set Runs to 10, and keep Reps. at 100 (optionally, you can increase both numbers). Leave "<none>" as the outgroup and whatever seed RaXML decided on.
 

8. Run the analysis (bottom right corner of the top right window -  sometimes you need to expand the program window to find it).
I usually open a youtube window and set an i.e. 10h timer video so my computer doesn't go to sleep while it's computing.
9. Once the analysis is done, find the output file that ends in ".support" and change the suffix to ".tre", so you can open the file in Figtree.
10. In Figtree, to see the results with the bootstrap results, check off "Node Labels" and in the drop-down menu for "Display", choose "labels".