[genoPlotR-help] tuning genoPlotR to output a nice pic of genome alignment

Lionel Guy lionel.guy at icm.uu.se
Mon Dec 17 09:55:07 CET 2012


Hi Jian-Feng,

Sorry for my late answer.

On 12/13/2012 08:05 PM, Mao Jianfeng wrote:

> Firstly, the plot with tree was different from plot I generated
> by Mauve (see file in attachments).

You are missing the segments that are not common to all viruses. By 
default, genoplotr reads only common blocks in mauve, and to change this 
behavior, you should use the common_blocks_only=FAlSE when reading mauve 
blocks:

back.test <- read_mauve_backbone("align_test.backbone", ref=1, 
common_blocks_only=FALSE)


> I do not know why. Secondly, even I
> carefully checked the labels, I still can not generate plot with tree
> and taxon labels.

The names of the tree leaves and the names of the dna_segs must be 
exactly the same, and they are not in your case (on the left the names 
of dna_segs labels and on the right the names of the leaves of the tree):

cbind(sort(names), sort(names(tree$leaves)))

       [,1]         [,2]
  [1,] "AB045371"   "AB045371"
  [2,] "D21829"     "AB0453710"
  [3,] "EU095327"   "AB0453711"
  [4,] "FR694186"   "AB0453712"
  [5,] "GR65cg1"    "AB0453713"
  [6,] "GR65cg10"   "AB0453714"
  [7,] "GR65cg11"   "AB0453715"
  [8,] "GR65cg12"   "AB0453716"
  [9,] "GR65cg13"   "AB0453717"
[10,] "GR65cg14"   "AB0453718"
[11,] "GR65cg15"   "AB0453719"
[12,] "GR65cg16"   "D21829"
[13,] "GR65cg17"   "D218290"
[14,] "GR65cg18"   "D218291"
[15,] "GR65cg19"   "D218292"
[16,] "GR65cg2"    "D218293"
[17,] "GR65cg20"   "D218294"
[18,] "GR65cg21"   "D218295"
[19,] "GR65cg23"   "D218296"
[20,] "GR65cg24"   "D218297"
[21,] "GR65cg25"   "D218298"
[22,] "GR65cg26"   "D218299"
[23,] "GR65cg27em" "EU095327"
[24,] "GR65cg29"   "EU0953270"
[25,] "GR65cg3"    "EU0953271"
[26,] "GR65cg4"    "EU0953272"
[27,] "GR65cg5"    "EU0953273"
[28,] "GR65cg6"    "EU0953274"
[29,] "GR65cg7"    "EU0953275"
[30,] "GR65cg8"    "EU0953276"
[31,] "GR65cg9"    "EU0953277"
[32,] "HE963831"   "EU0953278"
[33,] "HQ339956"   "FR694186"
[34,] "HQ339957"   "GR65cg1"
[35,] "HQ339958"   "GR65cg10"
[36,] "HQ339959"   "GR65cg11"
[37,] "JF946772"   "GR65cg12"
[38,] "JF946775"   "GR65cg13"

If you fix that, you should get your tree OK.

Regards,

Lionel

> I provided the R codes I used, and also my Mauve output. Could you
> please show me any directions. so that I could utilize genoPlotR on my
> study?
>
> Thanks in advance.
>
> Looking forward to hearing from you.
>
> Best wishes,
> Jian-Feng,
>
> ###################################################
> # R codes I used to play with genoPlotR with my data
>
> tree <-
> newick2phylog("(D218294:0.092629,(((D218296:0.0600276,GR65cg11:0.0497435):0.00627571,((EU0953271:0.031623,AB0453719:0.0297768):0.0235929,D218297:0.0539989):0.00787974):0.000262991,(((((((AB0453717:0.0340463,GR65cg10:0.0337407):0.0221453,GR65cg12:0.052427):0.0168513,((((D218293:0.031466,AB045371:0.0329744):0.00545199,EU0953270:0.0363941):0.0168608,(((D218299:0.0135892,D218291:0.00609321):0.0117221,D218290:0.0258321):0.0107943,AB0453712:0.0307252):0.0252526):0.00602353,((AB0453710:0.0225068,GR65cg13:0.0193662):0.0207505,AB0453718:0.0351072):0.0217444):0.0202672):0.0016361,((((EU0953276:0.0606487,EU0953274:0.0563303):0.0191049,(EU0953275:0.0615455,EU0953273:0.0486024):0.0213853):0.0152609,(((AB0453714:0.0304607,AB0453713:0.0222551):0.0177242,D218295:0.0384321):0.0185061,AB0453715:0.0547435):0.0244685):0.0127381,(EU0953278:0.0216478,EU0953277:0.0155352):0.0573174):0.00614106):0.00503589,((D218292:0.0440649,AB0453711:0.0479036):0.00499205,(EU095327:0.0856525,D21829:0.0177098):0.
 0403122):
0.00794307):0.00218054,((EU0953272:0.0444053,D218298:0.0560383):0.0154274,AB0453716:0.0541032):0.00408229):0.00224245,(GR65cg1:0.0582659,FR694186:0.0572102):0.000557907):0.000557907):0.00806676);")
>
> back.test <- read_mauve_backbone("align_test.backbone", ref= 1)
>
> names <- c("AB045371", "D21829", "EU095327", "FR694186", "GR65cg1",
> "GR65cg10", "GR65cg11", "GR65cg12", "GR65cg13", "GR65cg14", "GR65cg15",
> "GR65cg16", "GR65cg17", "GR65cg18", "GR65cg19", "GR65cg2", "GR65cg20",
> "GR65cg21", "GR65cg23", "GR65cg24", "GR65cg25", "GR65cg26",
> "GR65cg27em", "GR65cg29", "GR65cg3", "GR65cg4", "GR65cg5", "GR65cg6",
> "GR65cg7", "GR65cg8", "GR65cg9", "HE963831", "HQ339956", "HQ339957",
> "HQ339958", "HQ339959", "JF946772", "JF946775")
>
> names(back.test$dna_seg) <- names
>
> # Calculating the lengths by adding the length on both sides of the
> comparisons
> for (i in 1:length(back.test$comparisons)){
>       cmp <- back.test$comparisons[[i]]
>       back.test$comparisons[[i]]$length <- abs(cmp$end1 - cmp$start1) +
> abs(cmp$end2 - cmp$start2)
>     }
>
> plot_gene_map(dna_segs=back.test$dna_segs, tree=tree,
>                comparisons=back.test$comparisons,
>                global_color_scheme=c("length", "increasing", "red_blue",
> 0.7),
>                dna_seg_labels = names,
>                override_color_schemes=TRUE)
>


More information about the genoPlotR-help mailing list