Skip to content

Commit

Permalink
Merge pull request #41 from suzannejin/master
Browse files Browse the repository at this point in the history
changed pcor.bshrink so that the alr columns are 0 instead of NaN, otherwise the updateCutoff() function will give NaNs
  • Loading branch information
suzannejin authored Dec 15, 2023
2 parents ee4a796 + c693a82 commit 32ef3a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions R/1-propr.R
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ propr <- function(counts,
result@pairs <- vector("numeric")
result@permutes <- list(NULL)

# ivar should not be NA, otherwise updateCutoffs does not work
if (metric == 'pcor.bshrink') result@ivar <- ivar_pcor

# Clean row and column names
result@matrix <- mat
colnames(result@matrix) <- colnames(result@logratio)
Expand Down
4 changes: 2 additions & 2 deletions R/1a-propr-backend.R
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ basis_shrinkage <- function(M, outtype = c("clr", "alr")) {

# make output to have same dimensions as input
if (outtype == "alr") {
PC <- cbind(PC, replicate(nrow(PC), NA))
PC <- rbind(PC, replicate(ncol(PC), NA))
PC <- cbind(PC, replicate(nrow(PC), 0))
PC <- rbind(PC, replicate(ncol(PC), 0))
PC[nrow(PC), ncol(PC)] <- 1
}

Expand Down

0 comments on commit 32ef3a1

Please sign in to comment.