Commit 24f966e8 authored by domingue's avatar domingue
Browse files

Bug fix

- The logical test to check if there was at least one gene set input was always defaulting to TRUE.
- List of genes is created even if the --gmt_file is the only option set
parent 49cfb784
......@@ -24,7 +24,7 @@ p <- add_argument(
p <- add_argument(
p,
"--category",
help = "collection, such as H (hallmark), C1 (positional gene sets), C2 (curated gene sets), C3 (regulatory target gene sets), C4 (computational gene sets), C5 (GO gene sets), C6 (oncogenic signatures), C7 ( immunologic signatures). Set to _none_ if only specific gene sets from --extra_sets are going to be used. More information in https://www.gsea-msigdb.org/gsea/msigdb/collections.jsp",
help = "collection, such as H (hallmark), C1 (positional gene sets), C2 (curated gene sets), C3 (regulatory target gene sets), C4 (computational gene sets), C5 (GO gene sets), C6 (oncogenic signatures), C7 (immunologic signatures). Set to _None_ if only specific gene sets from --extra_sets are going to be used. More information in https://www.gsea-msigdb.org/gsea/msigdb/collections.jsp",
type = "character",
default = "H"
)
......@@ -128,7 +128,7 @@ category_exists <- function(category, species) {
# ==========================================================================
#' ## Read data and prepare variables
# ==========================================================================
if (category == "None" & (is.na(extra_sets) | is.na(gmt_file))) {
if (category == "None" & is.na(extra_sets) & is.na(gmt_file)) {
stop("One of --category or --extra_sets|--gmt_file must be used.")
}
......@@ -224,7 +224,12 @@ if (!is.na(extra_sets)) {
}
# head(m_df)
m_list <- m_df %>% split(x = .$entrez_gene, f = .$gs_name)
## prepare input list
m_list <- list()
if (exists("m_df")){
m_list <- m_df %>% split(x = .$entrez_gene, f = .$gs_name)
}
if (!is.na(gmt_file)) {
gmt_pathways <- gmtPathways(gmt_file)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment