Skip to content

get read.beast to santise headers#136

Open
brj1 wants to merge 1 commit into
YuLab-SMU:develfrom
brj1:devel
Open

get read.beast to santise headers#136
brj1 wants to merge 1 commit into
YuLab-SMU:develfrom
brj1:devel

Conversation

@brj1

@brj1 brj1 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

BEAST2 by default puts partition names into parameter names in the fields. This means that output trees will often look as follows (this example is not real beast2 output, but is similar to what they look like):

begin taxa;
        DIMENSIONS NTAX = 4;
        TAXLABELS
a
b
c
d
        ;
END;
BEGIN TREES;
translate;
1 a
2 b
3 c
4 d
;
tree * UNTITLED = [&R] ((1[&blockcount.t:hi=0,blockstart.t:hi=0.2,blockend.t:hi=0.2]:1,2[&blockcount.t:hi=-1,blockstart.t:hi=0.5,blockend.t:hi=0.5]:1)[&blockcount.t:hi=-1,blockstart.t:hi=0.5,blockend.t:hi=0.5]:1,(3[&blockcount.t:hi=2,blockstart.t:hi=0.1,blockend.t:hi=0.5]:2,4[&blockcount.t:hi=1,blockstart.t:hi=0.5,blockend.t:hi=0.75]:1)[&blockcount.t:hi=0,blockstart.t:hi=0.5,blockend.t:hi=0.5]:1);
end;

Note the :hi appended to the parameter names. I've changed read.beast to strip these partition names when it reads in the file. Otherwise, it doesn't parse the parameters correctly since it splits the nodes on :s.

I also added a bit more logging for the verbose flag since running read.nexus can sometimes take a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant