Skip to content

Commit

Permalink
Merge pull request #59 from CostaLab/hotfix
Browse files Browse the repository at this point in the history
fix cond utils
  • Loading branch information
jsnagai authored Oct 31, 2024
2 parents 5d82b2d + 87385d6 commit 1865291
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,17 @@ ranking <- function(data, out_path, sel_columns, slot = "graphs_ggi") {
table <- slot(data, 'tables')[[graph]]
cls <- unique(union(table[[sel_columns[1]]], table[[sel_columns[2]]]))
for (i in cls) {
all.eq <- unique(union(table$ligpair[table[[sel_columns[1]]] == i], table$recpair[table[[sel_columns[2]]] == i]))
edges <- t(utils::combn(all.eq, 2))
df <- tibble::tibble(u = edges[, 1], v = edges[, 2], MeanLR = rep(0.0, dim(edges)[1]), .name_repair = ~c('u', 'v', 'LRScore'))
if (is.null(all)) {
final <- df
}
else {
final <- dplyr::bind_rows(final, df)
}
all.eq <- unique(union(table$ligpair[table[[sel_columns[1]]] == i], table$recpair[table[[sel_columns[2]]] == i]))
if(length(grep("\\|R$",all.eq))>0){
edges <- t(utils::combn(all.eq, 2))
df <- tibble::tibble(u = edges[, 1], v = edges[, 2], MeanLR = rep(0.0, dim(edges)[1]), .name_repair = ~c('u', 'v', 'LRScore'))
if (is.null(all)) {
final <- df
}
else {
final <- dplyr::bind_rows(final, df)
}
}
}
names(final) <- c('ligpair', 'recpair', 'LRScore')
tmp_tbl = table[, c('ligpair', 'recpair', 'LRScore')]
Expand Down

0 comments on commit 1865291

Please sign in to comment.