YosefLab / scone

53 stars 12 forks source link

Restore original par settings upon exiting function. #46

Closed jdblischak closed 8 years ago

jdblischak commented 8 years ago

The functions metric_sample_filter and factor_sample_filter have the side effect of modifying the par settings. This PR restores the original par settings upon exiting these functions. The code below demonstrates the side effects:

devtools::install_github("drisso/bioc2016singlecell")
devtools::install_github("YosefLab/scone@develop")
library("bioc2016singlecell")
library("scone")

data("ws_input")
par("mfrow")
# [1] 1 1
mfilt_report <- metric_sample_filter(expr = counts,
                                     nreads = qc$NREADS,ralign = qc$RALIGN,
                                     suff_nreads = 10^5,
                                     suff_ralign = 90,
                                     pos_controls = hk,
                                     zcut = 3,mixture = FALSE, plot = TRUE)
par("mfrow")
# [1] 3 2
x <- factor_sample_filter(expr = counts, qual = qc, plot = TRUE)
par("mfrow")
# [1] 1 2