I have the following nexus tree:

      #nexus
begin trees;
  tree one = (Argentina/C97133/2020[&clade_membership=20B,num_date=2020.886612021858,num_date_CI={2020.886612021858,2020.886612021858},pangolin_lineage=P.2,localidade=South America,division=Argentina,country=Argentina,region=South America,host=Human,age=49,sex=Male,recency=Older,division_exposure=Argentina,region_exposure=South America,subclade_membership=20B/S.484K,div=23]:0.022244654877567882,(Brazil/AM-21143316HC/2021[&clade_membership=20B,num_date=2021.009589041096,num_date_CI={2021.009589041096,2021.009589041096},pangolin_lineage=P.2,localidade=Brazil,location=Manaus,division=Amazonas BR,country=Brazil,region=South America,host=Human,age=35,sex=Male,recency=One week ago,division_exposure=Amazonas BR,region_exposure=South America,subclade_membership=20B/S.484K,div=23]:0.06563654070760094,Brazil/AM-L87-CD2680/2020[&clade_membership=20B,num_date=2020.9767759562842,num_date_CI={2020.9767759562842,2020.9767759562842},pangolin_lineage=B.1.1.28,localidade=Brazil,location=Manaus,division=Amazonas BR,country=Brazil,region=South America,host=Human,recency=One week ago,division_exposure=Amazonas BR,region_exposure=South America,subclade_membership=20B/S.484K,div=23]:0.03282345589582292)NODE_0004335[&clade_membership=20B,num_date=2020.9439525003884,num_date_CI={2020.7799157869863,2020.9690196954846},localidade=Brazil,subclade_membership=20B/S.484K,div=22]:0.0795851334080453)NODE_0002344[&clade_membership=20B,num_date=2020.8643673669803,num_date_CI={2020.784333364771,2020.886612021858},localidade=Brazil,subclade_membership=20B/S.484K,div=22]:0;
end;

I want to draw a tree using R or python as the following picture: ibb.co/YZcnvc9

I read it using ggtree, but I was not able to color the internal branches using the "ancestral" data of "localidade".
Could you help me to automatically color the internal branches using this data?
Thank you.



Source link