成品预览:
一、环境需求
R 及 Rstudio 的安装配置
一步一步安装及配置R及Rstudio(详细图文)
RCircos安装
options()$BioC_mirror options(BioC_mirror="https://mirrors.ustc.edu.cn/bioc/") options()$BioC_mirror if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") library(BiocManager)
BiocManager::install("RCircos",ask = F,update = Foptions()$BioC_mirror options(BioC_mirror="https://mirrors.ustc.edu.cn/bioc/") options()$BioC_mirror if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") library(BiocManager)
BiocManager::install("RCircos",ask = F,update = F)
|
二、绘制圈图
0.载入包
rm(list=ls())
library(RCircosrm(list=ls())
library(RCircos)
|
1.绘制人染色体圈图
data(UCSC.HG19.Human.CytoBandIdeogram)
cyto.info <- UCSC.HG19.Human.CytoBandIdeogram
chr.exclude <- NULL
tracks.inside <- 10
tracks.outside <- 0
RCircos.Set.Core.Components(cyto.info, chr.exclude,tracks.inside, tracks.outside)
RCircos.List.Plot.Parameters()
RCircos.Set.Plot.Area() RCircos.Chromosome.Ideogram.Plot(
data(UCSC.HG19.Human.CytoBandIdeogram)
cyto.info <- UCSC.HG19.Human.CytoBandIdeogram
chr.exclude <- NULL
tracks.inside <- 10
tracks.outside <- 0
RCircos.Set.Core.Components(cyto.info, chr.exclude,tracks.inside, tracks.outside)
RCircos.List.Plot.Parameters()
RCircos.Set.Plot.Area() RCircos.Chromosome.Ideogram.Plot()
|
数据格式:
绘制:
2.绘制基因
data(RCircos.Gene.Label.Data);
side <- "in";
track.num <- 1;
RCircos.Gene.Connector.Plot(RCircos.Gene.Label.Data, track.num, side);
name.col <- 4; track.num <- 2;
RCircos.Gene.Name.Plot(RCircos.Gene.Label.Data, name.col,track.num, side
data(RCircos.Gene.Label.Data);
side <- "in";
track.num <- 1;
RCircos.Gene.Connector.Plot(RCircos.Gene.Label.Data, track.num, side);
name.col <- 4; track.num <- 2;
RCircos.Gene.Name.Plot(RCircos.Gene.Label.Data, name.col,track.num, side);
|
数据格式:
绘制:
3.绘制热图
data(RCircos.Heatmap.Data);
data.col <- 6;
track.num <- 5;
side <- "in";
RCircos.Heatmap.Plot(RCircos.Heatmap.Data, data.col, track.num, side
data(RCircos.Heatmap.Data);
data.col <- 6;
track.num <- 5;
side <- "in";
RCircos.Heatmap.Plot(RCircos.Heatmap.Data, data.col, track.num, side);
|
数据格式:
绘制:
4.绘制散点图
data(RCircos.Scatter.Data);
data.col <- 5;
track.num <- 6;
side <- "in"
by.fold <- 1;
RCircos.Scatter.Plot(RCircos.Scatter.Data, data.col,track.num, side, by.fold
data(RCircos.Scatter.Data);
data.col <- 5;
track.num <- 6;
side <- "in"
by.fold <- 1;
RCircos.Scatter.Plot(RCircos.Scatter.Data, data.col,track.num, side, by.fold);
|
数据格式:
绘制:
5.绘制折线图
data(RCircos.Line.Data);
data.col <- 5;
track.num <- 7;
side <- "in";
RCircos.Line.Data$chromosome = paste0("chr",RCircos.Line.Data$chromosome)
RCircos.Line.Plot(RCircos.Line.Data, data.col, track.num, side
data(RCircos.Line.Data);
data.col <- 5;
track.num <- 7;
side <- "in";
RCircos.Line.Data$chromosome = paste0("chr",RCircos.Line.Data$chromosome)
RCircos.Line.Plot(RCircos.Line.Data, data.col, track.num, side);
|
数据格式:
绘制:
5.绘制直方图
data(RCircos.Histogram.Data);
data.col <- 4;
track.num <- 8;
side <- "in";
RCircos.Histogram.Plot(RCircos.Histogram.Data, data.col, track.num, side
data(RCircos.Histogram.Data);
data.col <- 4;
track.num <- 8;
side <- "in";
RCircos.Histogram.Plot(RCircos.Histogram.Data, data.col, track.num, side);
|
数据格式:
绘图:
6.绘制网络图
data(RCircos.Tile.Data);
track.num <- 9;
side <- "in";
RCircos.Tile.Plot(RCircos.Tile.Data, track.num, side
data(RCircos.Tile.Data);
track.num <- 9;
side <- "in";
RCircos.Tile.Plot(RCircos.Tile.Data, track.num, side);
|
数据格式:
绘图:
7.添加和弦图
data(RCircos.Link.Data);
track.num <- 11;
RCircos.Link.Plot(RCircos.Link.Data, track.num, TRUE);
data(RCircos.Ribbon.Data
data(RCircos.Link.Data);
track.num <- 11;
RCircos.Link.Plot(RCircos.Link.Data, track.num, TRUE);
data(RCircos.Ribbon.Data);
|
数据格式:
绘图:
三、导出PDF
点击 Export , 选择Save as PDF
修改导出大小,最好是正方形的,保存
会在根目录发现导出的圈图