Plotting genomic data using RCircos package












1














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!










share|improve this question



























    1














    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!










    share|improve this question

























      1












      1








      1







      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!










      share|improve this question













      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!







      r circos






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 12 '18 at 20:50









      JennyJenny

      61




      61
























          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53269887%2fplotting-genomic-data-using-rcircos-package%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53269887%2fplotting-genomic-data-using-rcircos-package%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          Academy of Television Arts & Sciences

          L'Équipe

          1995 France bombings