Plotting genomic data using RCircos package

559 views Asked by At

I am trying to use the RCircos package in R to visualize links between genomic positions. I am unfamiliar with this package and have been using the package documentation available from the CRAN repository from 2016.

I have attempted to format my data according to the package requirements. Here is what it looks like:

> head(pts3)
  Chromosome ChromStart ChromEnd Chromosome.1 ChromStart.1 ChromEnd.1
1       chr1         33       34         chr1          216        217
2       chr1         33       34         chr1          789        790
3       chr1         33       34         chr1         1716       1717
4       chr1         33       34         chr1         1902       1903
5       chr1         33       34         chr2         2538       2539
6       chr1         33       34         chr2         4278       4279

Ultimately, I would like to produce a plot with tracks from ChromStart to ChromStart.1 and each gene labeled along the outside of the plot. I thought the script would look something like:

RCircos.Set.Core.Components(cyto.info = pts3,
                        chr.exclude = NULL,
                        tracks.inside = 1,
                        tracks.outside = 2)
RCircos.Set.Plot.Area()
RCircos.Chromosome.Ideogram.Plot()
RCircos.Link.Plot(link.data = pts3,
                track.num = 3,
                by.chromosome = FALSE)

It appears that to do so, I must first initialize with the RCircos.Set.Core.Components() function which requires positional information for each gene to pass to RCircos.Chromosome.Ideogram.Plot(). So, I created a second data frame containing the required information to pass to the function and this is the error that I get:

> head(genes)
  Chromosome ChromStart ChromEnd GeneName Band Stain
1       chr1          0     2342      PB2   NA    NA
2       chr2       2343     4683      PB1   NA    NA
3       chr3       4684     6917       PA   NA    NA
4       chr4       6918     8710       HA   NA    NA
5       chr5       8711    10276       NP   NA    NA
6       chr6      10277    11735       NA   NA    NA
> RCircos.Set.Core.Components(cyto.info = genes,
+                             chr.exclude = NULL,
+                             tracks.inside = 1,
+                             tracks.outside = 2)
Error in RCircos.Validate.Cyto.Info(cyto.info, chr.exclude) : 
  Cytoband start should be 0.

I don't actually have data for the Band or Stain columns and don't understand what they are for, but adding data to the those columns (such as 1:8 or chr1, chr2, etc) does not resolve the problem. Based on a recommendation from another forum, I also tried to reset the plot parameters for RCircos using the following functions, but it did not resolve the error:

core.chrom <- data.frame("Chromosome" = c("chr1", "chr2", "chr3", "chr4", "chr5", "chr6", "chr7", "chr8"),
                         "ChromStart" = c(0, 2343, 4684, 6918, 8711, 10277, 11736, 12763),
                         "ChromEnd" = c(2342, 4683, 6917, 8710, 10276, 11735, 12762, 13666),
                         "startLoc" = c(0, 2343, 4684, 6918, 8711, 10277, 11736, 12763),
                         "endLoc" = c(2342, 4683, 6917, 8710, 10276, 11735, 12762, 13666),
                         "Band" = NA,
                         "Stain" = NA)
RCircos.Reset.Plot.Ideogram(chrom.ideo = core.chrom)

Any advice would be deeply appreciated!

1

There are 1 answers

0
kingcohn1 On

I'm not sure if you figured this one out or moved on etc. I had the same problem and ended up resolving it by reformatting my start positions for each chromosome to 0 as opposed to a continuation of the previous chr. For you it would be:

  Chromosome ChromStart ChromEnd GeneName Band Stain
1       chr1          0     2342      PB2   NA    NA
2       chr2          0     2340      PB1   NA    NA
3       chr3          0     2233       PA   NA    NA

...etc