Perform phylogenetic analyses using command line on Mac
Downhill to the ocean (Kuchinoshima Island, 2018).
When you perform a phylogenetic analysis, you may use MEGA which is a quite convenient software. But it does not work properly on Mac. Moreover, we sometimes forget how we made the phylogenetic tree.
Here, I keep a record of how I perform phylogenetic analyses using command line.
This is just a log of my trial and error. I DO NOT guarantee the proper functioning of codes below.
1. Maximum likelihood
Use RAxML-NG and Modeltest-NG.
brew tap brewsci/bio
brew install raxml-ng
brew install git cmake libtool automake
git clone --recursive https://github.com/ddarriba/modeltest
cd modeltest
mkdir build && cd build
cmake ..
make
Select a substitution model.
modeltest-ng -i input.fas -o output
Then, you'll find an output.out file containing best substitution models under AIC, AICc, and BIC. Commands are also listed in the file.
Commands:
> raxml-ng --msa input.fas --model TPM1uf+I+G4
Just run the command.
raxml-ng --msa input.fas -all --model TPM1uf+I+G4 --redo --bs-trees 100 --threads 2
Open an input.fas.raxml.support file with FigTree. Bootstrap values for each node can be shown by selecting "label".
2. Neighbor joining
Convert file format; fasta to nexus. I used MEGA (it worked somehow). I modified data description: datatype=nucleotide to datatype=dna. There are other useful tools for the conversion.
Download MrModeltest2.
Make a symbolic links of MrModeltest2 and MrModelblock in a current directory.
ln -s /PATH/To/MrModeltest2/bin/macosx/mrmodeltest2.4.macos.10.13.3 .
ln -s /PATH/To/MrModeltest2/doc/MrModelblock .
Download PAUP.
Run PAUP.
paup4a166_osx
exe Fasta-All_fromAlam7.nexus;
exe MrModelblock;
q
mrmodel.scores will be generated.
Run MrModeltest2.
mrmodeltest2.4.macos.10.13.3 < mrmodel.scores > mrmodel.out
mrmodel.out will be generated which contains a PAUP* command block.
PAUP* Commands Block: If you want to implement the previous estimates as likelihod settings in PAUP*, attach the next block of commands after the data in your PAUP file:
[!
Likelihood settings from best-fit model (GTR+I+G) selected by hLRT in MrModeltest 2.4
]
BEGIN PAUP;
Lset Base=(0.2646 0.3385 0.1237) Nst=6 Rmat=(2.882252693 16.924112320 1.114207029 0.802115560 11.847808838) Rates=gamma Shape=0.4257 Pinvar=0.4273;
END;
Run PAUP* using the commands.
paup4a166_osx
log file=nj.log
execute input.nexus;
set criterion=distance;
Lset Base=(0.2646 0.3385 0.1237) Nst=6 Rmat=(2.882252693 16.924112320 1.114207029 0.802115560 11.847808838) Rates=gamma Shape=0.4257 Pinvar=0.4273;
Bootstrap search=NJ nreps=1000 conLevel=50;
saveTrees from=1 to=1 file=nj.tre saveBootP=nodeLabels maxDecimals=1 replace=yes;
q
Open nj.tre with FigTree.