Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7542423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:09:44+00:00 2026-05-30T08:09:44+00:00

The following is my data: chr <- rep (1:4, each = 200) position <-

  • 0

The following is my data:

chr <- rep (1:4, each = 200) 

position <- c(1:200, 1:200, 1:200, 1:200)

v1bar <- rnorm(800, 10, 2)

v2bar <- rnorm(800, 10, 2)

v3bar <- rnorm(800, 10, 2)

mydata <- data.frame (chr, position, v1bar, v2bar, v3bar)

I want to create multiple circular bar charts with the x value = pos and y value = v1bar, v2bar, v3bar (all three will be in successive circles). Each circle is divided to chr. Thus each circle has “pie slice”. I am not sure what such graph is known as and would it be possible to develop one. The following just rough sketch to illustrate my idea.

enter image description here

Edits: My assuption is someway similar to the following circos figure.

http://circos.ca/tutorials/images/zoom/8.8

EDITS:

In response to the following answer to David, this what I have imagined – chr not seperate circe but classifying as different slice (such as in circos figure)
enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T08:09:45+00:00Added an answer on May 30, 2026 at 8:09 am

    Since you are presenting chromosomes in a circular way, try the tools provided by the ecolitk package provided by Bioconductor, which includes tools for plotting various kinds of shapes on circular chromosomes.

    ETA: Here is an example of its use to create a circular bar plot, though it only scratches the surface of the things you can do with it.

    circular plot

    library(ecolitk)
    
    plot.new()
    plot.window(c(-5, 5), c(-5, 5))
    
    plot.chrom = function(data, chromlength, radius=1,
                            width=chromlength/length(data), ...) {
        linesCircle(radius, ...)
        starts = seq(1, chromlength - width, width)
    
        scale = .5 / max(abs(data))
        for (i in 1:length(starts)) {
            polygonChrom(starts[i], starts[i]+width, chromlength, radius,
                    data[i] * scale + radius, ...)
        }
    }
    
    plot.chrom(rnorm(100, 10, 1), 10000, radius=1)
    plot.chrom(rnorm(100, 10, 2), 10000, radius=2, col="blue")
    plot.chrom(rnorm(100, 10, 5), 10000, radius=3, col="red")
    plot.chrom(rnorm(100, 10, 10), 10000, radius=4, col="green")
    
    legend("topright", legend=c("chr1", "chr2", "chr3", "chr4"),
           col=c("black", "blue", "red", "green"), lty=1)
    

    ETA: Ah, now I understand what you meant about division of plots. In that case, this code should be what you’re looking for. It uses the data you present (with one slight modification- I had to give the chromosome column a name so I could use ddply with it) and allows you to specify the spacing between chromosomes. While I haven’t tested it in depth, varying things like the individual chromosome lengths and the mean and variance of the simulated data should work as you expect.

    Circular plot divided

    plot.multi.chrom = function(data, colors, spacing=50) {
        plot.new()
        plot.window(c(-5, 5), c(-5, 5))
    
        lengths = ddply(data, .(chr), function(x) max(x$position))
        nchrom = NROW(lengths)
        offsets = cumsum(c(0, lengths[, 2])) + cumsum(c(0, rep(spacing, nchrom)))
        tot.length = offsets[length(offsets)] + spacing
    
        scales = .75 / apply(abs(data[, 3:NCOL(data)]), 2, max)
    
        for (i in 1:NROW(data)) {
            for (j in 3:NCOL(data)) {
                start = offsets[data[i, 1]] + data[i, 2]
                polygonChrom(start, start + 1, tot.length,
                             j - 2, data[i, j] * scales[j - 2] + j - 2,
                             col=colors[j - 2])
            }
        }
    }
    
    chr <- rep (1:4, each = 200) 
    position <- c(1:200, 1:200, 1:200, 1:200)
    v1bar <- rnorm(800, 10, 2)
    v2bar <- rnorm(800, 10, 2)
    v3bar <- rnorm(800, 10, 2)
    mydata <- data.frame(chr=chr, position, v1bar, v2bar, v3bar)
    
     require(plyr) 
    
    plot.multi.chrom(mydata, colors=c("red", "black", "green"), spacing=50)
    
    legend("topright", legend=c("V1", "V2", "V3"),
           col=c("red", "black", "green"), lty=1)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following data in my table. alt text http://img26.imageshack.us/img26/3746/productfield.png I want to extract
I want to convert the following json and put the values into a data
I have the following data frame: data.frame(a = c(1,2,3),b = c(1,2,3)) a b 1
Suppose I have the following data.frame : foo <- data.frame(ocean=c('Atlantic', 'Pacific'), city=c('Boston', 'San Francisco'),
I have the following data frame z x y 1 1 a 2 2
I have the following data frame: A B C D Xax 0.451 0.333 0.034
I have the following data frame id<-c(1,1,1,1,2,2,2,2,3,3,3,3) time<-c(0,1,2,3,0,1,2,3,0,1,2,3) value<-c(1,1,6,1,2,6,2,2,1,1,6,1) d<-data.frame(id, time, value) The value
Suppose the following data schema: Usage ====== client_id resource type amount Billing ====== client_id
I have the following data structure (a list of lists) [ ['4', '21', '1',
Hi I have following data in the table: ID-----startDate----endDate 5549 2008-05-01 4712-12-31 5567 2008-04-17

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.