Skip to content

Commit

Permalink
Protection against divide-by-zero
Browse files Browse the repository at this point in the history
  • Loading branch information
jenzopr committed Mar 7, 2017
1 parent ec8a32d commit ddb55db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/puc.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ calcPUC <- function(data) {
p <- pid(z=z, x1 = data[, ind1], x2 = data[, ind2])
mi1 <- (p$unique_x1 + p$redundancy)
mi2 <- (p$unique_x2 + p$redundancy)
c( p$unique_x1 / mi1, p$unique_x2 / mi2)
c( ifelse(mi1 > 0, p$unique_x1 / mi1, 0), ifelse(mi2 > 0, p$unique_x2 / mi2, 0))
}

# Efficient calculation of PUC values for all gene triplets
Expand Down

0 comments on commit ddb55db

Please sign in to comment.