liamrevell / phytools

GNU General Public License v3.0
207 stars 56 forks source link

Imperfectly drawn tree-map (unrooted problem?) #66

Open AgustinPardo opened 4 years ago

AgustinPardo commented 4 years ago

Hello,

I am trying to make a tree-map plot.

I run this:

gps<-read.csv("/home/agustin/workspace/covid-19/mapeo_arbol/gps_data",header=TRUE)
rownames(gps) <- gps$ID
nwk=read.newick("/home/agustin/workspace/covid-19/mapeo_arbol/3arg_3close_ref.msa.fasta.treefile")
obj<-phylo.to.map(nwk,gps[1:7,2:3],database="worldHires", regions=c("usa"))

This is my gps_data file: ID,Lat,Lon hCoV-19_Argentina_C3013_2020_EPI_ISL_420598_2020-03-22,33.72000,-94.4000 hCoV-19_Argentina_PAIS_A003_2020_EPI_ISL_430795_2020-03-26,34.16822,-111.9309 hCoV-19_USA_TX-HMH0278_2020_EPI_ISL_434906_2020-03-27,34.16822,-111.9309 hCoV-19_Argentina_PAIS_A026_2020_EPI_ISL_430817_2020-04-18,47.27187,-100.2704 hCoV-19_Brazil_PA161548-IEC_2020_EPI_ISL_450874_2020-03-20,34.16822,-111.9309 NC_045512.2,47.27187,-100.2704 hCoV-19_Germany_BAV-MVP0042_2020_EPI_ISL_437241_2020-04-07,34.16822,-111.9309

This is my 3arg_3close_ref.msa.fasta.treefile file: (hCoV-19_Argentina_C3013_2020_EPI_ISL_420598_2020-03-22:0.332300,((hCoV-19_Argentina_PAIS_A003_2020_EPI_ISL_430795_2020-03-26:0.342152,hCoV-19_USA_TX-HMH0278_2020_EPI_ISL_434906_2020-03-27:0.672617):0.671097,((hCoV-19_Argentina_PAIS_A026_2020_EPI_ISL_430817_2020-04-18:0.674600,hCoV-19_Brazil_PA161548-IEC_2020_EPI_ISL_450874_2020-03-20:0.020138):0.0001677400,NC_045512.2:1.336200):0.010000):0.667200,hCoV-19_Germany_BAV-MVP0042_2020_EPI_ISL_437241_2020-04-07:0.674700);

I get this plot:

Screenshot from 2020-06-01 14-53-17

I am not able to properly display the phylogenetic tree above the map. It seems that the tree is around the map, instead of being above. When I create the R variable/object "nwk" says it is an "unrooted" tree: Screenshot from 2020-06-01 14-57-33

Do you know if that is the problem or how I could solve it? Do not take into account that the names say Argentina but are located in coordinates of the USA, it is only a toy model.

Regards Thanks for the great work!

Agustin