[genoPlotR-help] reading comparisons from blasts

Lionel Guy lionel.guy at ebc.uu.se
Thu May 12 17:29:59 CEST 2011


Hi Peter,

Your are not feeding your own dna_segs to the annotation function. The snippet used to create them here is highly example-dependent, and you need to adapt it to your needs. You may want to make a list of dna_segs and comparisons before plotting

You can try to use auto_annotate also. Try to change arguments to this function to fit your needs.

Try:

ds <- list (Mesostigma, Chlorokybus, Chara, Chaetosphaeridium, Zygnema, Staurastrum)
cp <- list (Mesostigma_vs_Chlorokybus, Chlorokybus_vs_Chara, Chara_vs_Chaetosphaeridium, Chaetosphaeridium_vs_Zygnema,
Zygnema_vs_Staurastrum

annots <- lapply(ds, auto_annotate)

And then plot with something like:

plot_gene_map(ds, cp, annotations=annots)

If it doesn't show anything, look into your annotations (str(annots)) and see if there is something or not. Try to play with the auto_annotate command...

Cheers

Lionel

On 12 May 2011, at 17:00 , Peter Neofotis wrote:

> Dr. Guy, 
> 
> Thank you so much for your help. It is greatly appreciated. You are wonderful. 
> 
> So, I was able to get "something" with the following script (pasted below)
> 
> Even with the tblastx, though, I did not get much overlap. I'm fine with that, though.  
> 
> However, I am a bit concerned because my figure does not have the gene annotations - which is what I was most interested in getting. In looking in the manual, I am thinking perhaps I need to also load rnt_segs - but I am not sure what these files are and how I should load them into the script. 
> 
> I believe I need to do this, though, to get the notations that I see on page 12 (Example4) of your vignette. 
> 
> Once again I greatly appreciate your help with using this package. I hope to pass the information on. 
> 
> Best, 
> 
> Peter 
> 
> library(genoPlotR)
> 
> Mesostigma <- try(read_dna_seg_from_file("/Users/pgn6/Desktop/R/Mesostigma_viride.gb"))
> Chlorokybus <- try(read_dna_seg_from_file("/Users/pgn6/Desktop/R/Chlorokybus_atmophyticus_chloroplast.gb")) 
> Chara <- try(read_dna_seg_from_file("/Users/pgn6/Desktop/R/Chara_vulgaris_Chloroplast.gb"))
> Chaetosphaeridium <- try(read_dna_seg_from_file("/Users/pgn6/Desktop/R/Chaetosphaeridium_globosum.gb"))
> Zygnema <- try(read_dna_seg_from_file("/Users/pgn6/Desktop/R/Zygnema_circumcarinatum_Chloroplast.gb"))
> Staurastrum <- try(read_dna_seg_from_file("/Users/pgn6/Desktop/R/Staurastrum_punctulatumChloroplastGenome.gb"))
> 
> Mesostigma_vs_Chlorokybus <- try(read_comparison_from_blast("/Users/pgn6/Desktop/R/Mesostigma_vs_Chlorokybus_tblastx.txt"))
> Chlorokybus_vs_Chara <- try(read_comparison_from_blast("/Users/pgn6/Desktop/R/Chlorokybus_vs_Chara_tblastx.txt"))
> Chara_vs_Chaetosphaeridium <- try(read_comparison_from_blast ("/Users/pgn6/Desktop/R/Chara_vs_Chaetosphaeridium_tblastx.txt"))
> Chaetosphaeridium_vs_Zygnema <- try (read_comparison_from_blast ("/Users/pgn6/Desktop/R/Chaetosphaeridium_vs_Zygnema_tblastx.txt"))
> Zygnema_vs_Staurastrum <- try(read_comparison_from_blast ("/Users/pgn6/Desktop/R/Zygnema_vs_Staurastrum_tblastx.txt"))
> 
> ## Tree
> tree_algae <- newick2phylog("((((Staurastrum, Zygnema), Chaetosphaeridium), Chara), Chlorokybus, Mesostigma);")
> 
> xlims<- list (c(112304, 118360), c(144615, 152254), c(174015, 184933), c(130683, 130937), c(165301, 165372), c(156101, 157089))
> 
> annots <- lapply(dna_segs, function(x) {
> 	mid <- middle(x)
> 	annot <- annotation (x1 = mid, text = x$name, rot= 30)
> 	idx <- grep ("^[^B]", annot$text, perl=TRUE)
> 	annot[idx[idx%%1==0],]
> 	})
> 
> plot_gene_map (dna_segs=list (Mesostigma, Chlorokybus, Chara, Chaetosphaeridium, Zygnema, Staurastrum), comparison = list (Mesostigma_vs_Chlorokybus, Chlorokybus_vs_Chara, Chara_vs_Chaetosphaeridium, Chaetosphaeridium_vs_Zygnema,
> Zygnema_vs_Staurastrum), xlims=xlims, main = "Charaphyte Algae Internal Repeat", gene_type = "side_blocks", limit_to_longest_dna_seg = FALSE, dna_seg_scale = TRUE, scale = FALSE)	
> 
> 
> 
> 
> 
> On Wed, May 11, 2011 at 12:18 PM, Lionel Guy <lionel.guy at ebc.uu.se> wrote:
> Hi Peter,
> 
> On 11 May 2011, at 18:02 , Peter Neofotis wrote:
> 
> > I am stuck, though, on how to make the figure that you do in Example 4 of your vignette. I think my main confusion is that although you say you do the "comparison between four Bartonelle genomes using BLAST) it is not clear how this data is formatted when you load it for data(barto) - so I am confused when starting from scratch with my own data (from BLAST).
> 
> You can find a complete description of the "barto" dataset by getting help on the barto object
> > library(genoPlotR)
> > ?barto
> 
> In short, it loads a barto object which is a list of 3, including
> - a list of 4 dna_seg object
> - a list of 3 comparisons
> - a further list of dna_segs that is not needed here
> 
> > Charophyte_Algae <- try(read_comparison_from_blast("/Users/pgn6/Desktop/R/CharaphyteAlgaeBlast.txt"))
> 
> You are loading only one file, whereas you should have one file per comparison (i.e Mesostigma_vs_Chlorokybus, Chlorokybus_vs_Chara, etc..)
> > comp1 <- read_comparison_from_blast("Mesostigma_vs_Chlorokybus.blast")
> > comp2 <- ...
> 
> > ## Plotting - this is the part that does not work.
> > plot_gene_map(dna_segs=list (Mesostigma, Chlorokybus, Chara, Chaetosphaeridium, Zygnema, Staurastrum), comparison = list(Charophyte_Algae), xlims=xlims, main = "Charaphyte Algae Internal Repeat", gene_type = "side_blocks", dna_seg_scale = TRUE, scale = FALSE)
> 
> And here you need to have comparison=list(comp1, comp2, ...).
> 
> In addition, looking at your files, it seems you are doing blastn, which is likely to yield very few results for organisms that are so far away. Try tblastx instead.
> 
> HTH,
> 
> Lionel
> 







More information about the genoPlotR-help mailing list