Nexus Character Data Files in the Tutorials: How to do that???

131 views
Skip to first unread message

jonnations

unread,
Sep 11, 2019, 10:56:41 AM9/11/19
to revbayes-users
Hi,

Very simple, and possibly stupid question.... How to the developers make the .nex character data files like the ones found in the tutorials? Presumably the data came from .csv or other data.frame type formats.

I've had a lot of problems reading in character data to Rev, but the Nexus files usually work perfectly. Ive just manufactured my own for 1 trait datasets, but now i have a 10 trait dataset and I'd like to learn a good way to construct those from data.frames or matrices.

I haven't had luck with write.nexus.data() in ape or writeNexus in Rev.

Thanks!!
Jon

jonnations

unread,
Sep 11, 2019, 10:59:01 AM9/11/19
to revbayes-users
In case it's unclear, I'm speaking about character trail files like haemulidae_trophic_traits.nex 

Ziad Khouri

unread,
Sep 13, 2019, 7:43:33 PM9/13/19
to revbayes-users
Hi Jon,

If you provide an example file you would like converted to a revbayes-readable nexus, I'll be happy to try to help.

In general, use a header something like the following:

#NEXUS
BEGIN DATA;
DIMENSIONS  NCHAR=576 NTAX=300;
FORMAT DATATYPE=STANDARD GAP=- MISSING=? SYMBOLS="01";

then add your matrix block, and don't include anything else. RevBayes often has issues reading other information often added to nexus files like partition schemes etc.

Best,

Ziad
Reply all
Reply to author
Forward
0 new messages