|
1 | 1 | #!/usr/bin/env Rscript |
2 | 2 |
|
3 | | -# cbs_smurf.r: xxxxxx |
| 3 | +# cnvAnalysis.R: Adapted from "SRR054616.cbs.r" supplemetary program |
| 4 | +# 12 of Baslan, Timour, et al. "Genome-wide copy number analysis of |
| 5 | +# single cells." Nature protocols 7.6 (2012): 1024. |
4 | 6 | # |
5 | | -# Copyright (C) 2019 Rish Prabakar and Andrew D Smith |
| 7 | +# Functions RemoveSegment and SDUndoAll are adapted from the |
| 8 | +# modification to supplemetary program 12 by Jude Kendall. |
| 9 | +# |
| 10 | +# Copyright (C) 2019 Rish Prabakar, Wenzheng Li and Andrew D Smith |
| 11 | +# |
| 12 | +# Authors: Rish Prabakar, Wenzheng Li and Andrew D Smith |
| 13 | +# Includes code written by Jude Kendall |
6 | 14 | # |
7 | 15 | # This program is free software; you can redistribute it and/or modify |
8 | 16 | # it under the terms of the GNU General Public License as published by |
9 | 17 | # the Free Software Foundation; either version 2 of the License, or |
10 | 18 | # (at your option) any later version. |
11 | 19 | # |
12 | | -# This program is distributed in the hope that it will be useful, |
13 | | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | | -# GNU General Public License for more details. |
| 20 | +# This program is distributed in the hope that it will be useful, but |
| 21 | +# WITHOUT ANY WARRANTY; without even the implied warranty of |
| 22 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 23 | +# General Public License for more details. |
16 | 24 |
|
17 | 25 | library("DNAcopy") |
18 | 26 |
|
@@ -219,17 +227,10 @@ PlotSegment <- function(cur.ratio, cur.ratio.good, sample.name) { |
219 | 227 | xaxt="n", xlab="Genome Position Gb", |
220 | 228 | yaxt="n", ylab="Ratio", col="#517FFF", cex=0.01) |
221 | 229 |
|
222 | | - # axis(1, at=x.at, labels=x.labels) |
223 | 230 | axis(2, at=y.at, labels=y.labels) |
224 | | - # lines(x=cur.ratio.good$abspos, y=cur.ratio.good$lowratio, col="#CCCCCC") |
225 | | - # points(x=cur.ratio.good$abspos, y=cur.ratio.good$seg.mean.LOWESS, |
226 | | - # col="#0000AA") |
227 | 231 | lines(x=cur.ratio.good$abspos, y=cur.ratio.good$seg.mean.LOWESS, |
228 | 232 | col="red", cex=1.0) |
229 | | - ## abline(h=hlines) |
230 | | - ## abline(v=vlines) |
231 | 233 | abline(v=vlines, lwd=0.1, col="grey") |
232 | | - ## mtext(chr.text, at = chr.at) |
233 | 234 | dev.off() |
234 | 235 | } |
235 | 236 |
|
@@ -361,14 +362,14 @@ main <- function() { |
361 | 362 | cur.ratio = cbs.seg$ratio |
362 | 363 | cur.ratio.good = cbs.seg$ratio.bad |
363 | 364 | segs = cbs.seg$segs |
364 | | - # plot segment |
| 365 | + |
| 366 | + ## plot segment |
365 | 367 | PlotSegment(cur.ratio, cur.ratio.good, sample.name) |
366 | | - # save results |
367 | | - write.table(cur.ratio.good, sep="\t", |
368 | | - file=sprintf("%s.data.txt", sample.name), |
| 368 | + |
| 369 | + ## save results |
| 370 | + write.table(cur.ratio.good, sep="\t", file=sprintf("%s.data.txt", sample.name), |
369 | 371 | quote=F, row.names=F) |
370 | | - write.table(segs, sep="\t", |
371 | | - file=sprintf("%s.short.txt", sample.name), |
| 372 | + write.table(segs, sep="\t", file=sprintf("%s.short.txt", sample.name), |
372 | 373 | quote=F, row.names=F) |
373 | 374 | } |
374 | 375 |
|
|
0 commit comments