This repository has been archived by the owner on Aug 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.Rhistory
300 lines (300 loc) · 12.5 KB
/
.Rhistory
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
library(NGS.Tools.BICseq)
?run.bicseq.cnv.pipeline
set.seed(12345);
data.directories <- paste(.libPaths(), '/BoutrosLab.pipeline.bicseq', sep = '');
data.directories
data.directories <- c('./', data.directories);
data.directorie
data.directories
data.directories <- c(getwd(), data.directories);
data.directories
library(NGS.Tools.BICseq)
?run.bicseq.cnv.pipeline
set.seed(12345);
# create a list of potential locations for the datasets
data.directories <- paste(.libPaths(), '/NGS.Tools.BICseq', sep = '');
data.directories <- c('./', data.directories);
# look in the Rcheck directory to get dataset file
data.directories <- c(getwd(), data.directories);
# search all the locations for the normal file
file.checks <- file.exists(paste(data.directories, 'extdata/normal_sorted.bam', sep = '/'));
# check to see if the file was actually found
if (any(file.checks)) {
data.directory <- data.directories[order(file.checks, decreasing = TRUE)[1]];
} else {
stop('Unable to find dataset file for processing');
}
normal <- paste(data.directory, 'extdata/normal_sorted.bam', sep = '/');
normal
tumour
# search all the locations for the normal file
file.checks <- file.exists(paste(data.directories, 'extdata/tumor_sorted.bam', sep = '/'));
# check to see if the file was actually found
if (any(file.checks)) {
data.directory <- data.directories[order(file.checks, decreasing = TRUE)[1]];
} else {
stop('Unable to find dataset file for processing');
}
tumour <- paste(data.directory, 'extdata/tumor_sorted.bam', sep = '/');
tumour
run.bicseq.cnv.pipeline(
normal = normal,
tumour = tumour,
chr = c('chr22')
);
library(BICseq)
set.seed(12345);
# create a list of potential locations for the datasets
data.directories <- paste(.libPaths(), '/NGS.Tools.BICseq', sep = '');
data.directories <- c('./', data.directories);
# look in the Rcheck directory to get dataset file
data.directories <- c(getwd(), data.directories);
# search all the locations for the normal file
file.checks <- file.exists(paste(data.directories, 'extdata/normal_sorted.bam', sep = '/'));
# check to see if the file was actually found
if (any(file.checks)) {
data.directory <- data.directories[order(file.checks, decreasing = TRUE)[1]];
} else {
stop('Unable to find dataset file for processing');
}
normal <- paste(data.directory, 'extdata/normal_sorted.bam', sep = '/');
# search all the locations for the normal file
file.checks <- file.exists(paste(data.directories, 'extdata/tumor_sorted.bam', sep = '/'));
# check to see if the file was actually found
if (any(file.checks)) {
data.directory <- data.directories[order(file.checks, decreasing = TRUE)[1]];
} else {
stop('Unable to find dataset file for processing');
}
tumour <- paste(data.directory, 'extdata/tumor_sorted.bam', sep = '/');
data <- run.bicseq.cnv.pipeline(
normal = normal,
tumour = tumour,
chr = c('chr22')
);
q()
library(NGS.Tools.BICseq)
set.seed(12345);
# create a list of potential locations for the datasets
data.directories <- paste(.libPaths(), '/NGS.Tools.BICseq', sep = '');
data.directories <- c('./', data.directories);
# look in the Rcheck directory to get dataset file
data.directories <- c(getwd(), data.directories);
# search all the locations for the normal file
file.checks <- file.exists(paste(data.directories, 'extdata/normal_sorted.bam', sep = '/'));
# check to see if the file was actually found
if (any(file.checks)) {
data.directory <- data.directories[order(file.checks, decreasing = TRUE)[1]];
} else {
stop('Unable to find dataset file for processing');
}
normal <- paste(data.directory, 'extdata/normal_sorted.bam', sep = '/');
# search all the locations for the normal file
file.checks <- file.exists(paste(data.directories, 'extdata/tumor_sorted.bam', sep = '/'));
# check to see if the file was actually found
if (any(file.checks)) {
data.directory <- data.directories[order(file.checks, decreasing = TRUE)[1]];
} else {
stop('Unable to find dataset file for processing');
}
tumour <- paste(data.directory, 'extdata/tumor_sorted.bam', sep = '/');
data <- run.bicseq.cnv.pipeline(
normal = normal,
tumour = tumour,
chr = c('chr22')
);
str(data)
data$bins
head(data$bins)
str(data)
data$seg.summary
head(data$summary.seg))
str(data)
plot(data[[seg.summary]]$start, data[[seg.summary]]$ratio)
?plot
plot(x = data$seg.summary$start, y = data$seg.summary$ratio)
library(plotting.general)
?create.scatterplot
create.scatterplot(data = data$seg.summary, x = 'start', y = 'ratio')
create.scatterplot(data = data$seg.summary, x = 'start', y = 'ratio', ylab = 'Ratio', xlab = 'Start Position')
create.scatterplot(data = data$seg.summary, x = 'start', y = 'ratio', ylab = 'Ratio', xlab = 'Start Position') + geom_point(aes(size = log10.pvalue))
getwd()
tumour <- '/mnt/hpf/largeprojects//adam/ewings_genomes/LP6005727-DNA_B01/Assembly/LP6005727-DNA_B01.bam'
normal <- '/mnt/hpf/largeprojects/adam/ewings_genomes/LP6005726-DNA_B01/Assembly/LP6005726-DNA_B01.bam'
run.bicseq.cnv.pipeline(normal = normal, tumour = tumour, chr = 'chr22')
data <- run.bicseq.cnv.pipeline(normal = normal, tumour = tumour, chr = 'chr22')
head(data$seg.summary)
create.scatterplot(data = data$seg.summary, x = 'start', y = 'ratio', ylab = 'Ratio', xlab = 'Start Position') + geom_point(aes(size = log10.pvalue))
plot.object <- create.scatterplot(data = data$seg.summary, x = 'start', y = 'ratio', ylab = 'Ratio', xlab = 'Start Position') + geom_point(aes(size = log10.pvalue))
write.plot(filename = '~/Desktop/chr22_LP6005727_B01_cnv.pdf', plot = plot.object, resolution = 900, width = 10, height = 8)
library(DNACopy)
source("http://bioconductor.org/biocLite.R")
?BiocUpgrade
source("http://bioconductor.org/biocLite.R")
biocLite("BiocUpgrade")
source("http://bioconductor.org/biocLite.R")
biocLite("DNAcopy")
library(DNACopy)
library(DNAcopy)
ls()
head(data$seg.summary)
data$seg.summary$read_ratio <- data$seg.summary$sampleReads / data$seg.summary$referenceReads
head(data$seg.summary)
data$seg.summary$log2_read_ratio <- log2(data$seg.summary$sampleReads / data$seg.summary$referenceReads)
head(data$seg.summary)
create.scatterplot(data = data$seg.summary, x = 'start', y = 'log2_read_ratio', xlab = 'Start Position', ylab = 'log2_read_ratio') + geom_point(aes(size = log10.pvalue))
plot.object <- create.scatterplot(data = data$seg.summary, x = 'start', y = 'log2_read_ratio', xlab = 'Start Position', ylab = 'Read Ratio [log2]') + geom_point(aes(size = log10.pvalue))
?CNA
head(data)
head(data$seg.summary)
?CNA
data(coriell)
head(coriell)
?coriell
CNA.object <- CNA(cbind(coriell$Coriell.05296), coriell$Chromosome, coriell.Position, data.type = 'logratio', sampleid = 'c05296')
CNA.object <- CNA(cbind(coriell$Coriell.05296), coriell$Chromosome, coriell$Position, data.type = 'logratio', sampleid = 'c05296')
CNA.object
smoothed.CNA.object <- smooth.CNA(CNA.object)
smoothed.CNA.object
segment.smoothed.CNA.object <- segment(smoothed.CNA.object, verbose = 1)
segment.smoothed.CNA.object
plot(segment.smoothed.CNA.object, plot.type = 'w')
plot(CNA.object, plot.type = 'w')
str(CNA.object)
plot(CNA.object$c05296, plot.type = 'w')
segment.CNA.object <- segment(CNA.object, verbose = 1)
plot(segment.CNA.object, plot.type = 'w')
plot(segment.smoothed.CNA.object, plot.type = 'w')
head(data)
CNA.object <- CNA(cbind(data$seg.summary$log2_read_ratio), data$chrom, data$start, data.type = 'logratio', sampleid = 'B01')
CNA.object <- CNA(cbind(data$seg.summary$log2_read_ratio), data$chrom, as.numeric(data$start), data.type = 'logratio', sampleid = 'B01')
head(data$chrom)
head(data$Chrom)
names(data)
CNA.object <- CNA(cbind(data$seg.summary$log2_read_ratio), data$seg.summary$chrom, as.numeric(data$seg.summary$start), data.type = 'logratio', sampleid = 'B01')
head(CNA.object)
plot(CNA.object, plot.type = 'w')
segment.CNA.object <- segment(smoothed.CNA.object, verbose = 1)
plot(segment.CNA.object, plot.type = 'w')
segment.CNA.object <- segment(CNA.object, verbose = 1)
plot(segment.CNA.object, plot.type = 'w')
summary(data$seg.summary$log2_read_ratio)
summary(data$seg.summary$ratio)
CNA.object <- CNA(cbind(data$seg.summary$ratio), data$seg.summary$chrom, as.numeric(data$seg.summary$start), data.type = 'logratio', sampleid = 'B01')
segment.CNA.object <- segment(CNA.object, verbose = 1)
plot(segment.CNA.object, plot.type = 'w')
CNA.object <- CNA(cbind(data$seg.summary$log2_read_ratio), data$seg.summary$chrom, as.numeric(data$seg.summary$start), data.type = 'logratio', sampleid = 'B01')
segment.CNA.object <- segment(CNA.object, verbose = 1)
plot(segment.CNA.object, plot.type = 'w')
CNA.object <- CNA(cbind(data$seg.summary$read_ratio), data$seg.summary$chrom, as.numeric(data$seg.summary$start), data.type = 'logratio', sampleid = 'B01')
segment.CNA.object <- segment(CNA.object, verbose = 1)
plot(segment.CNA.object, plot.type = 'w')
smoothed.CNA.object <- smooth.CNA(CNA.object)
segment.smoothed.CNA.object <- segment(smoothed.CNA.object, verbose = 1)
plot(segment.CNA.object, plot.type = 'w')
segment.CNA.object
head(data$seg.summary)
dim(data$bin)
head(data$bin)
data$bin$log2ratio <- log2(data$bin$ratio)
head(data$bin$log2ratio)
log2(-0.6780)
CNA.object <- CNA(cbin(data$bin$ratio), data$bin$chrom, as.numeric(data$bin$start), data.type = 'ratio', sampleid = 'B01')
segment.CNA.object <- segment(CNA.object, verbose = 1)
plot(segment.CNA.object, plot.type = 'w')
CNA.object <- CNA(cbind(data$bin$ratio), data$bin$chrom, as.numeric(data$bin$start), data.type = 'ratio', sampleid = 'B01')
source('~/.active-rstudio-document', echo=TRUE)
smoothed.CNA.object <- smooth.CNA(CNA.object)
segment.smoothed.CNA.object <- segment(smoothed.CNA.object, verbose = 1)
plot(segment.smoothed.CNA.object, plot.type = 'w')
plot(segment.CNA.object, plot.type = 'w')
head(coriell)
?coriell
head(coriell)
sessionInfo()
dir()
library(NGS.Tools.BICseq)
Rprof
?Rprof
library(NGS.Tools.BICseq)
dir()
dir('./inst/extdata')
require(NGS.Tools.BICseq)
tumour <- 'inst/extdata/tumor_sorted.bam'
normal <- 'inst/extdata/normal_sorted.bam'
data <- NGS.Tools.BICseq::run.bicseq.cnv.pipeline(
tumour=tumour,
normal=normal
)
data <- NGS.Tools.BICseq::run.bicseq.cnv.pipeline(
tumour=tumour,
normal=normal,
chr='chr22'
)
head(data)
str(data)
plot(data$seg.summary)
plot(data$seg.summary$log10.pvalue)
segs <- getBICseq(object=data$object, bin=100, lambda=2, win=200, quant=0.95, mult=1)
library(BICseq)
segs <- getBICseq(object=data$object, bin=100, lambda=2, win=200, quant=0.95, mult=1)
segs <- getBICseg(object=data$object, bin=100, lambda=2, win=200, quant=0.95, mult=1)
head(segs)
str(segs)
plot(segs)
plot(segs, sampleName='Demo', save=FALSE, plotBin=TRUE, chromOrder=c(1:22, 'X', 'Y'))
plot(segs, sampleName='Demo', save=FALSE, plotBin=TRUE, chromOrder=c(22))
plot(segs, sampleName='Demo', save=FALSE, plotBin=TRUE, chromOrder=c('22'))
plot(segs, sampleName='Demo', save=FALSE, plotBin=TRUE, chromOrder=c('chr22'))
?getBICseg
sessionInfo()
getwd()
library(devtools)
load_all(pkg='.')
run.bicseq.cnv.pipeline
head(data)
tumour
normal
data <- run.bicseq.cnv.pipeline(tumour=tumour, normal=normal)
data <- run.bicseq.cnv.pipeline(tumour=tumour, normal=normal, chr='chr22')
str(data)
plot(data$segs)
plot(data$segs, plotBin = TRUE)
plot(data$segs, sampleName='Demo', plotBin=TRUE)
plot(data$segs, sampleName='Demo', plotBin=TRUE, save=FALSE)
BICseq::plot(data$segs, sampleName='Demo', plotBin=TRUE, save=FALSE)
getwd()
old.dir <- getwd()
setwd('/mnt/hpf//largeprojects/adam/projects//ewings_genomes/data/LP6005726-DNA_A01__LP6005727-DNA_A01/raw//wgs//illumina/')
dir()
tumour <- 'LP6005727-DNA_A01.bam'
normal <- 'LP6005726-DNA_A01.bam'
data <- run.bicseq.cnv.pipeline(tumour = tumour, normal = normal)
getwd()
ls()
head(segs)
str(segs)
segs
data$seg.summary
unique(data$seg.summary$chrom)
ls()
create.histogram
library(plotting.general)
create.histogram
default.histogram.theme(base_size = 24)
default.histogram.theme
names(sv_data)
q()
library(devtools)
load_all(pkg='.')
sessionInfo()
bicseq <- BICseq(sample=tumour.bam, reference=normal.bam, seqNames=c(1:22, 'X', 'Y'))
tumour.bam <- '/usr/local/src/bicseq/BICseq/test_data/tumor_sorted.bam'
normal.bam <- '/usr/local/src/bicseq/BICseq/test_data/normal_sorted.bam'
bicseq <- BICseq(sample=tumour.bam, reference=normal.bam, seqNames=c(1:22, 'X', 'Y'))
bicseq <- BICseq(sample=tumour.bam, reference=normal.bam, seqNames=c('chr22'))
segs <- getBICseg(object = bicseq, bin = 100, lambda = 2, winSize = 200, quant = 0.95, mult = 1)
segs <- BICseq::getBICseg(object = bicseq, bin = 100, lambda = 2, winSize = 200, quant = 0.95, mult = 1)
source('/usr/local/src/bicseq/BICseq/R Package/BICseq/R/SupportingFunctions.R')
segs <- BICseq::getBICseg(object = bicseq, bin = 100, lambda = 2, winSize = 200, quant = 0.95, mult = 1)
segs <- getBICseg(object = bicseq, bin = 100, lambda = 2, winSize = 200, quant = 0.95, mult = 1)