[genoPlotR-help] genoPlotR question: visualizing an HPV reference genome

Gordon Robertson grobertson at bcgsc.ca
Mon Feb 2 21:25:50 CET 2015


Thank you. I get the same graphic on my Mac. The colours are good.

The issue that we're looking at is: drawing breakpoints between a virus and a human gene, where we've determined the breakpoints from RNAseq viral-human transcripts. So it's a visualization use case that's close to what genoPlotR is built to do.

I'm very focused on other aspects of the analysis, so do not have time to invest in good visualization in the short term.

Could I ask: if I have a list of viral breakpoints, e.g. coordinate 822, how would I draw a vertical line at this location, just below the current graphic? I've attached a fake set of lines, with the line length (height) indicating that some breakpoints have more evidence than others.

Gordon



On 2015-02-02, at 11:41 AM, Lionel Guy wrote:

Hi Gordon,

My complete code is:

library(genoPlotR)
hpv.df <- read_dna_seg_from_file("/Users/lguy/Desktop/tmp/HPV16.ref.PaVE.gbk", tagsToParse=c("CDS"), fileType = "detect", meta_lines = 2, gene_type = "blocks", header = TRUE, extra_fields = c("db_xref", "transl_table"))
hpv.df$col <- rainbow(nrow(hpv.df))
hpv.df$gene_type <- "arrows"
annot <- annotation(x1=middle(hpv.df), text=hpv.df$name, rot=0)
plot_gene_map(list(hpv.df), annotations=annot)

And it yields the following plot:

<PastedGraphic-1.png>

HTH,

Lionel
On 2 Feb 2015, at 17:58 , Gordon Robertson <grobertson at bcgsc.ca<mailto:grobertson at bcgsc.ca>> wrote:

Thank you. Your code generated a graphic with a single line of dark blue arrows (for genes), with gene symbols above the arrows. I've looked briefly at the vignette and the help page for gene_types, but I do not have time right now to work with this information.

Gordon




On 2015-02-01, at 11:48 PM, Lionel Guy wrote:

Hi Gordon,

I haven't worked extensively with eukaryotic sequences, so in some ways the gbk parser might be behaving strangely with spliced sequences, for example.
That being said, there are more blocks, they are just all the same color. Try

hpv.df$col <- rainbow(nrow(hdv.df))
hpv.df$gene_type <- "arrows"
annot <- annotation(x1=middle(hpv.df), text=hpv.df$name, rot=0)
plot_gene_map(list(hpv.df), annotations=annot)

that should help you see better.

To plot different genes on different lines, you'll either have to separate them on different dna_segs, or write your own plotting functions. See the vignette for genoPlotR or the help page for function gene_types

Kind regards,

Lionel


On 2 Feb 2015, at 0:04 , Gordon Robertson <grobertson at bcgsc.ca<mailto:grobertson at bcgsc.ca>> wrote:

Thanks Lionel

That worked. It gave me a two-block graphic (attached). What I'd like is something like the CDS (gene) view (attached). How would I get that?

Thanks,

Gordon
--
Gordon Robertson
Canada's Michael Smith Genome Sciences Centre
BC Cancer Agency
Vancouver BC Canada
www.bcgsc.ca<http://www.bcgsc.ca/>
T: 604-707-5900 x675416
Skype: a.gordon.robertson



On 2015-02-01, at 1:38 PM, Lionel Guy wrote:

Hi Gordon,

Thanks for your interest in genoPlotR.

The dna_segs argument of plot_gene_map should be a list of dna_seg objects. To plot one single dna_seg, use a list composed of a single dna_seg object:

plot_gene_map(list(hpv.df))

That should do the trick.
HTH,

Lionel


On 1 Feb 2015, at 21:17 , Gordon Robertson <agrobertson at telus.net<mailto:agrobertson at telus.net>> wrote:

Hi Lionel,

I'm exploring (assessing) the genoPlotR package as a simple and extensible way of drawing information on viral integration into human genes in cancer. There are a number of components to this. I'm trying to take a first step.

I'm also looking at the Gviz package.

As a first step I've downloaded an HPV16 reference genome Genbank-format file from PaVE (attached). The file loads easily into genoPlotR. Now I'd like to plot the genes in the genome.

library(genoPlotR)

# HPV16 reference genome
hpv.df <- read_dna_seg_from_file("/Users/grobertson/resources/genomic_data/viral/PaVE/HPV16.ref.PaVE.GenBank.format.txt", tagsToParse=c("CDS","misc_feature","gene"), fileType = "detect", meta_lines = 2, gene_type = "blocks", header = TRUE, extra_fields = c("db_xref", "transl_table"))

str(hpv.df)
# Classes ‘dna_seg’ and 'data.frame':  25 obs. of  19 variables:
#$ name        : chr  "E1" "E2" "E4" "E5_ALPHA" ...
#$ start       : num  865 2756 3333 3850 83 ...
#...

plot_gene_map(hpv.df)
Error in plot_gene_map(hpv.df) :
Argument dna_segs must be a list of dna_seg objects

Would you be willing to help me resolve this? I apologize for emailing so early in assessing your package, but I have very limited time for resolving this visualization issue. I'm using R 3.1.2 on OS X, and working in the latest RStudio.

Thank you.

Gordon
--
Gordon Robertson
agrobertson at telus.net<mailto:agrobertson at telus.net>



<HPV16.ref.PaVE.GenBank.format.txt>

--
Lionel Guy
Department for Medical Biochemistry and Microbiology, Uppsala University, Uppsala, Sweden
postal address: Box 582, SE-751 23 Uppsala; visiting address: BMC D7:3, Husargatan 3, SE-752 37 Uppsala
phone: +46 73 976 0618
lionel.guy at imbim.uu.se<mailto:lionel.guy at imbim.uu.se>


<screenshot_585.tif><PastedGraphic-1.pdf>

--
Lionel Guy
Department for Medical Biochemistry and Microbiology, Uppsala University, Uppsala, Sweden
postal address: Box 582, SE-751 23 Uppsala; visiting address: BMC D7:3, Husargatan 3, SE-752 37 Uppsala
phone: +46 73 976 0618
lionel.guy at imbim.uu.se<mailto:lionel.guy at imbim.uu.se>



--
Lionel Guy
Department for Medical Biochemistry and Microbiology, Uppsala University, Uppsala, Sweden
postal address: Box 582, SE-751 23 Uppsala; visiting address: BMC D7:3, Husargatan 3, SE-752 37 Uppsala
phone: +46 73 976 0618
lionel.guy at imbim.uu.se<mailto:lionel.guy at imbim.uu.se>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/genoplotr-help/attachments/20150202/9c086b62/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: screenshot_587.tif
Type: image/tif
Size: 11266 bytes
Desc: screenshot_587.tif
URL: <http://lists.r-forge.r-project.org/pipermail/genoplotr-help/attachments/20150202/9c086b62/attachment-0001.bin>


More information about the genoPlotR-help mailing list