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. JSP课设:学生选课系统(附源码+调试)

    JSP学生选课管理系统学生选课管理系统功能概述(1)登录模块分为两种角色:学生角色.教师角色 (2)教师模块:选课管理功能为对课程信息(课程编号.名称.学分)进行添加.修改.删除操作:学生信息功能对学 ...

  2. H5在(支付宝和微信环境)使用支付

    首先是在支付宝浏览器环境   使用支付宝支付 参考链接 https://myjsapi.alipay.com/jsapi/native/trade-pay.html 支付宝订单字符串唤起支付  调用支 ...

  3. FIFO 串口接收处理机制

    与安富莱电子的串口处理机制做对比交互 参考链接: https://www.eet-china.com/mp/a161019.html

  4. docker打包nginx

    nginx镜像  localtime为/etc/localtime文件 给容器限定日志打印时间为北京时间 FROM nginx:stable-alpine MAINTAINER geyanan gey ...

  5. Nmap常见命令

    一测试环境 靶机:metasploitable2-linux  [下载地址]   IP:192.168.88.128 攻击机: kali   IP :192.168.88..131 二 Nmap命令 ...

  6. 模型 线框shader

    https://www.assetstore.unity3d.com/cn/?stay#!/content/21897

  7. Ubuntu20.04上用tmux管理新进程

    sudo apt-get install tmux 安装tmux tmux new -s session_name 新开一个会话 tmux a -t session_name 查看指定会话 tmux ...

  8. 为知笔记快速隐藏左侧 快捷键 Esc

    为知笔记快速隐藏左侧 快捷键 Esc

  9. Kubernetes--案例:使用Ingress发布tomcat

    假设有这样一套环境: Kubernetes集群上的tomcat-deploy控制器生成了两个运行于Pod资源中的tomcat实例,tomcat-svc是将它们统一暴露于集群中的访问入口.现在需要通过I ...

  10. ios怎么在自己公司网站扫描下载安装IPA安装包

    企业证书(或者99的证书,但是有100个设备限制)打包的IPA安装包,怎么发布给用户安装使用呢? 试了直接给用户.ipa包的链接,手机不能像安卓手机那样安装,平时我们测试放在蒲公英的包蒲公英应该是有做 ...