-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from sigven/bundle_update_2023
v2.0rc - 2024
- Loading branch information
Showing
103 changed files
with
6,706 additions
and
3,797 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,12 +4,12 @@ on: | |
push: | ||
branches: | ||
- master | ||
- dev | ||
- bundle_update_2023 | ||
env: | ||
atoken: ${{ secrets.ANACONDA_UPLOAD_TOKEN }} | ||
recipe_path: conda/recipe | ||
env_yml_path: conda/env/yml | ||
VERSION: '1.0.1' # versioned by bump2version | ||
VERSION: '1.0.1.9016' # versioned by bump2version | ||
jobs: | ||
build_conda_pkgs: | ||
# When merging to one of the branches above and the commit message matches | ||
|
@@ -19,25 +19,31 @@ jobs: | |
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Set up Mambaforge | ||
uses: conda-incubator/setup-miniconda@v2 | ||
uses: actions/checkout@v4 | ||
- name: Micromamba setup | ||
uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
miniforge-variant: Mambaforge | ||
miniforge-version: 4.11.0-0 | ||
show-channel-urls: true | ||
auto-activate-base: false | ||
activate-environment: condabuild | ||
environment-file: conda/condabuild_env.yml | ||
use-mamba: true | ||
- name: Build + upload cpsr conda pkg | ||
environment-file: ${{ env.env_yml_path }}/condabuild_env.yml | ||
- name: 🐍 Conda pkg build and upload | ||
run: | | ||
conda mambabuild ${recipe_path}/cpsr -c pcgr -c conda-forge -c bioconda --token ${atoken} | ||
- name: 🔖 Tag creation | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
const the_tag_name = 'refs/tags/v' + process.env.VERSION | ||
github.rest.git.createRef({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
ref: the_tag_name, | ||
sha: context.sha | ||
}) | ||
pkgdown_site: | ||
# only build pkgdown site on master | ||
if: github.ref_name == 'master' | ||
name: Deploy pkgdown website | ||
runs-on: ubuntu-latest | ||
needs: build_conda_pkgs | ||
|
@@ -46,34 +52,17 @@ jobs: | |
shell: bash -l {0} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Set up miniconda | ||
uses: conda-incubator/setup-miniconda@v2 | ||
uses: actions/checkout@v4 | ||
- name: Micromamba setup | ||
uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
auto-update-conda: true | ||
auto-activate-base: true | ||
activate-environment: "" | ||
mamba-version: "*" | ||
channels: "pcgr,conda-forge,bioconda" | ||
- name: Install conda packages | ||
run: mamba env create -n pkgdown -f ${env_yml_path}/pkgdown.yml | ||
environment-file: ${{ env.env_yml_path }}/pkgdown.yml | ||
- name: Publish pkgdown website | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Actions" | ||
conda activate pkgdown | ||
micromamba activate pkgdown | ||
printf "cpsr version:\n" | ||
Rscript -e "packageVersion('cpsr')" | ||
Rscript -e "pkgdown::deploy_to_branch(pkg = '.', commit_message = paste(pkgdown:::construct_commit_message('.'), '- see https://sigven.github.io/cpsr/'), branch = 'gh-pages', new_process = FALSE)" | ||
Rscript -e "pkgdown::deploy_to_branch(pkg = '.', commit_message = 'Built CPSR website: https://sigven.github.io/cpsr/', branch = 'gh-pages', new_process = FALSE)" | ||
- name: Create tag | ||
uses: actions/github-script@v5 | ||
with: | ||
script: | | ||
const the_tag_name = 'refs/tags/v' + process.env.VERSION | ||
github.rest.git.createRef({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
ref: the_tag_name, | ||
sha: context.sha | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,3 +40,6 @@ vignettes/*.pdf | |
|
||
/outputs | ||
docs | ||
inst/doc | ||
|
||
data-raw/variant_classification |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
YEAR: 2022 | ||
YEAR: 2024 | ||
COPYRIGHT HOLDER: Sigve Nakken |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
# Generated by roxygen2: do not edit by hand | ||
|
||
export(append_cpg_properties) | ||
export(assign_classification) | ||
export(assign_pathogenicity_evidence) | ||
export(assign_variant_tiers) | ||
export(detect_cancer_traits_clinvar) | ||
export(determine_pathogenicity_classification) | ||
export(bs_icon2) | ||
export(check_variant2cancer_phenotype) | ||
export(combine_novel_and_preclassified) | ||
export(exclude_vars_by_maf) | ||
export(exclude_vars_non_cancer) | ||
export(exclude_vars_noncoding) | ||
export(generate_cpsr_report) | ||
export(get_germline_biomarkers) | ||
export(get_insilico_prediction_statistics) | ||
export(get_max_rows_pr_datatable) | ||
export(load_germline_snv_indel) | ||
export(plot_summary_statistics) | ||
export(plot_virtual_panels) | ||
export(retrieve_secondary_calls) | ||
export(summary_donut_chart) | ||
importFrom(magrittr,"%>%") | ||
export(write_cpsr_output) | ||
importFrom(rlang,":=") | ||
importFrom(rlang,.data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# Copied from https://github.com/rstudio/bsicons/blob/f7dca31/R/icons.R | ||
icon_info_mini <- list( | ||
name = c( | ||
"bullseye", | ||
"check-square" | ||
), | ||
contents = c( | ||
"<path d=\"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z\"></path>\n<path d=\"M8 13A5 5 0 1 1 8 3a5 5 0 0 1 0 10zm0 1A6 6 0 1 0 8 2a6 6 0 0 0 0 12z\"></path>\n<path d=\"M8 11a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0 1a4 4 0 1 0 0-8 4 4 0 0 0 0 8z\"></path>\n<path d=\"M9.5 8a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z\"></path>", | ||
"<path d=\"M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z\"></path>\n<path d=\"M10.97 4.97a.75.75 0 0 1 1.071 1.05l-3.992 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425a.235.235 0 0 1 .02-.022z\"></path>" | ||
) | ||
) | ||
|
||
#' Use Bootstrap icons (as inline SVG) | ||
#' | ||
#' Copied from https://github.com/rstudio/bsicons. | ||
#' @param name The name of the Bootstrap icon. Whitespace is replaced with `-` | ||
#' (that way, `"arrow up"` can be used to refer to the "actual name" of | ||
#' `"arrow-up"`). For a searchable list of names, see <https://icons.getbootstrap.com/> | ||
#' @param size Any valid CSS unit defining both the height and width of the | ||
#' icon. | ||
#' @param class Additional CSS classes to add to the `<svg>` element. Consider | ||
#' providing Bootstrap 5+ utility classes (e.g., `text-success`) here to | ||
#' stylize the icon (but also note that those utility classes will only work | ||
#' when Bootstrap 5+ is on the page). | ||
#' @param title If provided (highly recommended), `a11y` defaults to `"sem"`, | ||
#' meaning the title is used for on-hover text and screen reader | ||
#' announcements. | ||
#' @param a11y Cases that distinguish the role of the icon and inform which | ||
#' accessibility attributes to be used. Icons can either be `"deco"` | ||
#' (decorative, the default case), `"sem"` (semantic), `"none"` (no | ||
#' accessibility features). The default, `"auto"`, resolves to `"sem"` if a | ||
#' `title` is provided (and `"deco"` otherwise). | ||
#' @param ... additional CSS properties (e.g., `margin`, `position`, etc.) | ||
#' placed on the `<svg>` tag. | ||
#' | ||
#' @return An [htmltools::HTML()] string containing the SVG icon. | ||
#' @export | ||
bs_icon2 <- function(name, size = "1em", class = NULL, title = NULL, | ||
a11y = c("auto", "deco", "sem", "none"), ...) { | ||
if (length(name) != 1) { | ||
rlang::abort("The number of icons specified in `name` must be 1.") | ||
} | ||
|
||
"%||%" <- function(x, y) { | ||
if (is.null(x)) y else x | ||
} | ||
|
||
name <- sub("\\s+", "-", tolower(name)) | ||
idx <- match(name, tolower(icon_info_mini$name)) | ||
stopifnot(!is.na(idx)) | ||
svg_children <- icon_info_mini$contents[idx] | ||
size <- htmltools::validateCssUnit(size) | ||
style_attr <- paste0( | ||
"height:", size, ";", | ||
"width:", size, ";", | ||
"fill:currentColor;", | ||
# Better default vertical positioning of icons in a inline context (inspired by fontawesome::fa()) | ||
"vertical-align:-0.125em;", | ||
htmltools::css(...) | ||
) | ||
|
||
# Generate accessibility attributes if either of | ||
# the "deco" or "sem" cases are chosen | ||
a11y <- rlang::arg_match(a11y) | ||
a11y_attrs <- "" | ||
|
||
if (a11y == "auto") { | ||
a11y <- if (is.null(title)) "deco" else "sem" | ||
} | ||
|
||
if (a11y == "deco") { | ||
a11y_attrs <- 'aria-hidden="true" role="img" ' | ||
} else if (a11y == "sem") { | ||
title <- title %||% name | ||
a11y_attrs <- sprintf( | ||
'aria-label="%s" role="img" ', | ||
htmltools::htmlEscape(title, attribute = TRUE) | ||
) | ||
} | ||
|
||
res <- sprintf( | ||
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="bi bi-%s %s" style="%s" %s>%s%s</svg>', | ||
name, | ||
paste(class, collapse = " "), | ||
style_attr, | ||
a11y_attrs, | ||
if (is.null(title)) "" else paste0("<title>", htmltools::htmlEscape(title), "</title>"), | ||
svg_children | ||
) | ||
|
||
htmltools::browsable(htmltools::HTML(res)) | ||
} |
Oops, something went wrong.