Skip to content

Commit

Permalink
don't transpose X
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-james committed May 22, 2024
1 parent d361ec5 commit b4f1bbf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/deg.R
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ deg.dysregulation <- function(sce, pathology, sample.col, covariates=NULL, verb
if (!is.null(rd)) {
sce.cd = as.data.frame(SummarizedExperiment::colData(sce))
X = t(make_average(sce.cd[[sample.col]], u=rownames(cd))) %*% rd
X = cbind(X, design)
X = t(cbind(X, design))
} else {
pb = se_tmm(pb, log=TRUE)
X = SummarizedExperiment::assays(pb)$TMM
Expand All @@ -120,8 +120,8 @@ deg.dysregulation <- function(sce, pathology, sample.col, covariates=NULL, verb
## TODO take PC1 and cor?
dnum = 0
} else {
AX = t(X) %*% make_average(cd[[pathology]])
dnum = mean(cor(AX[,1], AX[,2]))
AX = X %*% make_average(cd[[pathology]])
dnum = median(cor(AX[,1], AX[,-1]))
}
return(dnum)
}
Expand Down

0 comments on commit b4f1bbf

Please sign in to comment.