-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathOmicCircos
120 lines (95 loc) · 3.62 KB
/
OmicCircos
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
rm(list=ls())
setwd("C://Users/BECAUSEWECAN/Desktop")
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("OmicCircos")
library("OmicCircos")
options(stringsAsFactors=FALSE);
library(OmicCircos);
##inputhg19cytogeneticbanddata
data(UCSC.hg19.chr);
head(UCSC.hg19.chr);
#loadtheOmicCircos-package
data(TCGA.BC.gene.exp.2k.60);
head(TCGA.BC.gene.exp.2k.60[,c(1:50)]);
data1<-read.table("SNU4398set_expression.txt", header=T, sep="\t", na.strings = "NA", fill=T)
## TCGA fusion gene data
data(TCGA.BC.fus);
head(TCGA.BC.fus[,c(1:6)]);
data2<-read.table("SNU4398set_link.txt", header=T, sep="\t", na.strings = "NA", fill=T)
seg.num<-data(UCSC.hg19.chr)
------------------------sim.circos------------------------
options(stringsAsFactors=FALSE);
#loadtheOmicCircos-package
library(OmicCircos);
#setuptheinitialparameters
seg.num<-10;
ind.num<-20;
seg.po<-c(20:50);
link.num<-10;
link.pg.num<-10;
#runsim.circosfunction
sim.out<-sim.circos(seg=seg.num,po=seg.po,ind=ind.num,link=link.num,link.pg=link.pg.num);
write.table(sim.out, "simout.txt", sep="\t")
#displaythedatasetnames
names(sim.out)
#displaythesegmentdata
head(sim.out$seg.frame[,c(1:3)])
head(sim.out$seg.mapping[,c(1:5)])
head(sim.out$seg.link)
head(sim.out$seg.link.pg)
------------------------segAnglePo------------------------
library(OmicCircos);
options(stringsAsFactors=FALSE);
set.seed(1234);
##initialvaluesforsimulationdata
seg.num<-10;
ind.num<-20;
seg.po<-c(20:50);
link.num<-10;
link.pg.num<-4;
##outputsimulationdata
sim.out<-sim.circos(seg=seg.num,po=seg.po,ind=ind.num,link=link.num,link.pg=link.pg.num);
seg.f<-sim.out$seg.frame;
seg.v<-sim.out$seg.mapping;
link.v<-sim.out$seg.link
link.pg.v<-sim.out$seg.link.pg
seg.num<-length(unique(seg.f[,1]));
##selectsegments
seg.name<-paste("chr",1:seg.num,sep="");
db<-segAnglePo(seg.f,seg=seg.name);
db[,2] <- round(as.numeric(db[,2]), 3);
db[,3] <- round(as.numeric(db[,3]), 3);
db
###################################################
### code chunk number 10: OmicCircos_vignette.Rnw:372-390
###################################################
options(stringsAsFactors = FALSE);
library(OmicCircos);
set.seed(1234);
seg.num <- 10;
ind.num <- 20;
seg.po <- c(20:50);
link.num <- 10;
link.pg.num <- 4;
sim.out <- sim.circos(seg=seg.num, po=seg.po, ind=ind.num, link=link.num,
link.pg=link.pg.num);
seg.f <- sim.out$seg.frame;
seg.v <- sim.out$seg.mapping;
link.v <- sim.out$seg.link
link.pg.v <- sim.out$seg.link.pg
seg.num <- length(unique(seg.f[,1]));
seg.name <- paste("chr", 1:seg.num, sep="");
db <- segAnglePo(seg.f, seg=seg.name);
colors <- rainbow(seg.num, alpha=0.5);
par(mar=c(0, 0, 0, 0));
plot(c(1,800), c(1,800), type="n", axes=FALSE, xlab="", ylab="", main="");
circos(R=400, cir=db, type="chr", col=colors, print.chr.lab=TRUE, W=4, scale=TRUE);
circos(R=360, cir=db, W=40, mapping=seg.v, col.v=3, type="l", B=TRUE, col=colors[1], lwd=2, scale=TRUE);
circos(R=320, cir=db, W=40, mapping=seg.v, col.v=3, type="ls", B=FALSE, col=colors[9], lwd=2, scale=TRUE);
circos(R=280, cir=db, W=40, mapping=seg.v, col.v=3, type="lh", B=TRUE, col=colors[7], lwd=2, scale=TRUE);
circos(R=240, cir=db, W=40, mapping=seg.v, col.v=19, type="ml", B=FALSE, col=colors, lwd=2, scale=TRUE);
circos(R=200, cir=db, W=40, mapping=seg.v, col.v=19, type="ml2", B=TRUE, col=colors, lwd=2);
circos(R=160, cir=db, W=40, mapping=seg.v, col.v=19, type="ml3", B=FALSE, cutoff=5, lwd=2);
circos(R=150, cir=db, W=40, mapping=link.v, type="link", lwd=2, col=colors[c(1,7)]);
circos(R=150, cir=db, W=40, mapping=link.pg.v, type="link.pg", lwd=2, col=sample(colors,link.pg.num));