Skip to content

Commit

Permalink
Merge pull request #259 from Sage-Bionetworks/fix-dashboard
Browse files Browse the repository at this point in the history
Fix dashboard
  • Loading branch information
thomasyu888 authored Mar 18, 2020
2 parents 02f63db + 8b80ff4 commit b063f7b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
5 changes: 4 additions & 1 deletion bin/database_to_staging.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,10 @@ def main(genie_version,
'Rscript',
os.path.join(os.path.dirname(os.path.abspath(__file__)),
'../genie/dashboard_markdown_generator.R'),
genie_version]
genie_version,
'--template_path',
os.path.join(os.path.dirname(os.path.abspath(__file__)),
'../genie/dashboardTemplate.Rmd')]

if genie_user is not None and genie_pass is not None:
dashboard_markdown_html_commands.extend(
Expand Down
7 changes: 3 additions & 4 deletions genie/dashboardTemplate.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ if (is.null(this_bed)) {
}
this_assays = as.character(unique(this_samples$SEQ_ASSAY_ID))
this_mut <- getFileDf("data_mutations_extended.txt", releaseFiles)
assay_infodf = getFileDf("assay_information.txt", releaseFiles)
black_list_variants <- synTableQuery("select * from syn18459663",
includeRowIdAndRowVersion = F)
black_list_variantsdf = black_list_variants$asDataFrame()
Expand Down Expand Up @@ -557,11 +558,9 @@ if (!is.null(assay_infodf) & !is.null(this_bed)) {
number_of_genes[names(num_submitted_genes), "num_genes_submitted"] = num_submitted_genes
number_of_genes[assay_infodf$SEQ_ASSAY_ID, "num_expected_genes"] = assay_infodf$number_of_genes
different_from_expected = number_of_genes[c(which(number_of_genes$num_genes_submitted != number_of_genes$num_expected_genes),
different_from_expected = number_of_genes[c(which(number_of_genes$num_genes_remapped != number_of_genes$num_expected_genes),
which(is.na(number_of_genes$num_expected_genes))),]
kable(different_from_expected,
caption = "Number of submitted vs expected genes in a bed file")
}
```
```
6 changes: 5 additions & 1 deletion genie/dashboard_markdown_generator.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ suppressPackageStartupMessages(library(argparse))
parser <- ArgumentParser()
parser$add_argument("release",
help = "Release version (ie. 5.3-consortium)")
parser$add_argument("--template_path",
help = "Path to dashboardTemplate.Rmd",
default="dashboardTemplate.Rmd")
parser$add_argument("--staging",
action = "store_true",
help = "Use staging files")
Expand All @@ -18,6 +21,7 @@ args <- parser$parse_args()
genie_user <- args$syn_user
genie_pass <- args$syn_pass
release <- args$release
template_path <- args$template_path
suppressPackageStartupMessages(library(synapser))
suppressPackageStartupMessages(library(rmarkdown))

Expand Down Expand Up @@ -85,7 +89,7 @@ if (!any(releases$releases %in% release)) {
#release_folder_fileview_synid = "syn17019650"
release_folder = synTableQuery(sprintf("select id from %s where name = '%s'", release_folder_fileview_synid, release))
release_folder_synid = release_folder$asDataFrame()$id
template = readLines("dashboardTemplate.Rmd")
template = readLines(template_path)

rmarkdown_path = create_markdown(release, release_folder_synid, template)
rmarkdown::render(rmarkdown_path,params = list("genieUser"=genie_user, "geniePass"=genie_pass))
Expand Down

0 comments on commit b063f7b

Please sign in to comment.