[genoPlotR-help] matching ordering of phylog or dna_segs object
Lionel Guy
lionel.guy at icm.uu.se
Wed Mar 12 21:41:27 CET 2014
Hi Migee,
There is no tutorial or method about that. One way to do that would the following:
Provided that your tree leaves and the names of your dna_segs are exactly the same (and are unique), you simply reorder the list containing the dna_segs according to the names of the leaves of the tree. For example, say you have 4 segments:
data(barto)
# I'm making a fake tree:
tree <- newick2phylog("(BQ:2.5,(BH:1.8,(BG:1,BB:0.8):1.9):3);")
plot(tree)
names(tree$leaves)
# The dna_segs are ordered differently:
names(barto$dna_segs)
# I can now reorder the list containing the dna_segs according to the names of the leaves
ds2 <- barto$dna_segs[names(tree$leaves)]
# Now the dna_segs are ordered as the leaves, and I can plot accordingly:
names(ds2)
names(tree$leaves)
plot_gene_map(ds2, tree=tree)
Now of course, the comparisons need to be done accordingly, thus you need to compute BQ vs BH, BH vs BG, and BG vs BB.
HTH,
Lionel
On 12 Mar 2014, at 19:00 , Migun Shakya <microbeatic at gmail.com> wrote:
> Hello,
>
> In the help page for `plot_dna-segs`, it is mentioned that the solution for matching large number of `lines` with the corresponding phylogenetic tree is to do the following:
>
> "The solution is then to provide segments that are ordered in the same manner as the tree labels (or vice-versa)."
>
>
> However, i can’t find an obvious way to do it for phylog object or the dna_segs.
>
> My question is, is there any tutorial or method in the genoplotR package that tells us how to do it.
>
>
> Thank you again
>
> Migee
> _______________________________________________
> genoPlotR-help mailing list
> genoPlotR-help at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genoplotr-help
--
Lionel Guy
Molecular Evolution, Uppsala University, Uppsala, Sweden
postal address: Box 596, SE-751 24 Uppsala; visiting address: BMC B7:213e, Husargatan 3, SE-752 37 Uppsala
phone: +46 18 471 6129, mobile +46 73 976 0618
lionel.guy at icm.uu.se
More information about the genoPlotR-help
mailing list