Skip to content

Instantly share code, notes, and snippets.

@yannickwurm
Last active August 29, 2015 14:09
Show Gist options
  • Save yannickwurm/41eea6759d3e660ee5e2 to your computer and use it in GitHub Desktop.
Save yannickwurm/41eea6759d3e660ee5e2 to your computer and use it in GitHub Desktop.
# modified from : http://daisukeichikawa.blogspot.co.uk/2014/03/try-circlize-package.html
#########
library(circlize)
par(mar = c(1, 1, 1, 1))
factors = as.factor(c("scaffold1", "scaffold2"))
circos.par(points.overflow.warning = FALSE)
# initialize
circos.initialize(factors = factors, sector.width= c(100, 500), xlim = c(0, 10))
circos.trackPlotRegion(factors = factors, ylim = c(0, 1), bg.col = "grey",
bg.border = NA, track.height = 0.05)
# linking between elements
circos.link(sector.index1='scaffold1', point1=80, sector.index2='scaffold2', point2=240)
circos.link(sector.index1='scaffold2', point1=480, sector.index2='scaffold2', point2=10)
### not quite putting links where expected
# RCircos
library(RCircos)
chromosome.data = data.frame( Chromosome = c('scaf1', 'scaf2'), chromStart=c(0,0), chromEnd=c(10000,50000))
chromosome.data$Band = "a"
chromosome.data$Stain = 0
RCircos.Set.Core.Components(cyto.info=chromosome.data)
## gives weird error... how does one do this without a reference genome?
link.data = data.frame(Chromosome = c('scaf1', 'scaf2'),
chromStart = c(1000, 20000),
chromEnd = c(1100, 20500),
Chromosome.1 = c('scaf2', 'scaf2'),
chromStart = c(10000, 28000),
chromEnd = c(11000, 29000)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment