mirror of
https://github.com/johrpan/ubigen.git
synced 2025-10-26 19:57:24 +01:00
Use random sample for more than 100 genes
This commit is contained in:
parent
7f67dec72e
commit
af6b5561e4
1 changed files with 28 additions and 2 deletions
|
|
@ -56,6 +56,20 @@ gene_selector_ui <- function(id) {
|
||||||
height = "250px"
|
height = "250px"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
),
|
||||||
|
tabsetPanel(
|
||||||
|
id = NS(id, "max_genes_panel"),
|
||||||
|
type = "hidden",
|
||||||
|
tabPanelBody("hide"),
|
||||||
|
tabPanelBody(
|
||||||
|
"show",
|
||||||
|
HTML(paste0(
|
||||||
|
"You have entered more than 100 genes, which is the maximum number ",
|
||||||
|
"of genes supported in order not to overload the available ",
|
||||||
|
"resources. To assess your gene set anyway, a random sample of 100 ",
|
||||||
|
"genes was taken automatically."
|
||||||
|
))
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -89,9 +103,21 @@ gene_selector_server <- function(id) {
|
||||||
ubigen::genes[gene %chin% inputs, gene]
|
ubigen::genes[gene %chin% inputs, gene]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (length(gene_ids > 100)) {
|
if (length(gene_ids) > 100) {
|
||||||
gene_ids[seq_len(100)]
|
updateTabsetPanel(
|
||||||
|
session,
|
||||||
|
"max_genes_panel",
|
||||||
|
selected = "show"
|
||||||
|
)
|
||||||
|
|
||||||
|
sample(gene_ids, 100)
|
||||||
} else {
|
} else {
|
||||||
|
updateTabsetPanel(
|
||||||
|
session,
|
||||||
|
"max_genes_panel",
|
||||||
|
selected = "hide"
|
||||||
|
)
|
||||||
|
|
||||||
gene_ids
|
gene_ids
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue