Question: Genome Diagram in R
0
gravatar for lokraj2003
18 months ago by
lokraj200380
lokraj200380 wrote:

I want to create a genome diagram of a virus. I would like to show the name and position of the genes. I found there is a package called Genome Diagram in Biopython which can do that. But I was not able to use if because of the dependency issues also I am not very good at Python.

Is there any package in R/Bioconductor that would let me create genome or plasmid diagrams if I supply nucleotide position as input ?

R • 1.1k views
ADD COMMENTlink modified 18 months ago by h.mon29k • written 18 months ago by lokraj200380
1

Look at genPlotR, Sushi or karyoplotteR.

ADD REPLYlink written 18 months ago by h.mon29k

Thank you. I will check them.

ADD REPLYlink written 18 months ago by lokraj200380
3
gravatar for h.mon
18 months ago by
h.mon29k
Brazil
h.mon29k wrote:

An example with a package I just found, gggenes. The data is in a data frame called hoarc:

hoarc
                                  molecule start  end          gene  strand direction
1 Haloarcula hispanica pleomorphic virus 1     1 2352       unknown forward         1
2 Haloarcula hispanica pleomorphic virus 1  2435 2794       unknown forward         1
3 Haloarcula hispanica pleomorphic virus 1  2794 3195           VP3 forward         1
4 Haloarcula hispanica pleomorphic virus 1  2794 3195 VP4 precursor forward         1
5 Haloarcula hispanica pleomorphic virus 1  4805 5356       unknown forward         1
6 Haloarcula hispanica pleomorphic virus 1  5353 6201         gene6 forward         1
7 Haloarcula hispanica pleomorphic virus 1  6348 7340         gene7 forward         1
8 Haloarcula hispanica pleomorphic virus 1  7188 7811         gene8 reverse        -1

To plot:

library(ggplot2)
library(gggenes)
ggplot(subset(hoarc, molecule == "Haloarcula hispanica pleomorphic virus 1"),
       aes(xmin = start, xmax = end, y = molecule, fill = gene, forward = direction)) +
  geom_gene_arrow()

Haloarcula

It is not pretty right now, but with ggplot2 you have plenty of options to customize the plot to your needs.

ADD COMMENTlink modified 18 months ago • written 18 months ago by h.mon29k

Thank you @h.mon. I will play with it. I guess I will be able to modify this according to my need.

ADD REPLYlink written 18 months ago by lokraj200380
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1830 users visited in the last hour