jokergoo / circlize

Circular visualization in R
http://jokergoo.github.io/circlize_book/book/
Other
959 stars 141 forks source link

I can't get bed files to be annotated on my circos.plot #385

Closed mah238 closed 5 months ago

mah238 commented 6 months ago

Hi folks, any help with the below would be great!

library(circlize) library(tidyr) library(dplyr)

read in bed files and chr info

ce11.chrominfo <- read.chromInfo(species = "ce11")$df ce11.blacklist <- read.table("~/ce11-blacklist.bed") exp041.blacklist <- read.table("~/exp041_regions.bed")

format chrominfo

ce11.chrominfo$numeric_column <- seq_along(ce11.chrominfo$chr) circos.genomicInitialize(ce11.chrominfo)

regions i want to plot

head(exp041.blacklist) chr start end merged numeric_column 1 I 3791 3990 0.6699761 1 2 I 108248 108447 0.4364079 2 3 I 229262 229461 0.4780256 3 4 I 299759 299958 0.5817262 4 5 I 433607 433806 1.8433321 5 6 I 518568 518767 0.6194894 6

circos.genomicTrackPlotRegion(exp041.blacklist, ylim = c(0, 5), panel.fun = function(region, value, ...) { circos.genomicLines(region, value, type = "segment", lwd = 2, ...) })

this simply creates another ring inside the inital circos plot without adding any annotation of where they are.