Skip to content

Commit

Permalink
plot-bootstrap.R: fix script to handle an empty genes of interest lis…
Browse files Browse the repository at this point in the history
…t in config.yaml (#44)

* plot-bootstrap.R: fix script to handle an empty genes of interest list in config.yaml

* add missing parenthesis
  • Loading branch information
dlaehnemann authored May 17, 2021
1 parent 33a562a commit e51c742
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion workflow/scripts/plot-bootstrap.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,14 @@ top_genes <- results %>%
drop_na() %>%
distinct(ext_gene)

genes_of_interest <- tibble( ext_gene = snakemake@params[["genes"]]) %>%

if ( !is.null(snakemake@params[["genes"]]) ) {
genes_of_interest <- tibble( ext_gene = snakemake@params[["genes"]]) %>%
distinct(ext_gene)
} else {
# "genes" is null, if the list provided in config.yaml is empty
genes_of_interest <- tibble( ext_gene = character() )
}

genes <- full_join(top_genes, genes_of_interest, by = 'ext_gene') %>%
add_row(ext_gene = "Custom") %>%
Expand Down

0 comments on commit e51c742

Please sign in to comment.