Skip to content

Commit

Permalink
Merge pull request #15 from umccr/hm_testing
Browse files Browse the repository at this point in the history
add labmetadata table query function
  • Loading branch information
pdiakumis authored Jun 17, 2024
2 parents 90bdad5 + 5032148 commit 03e3ef5
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 13 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
^nogit$
^vignettes$
inst/reports/datashare/nogit
inst/reports/seqrunsum/.quarto
inst/reports/seqrunsum/nogit
4 changes: 3 additions & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
extra-packages: |
any::rcmdcheck
any::roxytest
needs: check

- uses: r-lib/actions/check-r-package@v2
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/pr-commands.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::roxygen2
extra-packages: |
any::roxygen2
any::roxytest
needs: pr-document

- name: Document
Expand Down Expand Up @@ -78,7 +80,7 @@ jobs:
shell: Rscript {0}

- name: Style
run: styler::style_pkg()
run: styler::style_pkg(exclude_dirs = c("tests"))
shell: Rscript {0}

- name: commit
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export(meta_wts_alignment_qc)
export(meta_wts_tumor_only)
export(portaldb_query)
export(portaldb_query_fastqlistrow)
export(portaldb_query_labmetadata)
export(portaldb_query_limsrow)
export(portaldb_query_table)
export(portaldb_query_workflow)
Expand Down
22 changes: 22 additions & 0 deletions R/query.R
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,25 @@ portaldb_query_limsrow <- function(query = NULL) {
portaldb_query_fastqlistrow <- function(query = NULL) {
portaldb_query_table(query = query, table = "data_portal_fastqlistrow")
}

#' PortalDB Query labmetadata Table
#'
#' Queries the `data_portal_labmetadata` table with the given query.
#' Note this is simply a convenience function that prepends
#' `SELECT * FROM "data_portal"."data_portal"."data_portal_labmetadata" ` to any
#' `query` you provide.
#' See examples.
#'
#' @param query SQL query string.
#' @return Tibble with results from query.
#'
#' @examples
#' \dontrun{
#' libids <- shQuote(paste(c("L2400340", "L2400256"), collapse = "|"))
#' query <- glue("WHERE REGEXP_LIKE(\"library_id\", {libids});")
#' portaldb_query_labmetadata(query)
#' }
#' @export
portaldb_query_labmetadata <- function(query = NULL) {
portaldb_query_table(query = query, table = "data_portal_labmetadata")
}
12 changes: 2 additions & 10 deletions inst/reports/seqrunsum/report.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ format:
body-width: 1300px
params:
title: "UMCCR PortalDB Workflow Summary"
date_start: "2024-05-30"
date_end: "2024-06-03"
date_start: "2024-06-15"
date_end: "2024-06-17"
---

```{r}
Expand Down Expand Up @@ -59,14 +59,6 @@ set.seed(42)
source(here("inst/reports/seqrunsum/funcs.R"))
```

```{r eval=interactive()}
params <- list(
date_start = "2024-05-31",
date_end = "2024-06-03"
)
```


```{r}
#| label: vars
fmt1 <- "%Y-%m-%dT%H:%M:%S"
Expand Down
28 changes: 28 additions & 0 deletions man/portaldb_query_labmetadata.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 03e3ef5

Please sign in to comment.