ape-phylo

How to colour the branches of an unrooted tree using a variable in R

我只是一个虾纸丫 提交于 2021-01-27 20:50:59
问题 I would like to generated unrooted neighbour joining trees from input haplotype data, and then colour the branches of the trees based on a variable. I am using the packages Ape and ggtree. The haplotypes and co-variables (metadata) are on two separate files with matching sample names. I have been able to produce trees and colour the tips of the trees by variables, but not the tree branches. Using mock data - # Packages library('ggplot2') library('ape') library('phangorn') library('dplyr')

Coloured lines for tangelgram - package ape function cophyloplot

旧街凉风 提交于 2019-12-24 06:58:08
问题 I am trying to do a phylogenetic comparison of two trees which contain the same taxa. I want to colour the connections based on isolation site. I had thought I had performed this successfully but there is error in my work flow i.e. the coloured lines are not corresponding to isolation site accurately . I was wondering if you have any insights, please find my reproducible example below. site <- structure(list(name = structure(c(1L, 3L, 4L, 5L, 6L, 7L, 8L,9L, 10L, 2L), .Label = c("t1", "t10",

Node labels on circular phylogenetic tree

我与影子孤独终老i 提交于 2019-12-04 09:59:47
I am trying to create circular phylogenetic tree. I have this part of code: fit<- hclust(dist(Data[,-4]), method = "complete", members = NULL) nclus= 3 color=c('red','blue','green') color_list=rep(color,nclus/length(color)) clus=cutree(fit,nclus) plot(as.phylo(fit),type='fan',tip.color=color_list[clus],label.offset=0.2,no.margin=TRUE, cex=0.70, show.node.label = TRUE) And this is result: Also I am trying to show label for each node and to color branches. Any suggestion how to do that? Thanks! When you say "color branches" I assume you mean color the edges. This seems to work, but I have to

How to plot Pie charts in haploNet Haplotype Networks {pegas}

怎甘沉沦 提交于 2019-11-28 09:32:26
I'm trying to use haploNet function of {pegas} to plot a haplotype network, but i`m having trouble putting equal haplotypes from different populations in a same piechart. I can build a haplotype net with the following script: x <- read.dna(file="x.fas",format="fasta") h <- haplotype(x) net <- haploNet(h) plot(net) I'd like to set in the dnabin data the label of the original population of each taxa, so i could have piecharts of different colors (of haplotypes from different populations) in the resulting network. I'd like also to remove overlapping circles in the resulting haplotype network.

How to plot Pie charts in haploNet Haplotype Networks {pegas}

霸气de小男生 提交于 2019-11-27 02:59:58
问题 I'm trying to use haploNet function of {pegas} to plot a haplotype network, but i`m having trouble putting equal haplotypes from different populations in a same piechart. I can build a haplotype net with the following script: x <- read.dna(file="x.fas",format="fasta") h <- haplotype(x) net <- haploNet(h) plot(net) I'd like to set in the dnabin data the label of the original population of each taxa, so i could have piecharts of different colors (of haplotypes from different populations) in the