Skip to content

Commit cfdb7df

Browse files
authored
Merge pull request #1397 from bigomics/fix-3172-gsettable
fix gene-in-gsets table (sub-issue 1372)
2 parents c6fda7f + 4ae1cdf commit cfdb7df

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

components/board.expression/R/expression_server.R

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -573,10 +573,13 @@ ExpressionBoard <- function(id, pgx, labeltype = shiny::reactive("feature")) {
573573
if (is.null(sel.row)) {
574574
return(NULL)
575575
}
576-
gene1 <- res[sel.row, ]
577-
578-
gmt_gene_mapping <- ifelse(is.na(gene1$human_ortholog), gene1$symbol, gene1$human_ortholog)
579576

577+
## determine which column to match with pgx$GMT
578+
gene1 <- res[sel.row, ]
579+
match.res <- apply(res[,c("symbol","human_ortholog")],2,
580+
function(x) sum(x%in%rownames(pgx$GMT)))
581+
match.col <- names(which.max(match.res))
582+
gmt_gene_mapping <- gene1[,match.col]
580583
j <- which(rownames(pgx$GMT) == gmt_gene_mapping)
581584
if (length(j) == 0) {
582585
return(NULL)

0 commit comments

Comments
 (0)