diff --git a/DESCRIPTION b/DESCRIPTION index 391b16f..0b3142d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: QDNAseq -Version: 1.41.2-9001 +Version: 1.41.2-9002 Title: Quantitative DNA Sequencing for Chromosomal Aberrations Depends: R (>= 3.1.0) Imports: diff --git a/tests/QDNAseq.R b/tests/QDNAseq.R index 95607c9..6e8c6b2 100644 --- a/tests/QDNAseq.R +++ b/tests/QDNAseq.R @@ -2,6 +2,9 @@ library(QDNAseq) library(Biobase) ## combine(), sampleNames() library(utils) +do_plot <- TRUE +do_cleanup <- TRUE + # Load data data(LGG150) data <- LGG150 @@ -9,43 +12,45 @@ print(data) stopifnot(inherits(data, "QDNAseqReadCounts")) # Plot isobars of read counts -isobarPlot(data) +if (do_plot) isobarPlot(data) # Plot copy number profile -plot(data, ylim=c(-100, 200)) -highlightFilters(data, residual=TRUE, blacklist=TRUE) +if (do_plot) { + plot(data, ylim=c(-100, 200)) + highlightFilters(data, residual=TRUE, blacklist=TRUE) +} # Filter out "bad" bins dataF <- applyFilters(data, residual=TRUE, blacklist=TRUE) print(dataF) -plot(dataF, ylim=c(-100, 200)) +if (do_plot) plot(dataF, ylim=c(-100, 200)) stopifnot(inherits(dataF, "QDNAseqReadCounts")) # Correct read counts as a function of GC content and mappability dataC <- correctBins(dataF) print(dataC) -plot(dataC, ylim=c(-100, 200)) +if (do_plot) plot(dataC, ylim=c(-100, 200)) stopifnot(inherits(dataC, "QDNAseqCopyNumbers")) # Normalize binned read counts to have diploid normal copy number dataN <- normalizeBins(dataC) print(dataN) -plot(dataN) +if (do_plot) plot(dataN) stopifnot(inherits(dataN, "QDNAseqCopyNumbers")) # Plot noise -noisePlot(dataF) +if (do_plot) noisePlot(dataF) # Segment copy numbers fit <- segmentBins(dataN) print(fit) -plot(fit) +if (do_plot) plot(fit) stopifnot(inherits(fit, "QDNAseqCopyNumbers")) # Call copy-number segments fitC <- callBins(fit) print(fitC) -plot(fitC) +if (do_plot) plot(fitC) # --------------------------------------------------------------- @@ -75,8 +80,10 @@ for (name in names(sets)) { message(sprintf(" File(s) written: [n=%d] %s", length(file), paste(sQuote(file), collapse = ", "))) stopifnot(all(file_test("-f", file))) - file.remove(file) - stopifnot(!any(file_test("-f", file))) + if (do_cleanup) {f + file.remove(file) + stopifnot(!any(file_test("-f", file))) + } } } } @@ -115,8 +122,10 @@ for (name in names(sets)) { message(sprintf(" File(s) written: [n=%d] %s", length(file), paste(sQuote(file), collapse = ", "))) stopifnot(all(file_test("-f", file))) - file.remove(file) - stopifnot(!any(file_test("-f", file))) + if (do_cleanup) { + file.remove(file) + stopifnot(!any(file_test("-f", file))) + } } } }