Skip to content

Commit

Permalink
Merge branch 'master' of git.bioconductor.org:packages/OUTRIDER
Browse files Browse the repository at this point in the history
# Conflicts:
#	DESCRIPTION
#	R/class-OutriderDataSet.R
#	R/getNSetterFuns.R
#	R/method-counts.R
#	R/method-gridSearch.R
#	tests/testthat/helper_test_data_set.R
  • Loading branch information
c-mertes committed Apr 12, 2020
2 parents 042e935 + 025e423 commit 7fbdaaf
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion R/ZscoreMatrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ ZscoreMatrix <- function(ods, peerResiduals){
Zscore <- (residuals - rowMeans(residuals)) / rowSds(residuals)
}

assay(ods, "l2fc") <- log2fc
assay(ods, "l2fc", withDimnames=FALSE) <- log2fc
zScore(ods) <- Zscore
validObject(ods)
return(ods)
Expand Down
8 changes: 4 additions & 4 deletions R/class-OutriderDataSet.R
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,10 @@ makeExampleOutriderDataSet <- function(n=200, m=80, q=10, freq=1E-3, zScore=6,

assay(ods, "trueMean", withDimnames=FALSE) <- mu
assay(ods, "trueSd", withDimnames=FALSE) <- matrix(true_sd, nrow=n, ncol=m)
mcols(ods)[,"trueTheta"] <- theta
colData(ods)[['trueSizeFactor']] <- sf
metadata(ods)[['optimalEncDim']] <- q
metadata(ods)[['encDimTable']] <- data.table(
mcols(ods)[,"trueTheta"] <- theta
colData(ods)[['trueSizeFactor']] <- sf
metadata(ods)[['optimalEncDim']] <- q
metadata(ods)[['encDimTable']] <- data.table(
encodingDimension=q, evaluationLoss=1, evalMethod='simulation')

#
Expand Down
2 changes: 1 addition & 1 deletion R/filterExpression.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ filterExp <- function(ods, fpkmCutoff, percentile, filterGenes, savefpkm,
addExpressedGenes){
fpkm <- fpkm(ods)
if(savefpkm){
assays(ods)[['fpkm']] <- fpkm
assay(ods, 'fpkm', withDimnames=FALSE) <- fpkm
}
passed <- rowQuantiles(fpkm, probs=percentile) > fpkmCutoff
mcols(ods)['passedFilter'] <- passed
Expand Down
2 changes: 1 addition & 1 deletion R/getNSetterFunsInternal.R
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ trueCounts <- function(ods){

`trueCounts<-` <- function(ods, value){
if(!'replacedTrueCounts' %in% assayNames(ods)){
assay(ods, 'replacedTrueCounts') <- value
assay(ods, 'replacedTrueCounts', withDimnames=FALSE) <- value
}
return(ods)
}
Expand Down
8 changes: 4 additions & 4 deletions R/method-counts.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
counts.replace.OutriderDataSet <- function(object, ..., value){
mode(value) <- "integer"
assay(object, "counts", ...) <- value

validObject(object)
object
}
Expand Down Expand Up @@ -80,7 +80,7 @@ normalizationFactors.OutriderDataSet <- function(object) {
if (!"normalizationFactors" %in% assayNames(object)){
return(NULL)
}
assays(object)[["normalizationFactors"]]
assay(object, "normalizationFactors")
}

normFactors.replace.OutriderDataSet <- function(object, value) {
Expand All @@ -96,7 +96,7 @@ normFactors.replace.OutriderDataSet <- function(object, value) {
stopifnot(all(value > 0))

# set the values and check the object
assays(object)[["normalizationFactors"]] <- value
assay(object, "normalizationFactors", withDimnames=FALSE) <- value
validObject(object)
object
}
Expand Down Expand Up @@ -169,6 +169,6 @@ setReplaceMethod("normalizationFactors", signature(object="OutriderDataSet",
#' @export "normalizationFactors<-"
setReplaceMethod("normalizationFactors", signature(object="OutriderDataSet",
value="NULL"), function(object, value) {
assays(object)[["normalizationFactors"]] <- NULL
assay(object, "normalizationFactors") <- NULL
return(object)})

2 changes: 1 addition & 1 deletion R/method-gridSearch.R
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ findInjectZscore <- function(ods, freq=1E-2,
#' @noRd
injectOutliers <- function(ods, freq, zScore, inj, lnorm, sdlog){
# copy true counts to be able to acces them in the loss later
assays(ods)[['trueCounts']] <- counts(ods)
assay(ods, 'trueCounts', withDimnames=FALSE) <- counts(ods)

# generate index of injected counts
size <- prod(dim(ods))
Expand Down

0 comments on commit 7fbdaaf

Please sign in to comment.