Fix MEGA11 nexus file for MrBayes
Published:
I used to use PGDspider to convert fasta file to nexus file for phylogenetic analysis in MrBayes. However, after updating my macOS system, the java is not working anymore and thus PGDspider is not an option for me.
I tried use MEGA11 to open fasta and then export to nexus file. However, MrBayes shows an error:
No valid match for argument “nucleotide”
Invalid data type argument
Error when setting parameter “Datatype” (2)
Finally I figured it out. The part “datatype=nucleotide” in the MEGA11 exported nexus file is causing the issue. You just need to modify it to be “datatype=dna”. Now it’s perfectly fine for MrBayes. Also make sure you first quit the MrBayes program (by typing q) and restart mb before you execute this modified nexus file.