FIN=read.table(IN,header=TRUE)
circos.clear()
circos.par("start.degree" = 90)
circos.initialize("chrB", xlim = c(0, 171823))
circos.track(ylim = c(0, 1), bg.border = "white")
for (i in 1:nrow(FIN)){
COL1<- scales::alpha(ifelse(FIN[i,]$lib=="a","#4CAF50",ifelse(FIN[i,]$lib=="b","#FF6A6A","#00FA9A")),alpha=ifelse(FIN[i,]$lib=="a",0.8,ifelse(FIN[i,]$lib=="b",0.4,0.0)))
WID1<-ifelse(FIN[i,]$lib=="a",FIN[i,]$petnum/9,ifelse(FIN[i,]$lib=="b",FIN[i,]$petnum/10,FIN[i,]$petnum/10))
mid1<-FIN[i,]$start1+(FIN[i,]$end1-FIN[i,]$start1)/2
mid2<-FIN[i,]$start2+(FIN[i,]$end2-FIN[i,]$start2)/2
circos.link(FIN[i,]$chr1,mid1,FIN[i,]$chr2,mid2,lwd=WID1,col=COL1)} library(ggbio) N <- 100
library(GenomicRanges)
## ======================================================================
## simmulated GRanges
## ======================================================================
gr <- GRanges(seqnames =
sample(c("chr1", "chr2", "chr3"),
size = N, replace = TRUE),
IRanges(
start = sample(1:300, size = N, replace = TRUE),
width = sample(70:75, size = N,replace = TRUE)),
strand = sample(c("+", "-", "*"), size = N,
replace = TRUE),
value = rnorm(N, 10, 3), score = rnorm(N, 100, 30),
sample = sample(c("Normal", "Tumor"),
size = N, replace = TRUE),
pair = sample(letters, size = N,
replace = TRUE)) seqlengths(gr) <- c(400, 500, 700)
values(gr)$to.gr <- gr[sample(1:length(gr), size = length(gr))] ## doesn't pass gr to the ggplot
ggplot() + layout_circle(gr, geom = "ideo", fill = "gray70", radius = 7, trackWidth = 3) +
layout_circle(gr, geom = "bar", radius = 10, trackWidth = 4, aes(fill = score, y = score)) +
layout_circle(gr, geom = "point", color = "red", radius = 14,
trackWidth = 3, grid = TRUE, aes(y = score)) +
layout_circle(gr, geom = "link", linked.to = "to.gr", radius = 6,
trackWidth = 1) library(ggplot2)
ggplot(SIN,aes(start,score1))+
geom_line()+
geom_rect(xmin=0,xmax=max(SIN$score1),ymin=-100000,ymax=0,fill="red")+
coord_polar()
library(gcookbook) # Load gcookbook for the wind data set
ggplot(wind, aes(x = DirCat, fill = SpeedCat)) +
geom_histogram(binwidth = 15, boundary = -7.5) +
coord_polar() +
scale_x_continuous(limits = c(0,360))

circos plot in R的更多相关文章

  1. R语言plot函数参数合集

    最近用R语言画图,plot 函数是用的最多的函数,而他的参数非常繁多,由此总结一下,以供后续方便查阅. plot(x, y = NULL, type = "p", xlim = N ...

  2. 每R一点:层次聚类分析实例实战-dist、hclust、heatmap等(转)

    聚类分析:对样品或指标进行分类的一种分析方法,依据样本和指标已知特性进行分类.本节主要介绍层次聚类分析,一共包括3个部分,每个部分包括一个具体实战例子. 1.常规聚类过程: 一.首先用dist()函数 ...

  3. R语言学习——图形初阶之折线图与图形参数控制

    plot()是R中为对象作图的一个泛型函数(它的输出将根据所绘制对象类型的不同而变化):plot(x,y,type="b")表示将x置于横轴,y置于纵轴,绘制点集(x,y),然后使 ...

  4. python时间序列画图plot总结

    画图从直觉上来讲就是为了更加清晰的展示时序数据所呈现的规律(包括趋势,随时间变化的规律(一周.一个月.一年等等)和周期性规律),对于进一步选择时序分析模型至关重要.下面主要是基于pandas库总结一下 ...

  5. Create and format Word documents using R software and Reporters package

    http://www.sthda.com/english/wiki/create-and-format-word-documents-using-r-software-and-reporters-pa ...

  6. R语言常用命令集合

    help.start()//打开帮助文档 q()//推出函数 ls()//返回处于现在名空间的对象名称 rm()//清楚对象:rm(list=ls())清除所有内存数据 gc()//垃圾回收数据 sq ...

  7. matplotlib作图——plot() 线图

    线图 #定义 matplotlib.pyplot.plot() plot([x], y, [fmt], data=None, **kwargs) plot([x], y, [fmt], [x2], y ...

  8. Circos图

    Circos官网   http://circos.ca 在线绘图工具    http://mkweb.bcgsc.ca/tableviewer/visualize/ Circos图的诞生 Circos ...

  9. 共线性图 | Alluvial Diagrams | Parallel plot | Parallel Coordinates Plot

    最近有个需求需要画如下的图: 这些图的核心意思是一样的,就是connection,把不同的数据连到一起. 文章里把这图叫做共线性图,是按功能命名的,Google里搜不到. 搜到类似的,这个图叫 Par ...

  10. Python调用R编程——rpy2

    在Python调用R,最常见的方式是使用rpy2模块. 简介 模块 The package is made of several sub-packages or modules: rpy2.rinte ...

随机推荐

  1. [MicroPython ESP32] 内存分析

    [MicroPython ESP32] 内存分析 [(1)芯片:ESP32-WROOM-DA] 手册: https://www.espressif.com.cn/zh-hans/support/doc ...

  2. wand,week and 算法

    一般搜索的query比较短,但如果query比较长,如是一段文本,需要搜索相似的文本,这时候一般就需要wand算法,该算法在广告系统中有比较成熟的应该,主要是adsense场景,需要搜索一个页面内容的 ...

  3. Grafana + Prometheus + Mysqld_exporter 监控 Mysql

    最近研究了对于Mysql的监控,感觉Prometheus还是挺强大的,有各种适配的度量导出工具,Mysqld_exporter也是旗下的一款工具,可以在Prometheus官网下载. 因为本机电脑用的 ...

  4. pat乙级1011 A+B 和C

    #include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> int ...

  5. 3. Tooltip 工具提示

    1 <!DOCTYPE html> 2 <html lang="zh"> 3 <head> 4 <meta charset="U ...

  6. 一个严谨的STM32串口DMA发送接收机制

    关键点: 1.一个半接收机制 2.一个是寄存器的操作顺序 参考链接: https://www.eet-china.com/mp/a167050.html

  7. js判断数据类型 && 判断是否为标准json格式

    /** * 1. js判断对象的好方法 * 2. 判断是否为json格式化数据 * * Author: shujun * Date: 2020-8-09 */ import {print} from ...

  8. Oracle数据泵恢复用户数据实例

    我们测试环境经常会遇到恢复生产数据的情况,我一般比较习惯使用数据泵来搞,这个具体根据自己的业务形态选择适合自己的方式. 此次我们说的是完全恢复用户数据,具体步骤如下: 1.备份数据 expdp tes ...

  9. Dockerfile参考

    From openjdk:8u252-jdkENV MEMORY_SIZE {{ MEMORY_SIZE | default (1024) }}MENV PROJECT_NAME {{PROJECT_ ...

  10. JAVA LIST Stream流的用法

    最近在学习list流化的新写法 //我这里取的字段是Float类型的,你们需要缓存自己对应能进行计算的字段类型Integer dateCode = Integer.parseInt(DateUtil. ...