Skip to content

Commit a48307b

Browse files
authored
Merge pull request #52 from sigven/bundle_update_2023
v2.0rc - 2024
2 parents 95478ca + 1ca778f commit a48307b

File tree

103 files changed

+6706
-3797
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+6706
-3797
lines changed

.Rbuildignore

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,13 @@
22
^\.Rproj\.user$
33
^\.bumpversion\.cfg$
44
^\.github$
5-
5+
^examples
66
^data-raw$
77
^LICENSE\.md$
8-
98
^conda$
10-
^cpsr_classification\.pdf$
11-
^cpsr_classification\.png$
12-
^cpsr_superpanel_0\.6\.2\.xlsx$
13-
^cpsr_views\.png$
149
^docs$
15-
^example\.vcf\.gz$
16-
^example\.vcf\.gz.tbi$
1710
^pkgdown/_pkgdown\.yml$
1811
^pkgdown$
1912
^_pkgdown\.yml$
13+
^\.pre-commit-config\.yaml$
14+
^vignettes$

.bumpversion.cfg

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
[bumpversion]
2-
current_version = 1.0.1
2+
current_version = 1.0.1.9016
33
commit = True
44
tag = False
5+
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<dev>\d+))?
6+
serialize =
7+
{major}.{minor}.{patch}.{dev}
8+
{major}.{minor}.{patch}
59

610
[bumpversion:file:DESCRIPTION]
711
search = Version: {current_version}

.github/workflows/build_conda.yaml

Lines changed: 26 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ on:
44
push:
55
branches:
66
- master
7-
- dev
7+
- bundle_update_2023
88
env:
99
atoken: ${{ secrets.ANACONDA_UPLOAD_TOKEN }}
1010
recipe_path: conda/recipe
1111
env_yml_path: conda/env/yml
12-
VERSION: '1.0.1' # versioned by bump2version
12+
VERSION: '1.0.1.9016' # versioned by bump2version
1313
jobs:
1414
build_conda_pkgs:
1515
# When merging to one of the branches above and the commit message matches
@@ -19,25 +19,31 @@ jobs:
1919
defaults:
2020
run:
2121
shell: bash -l {0}
22-
2322
steps:
2423
- name: Checkout code
25-
uses: actions/checkout@v2
26-
- name: Set up Mambaforge
27-
uses: conda-incubator/setup-miniconda@v2
24+
uses: actions/checkout@v4
25+
- name: Micromamba setup
26+
uses: mamba-org/setup-micromamba@v1
2827
with:
29-
miniforge-variant: Mambaforge
30-
miniforge-version: 4.11.0-0
31-
show-channel-urls: true
32-
auto-activate-base: false
33-
activate-environment: condabuild
34-
environment-file: conda/condabuild_env.yml
35-
use-mamba: true
36-
- name: Build + upload cpsr conda pkg
28+
environment-file: ${{ env.env_yml_path }}/condabuild_env.yml
29+
- name: 🐍 Conda pkg build and upload
3730
run: |
3831
conda mambabuild ${recipe_path}/cpsr -c pcgr -c conda-forge -c bioconda --token ${atoken}
32+
- name: 🔖 Tag creation
33+
uses: actions/github-script@v7
34+
with:
35+
script: |
36+
const the_tag_name = 'refs/tags/v' + process.env.VERSION
37+
github.rest.git.createRef({
38+
owner: context.repo.owner,
39+
repo: context.repo.repo,
40+
ref: the_tag_name,
41+
sha: context.sha
42+
})
3943
4044
pkgdown_site:
45+
# only build pkgdown site on master
46+
if: github.ref_name == 'master'
4147
name: Deploy pkgdown website
4248
runs-on: ubuntu-latest
4349
needs: build_conda_pkgs
@@ -46,34 +52,17 @@ jobs:
4652
shell: bash -l {0}
4753
steps:
4854
- name: Checkout code
49-
uses: actions/checkout@v2
50-
- name: Set up miniconda
51-
uses: conda-incubator/setup-miniconda@v2
55+
uses: actions/checkout@v4
56+
- name: Micromamba setup
57+
uses: mamba-org/setup-micromamba@v1
5258
with:
53-
auto-update-conda: true
54-
auto-activate-base: true
55-
activate-environment: ""
56-
mamba-version: "*"
57-
channels: "pcgr,conda-forge,bioconda"
58-
- name: Install conda packages
59-
run: mamba env create -n pkgdown -f ${env_yml_path}/pkgdown.yml
59+
environment-file: ${{ env.env_yml_path }}/pkgdown.yml
6060
- name: Publish pkgdown website
6161
run: |
6262
git config --local user.email "[email protected]"
6363
git config --local user.name "GitHub Actions"
64-
conda activate pkgdown
64+
micromamba activate pkgdown
6565
printf "cpsr version:\n"
6666
Rscript -e "packageVersion('cpsr')"
67-
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)"
67+
Rscript -e "pkgdown::deploy_to_branch(pkg = '.', commit_message = 'Built CPSR website: https://sigven.github.io/cpsr/', branch = 'gh-pages', new_process = FALSE)"
6868
69-
- name: Create tag
70-
uses: actions/github-script@v5
71-
with:
72-
script: |
73-
const the_tag_name = 'refs/tags/v' + process.env.VERSION
74-
github.rest.git.createRef({
75-
owner: context.repo.owner,
76-
repo: context.repo.repo,
77-
ref: the_tag_name,
78-
sha: context.sha
79-
})

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,6 @@ vignettes/*.pdf
4040

4141
/outputs
4242
docs
43+
inst/doc
44+
45+
data-raw/variant_classification

DESCRIPTION

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
Package: cpsr
22
Type: Package
33
Title: Cancer Predisposition Sequencing Reporter (CPSR)
4-
Version: 1.0.1
5-
Date: 2022-11-11
4+
Version: 1.0.1.9016
65
Authors@R:
76
c(person(given = "Sigve",
87
family = "Nakken",
@@ -27,27 +26,35 @@ Description: CPSR is a computational workflow that interprets germline variants
2726
predisposition and inherited cancer syndromes.
2827
License: MIT + file LICENSE
2928
biocViews:
30-
Remotes: github::sigven/pcgr/pcgrr@master
29+
Remotes: github::sigven/pcgr/pcgrr
3130
Imports:
3231
assertable,
3332
assertthat,
33+
bslib,
34+
crosstalk,
3435
dplyr,
36+
DT,
3537
ggplot2,
36-
log4r,
37-
magrittr,
38+
glue,
39+
htmltools,
40+
openxlsx2,
3841
pcgrr,
42+
quarto,
43+
readr,
3944
rlang,
40-
scales,
45+
shiny,
4146
stringr,
47+
stringi,
4248
tidyr
4349
Depends:
4450
R (>= 4.0)
4551
Suggests:
46-
testthat,
47-
devtools,
4852
BSgenome.Hsapiens.UCSC.hg19,
49-
BSgenome.Hsapiens.UCSC.hg38
53+
BSgenome.Hsapiens.UCSC.hg38,
54+
knitr,
55+
rmarkdown
5056
Encoding: UTF-8
5157
LazyData: true
52-
RoxygenNote: 7.2.1
58+
RoxygenNote: 7.3.1
5359
Roxygen: list(markdown = TRUE)
60+
VignetteBuilder: knitr

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
YEAR: 2022
1+
YEAR: 2024
22
COPYRIGHT HOLDER: Sigve Nakken

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MIT License
22

3-
Copyright (c) 2022 Sigve Nakken
3+
Copyright (c) 2024 Sigve Nakken
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

NAMESPACE

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
# Generated by roxygen2: do not edit by hand
22

3+
export(append_cpg_properties)
4+
export(assign_classification)
35
export(assign_pathogenicity_evidence)
4-
export(assign_variant_tiers)
5-
export(detect_cancer_traits_clinvar)
6-
export(determine_pathogenicity_classification)
6+
export(bs_icon2)
7+
export(check_variant2cancer_phenotype)
8+
export(combine_novel_and_preclassified)
9+
export(exclude_vars_by_maf)
10+
export(exclude_vars_non_cancer)
11+
export(exclude_vars_noncoding)
712
export(generate_cpsr_report)
8-
export(get_germline_biomarkers)
913
export(get_insilico_prediction_statistics)
1014
export(get_max_rows_pr_datatable)
15+
export(load_germline_snv_indel)
16+
export(plot_summary_statistics)
17+
export(plot_virtual_panels)
1118
export(retrieve_secondary_calls)
12-
export(summary_donut_chart)
13-
importFrom(magrittr,"%>%")
19+
export(write_cpsr_output)
1420
importFrom(rlang,":=")
1521
importFrom(rlang,.data)

R/bsicons.R

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Copied from https://github.com/rstudio/bsicons/blob/f7dca31/R/icons.R
2+
icon_info_mini <- list(
3+
name = c(
4+
"bullseye",
5+
"check-square"
6+
),
7+
contents = c(
8+
"<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>",
9+
"<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>"
10+
)
11+
)
12+
13+
#' Use Bootstrap icons (as inline SVG)
14+
#'
15+
#' Copied from https://github.com/rstudio/bsicons.
16+
#' @param name The name of the Bootstrap icon. Whitespace is replaced with `-`
17+
#' (that way, `"arrow up"` can be used to refer to the "actual name" of
18+
#' `"arrow-up"`). For a searchable list of names, see <https://icons.getbootstrap.com/>
19+
#' @param size Any valid CSS unit defining both the height and width of the
20+
#' icon.
21+
#' @param class Additional CSS classes to add to the `<svg>` element. Consider
22+
#' providing Bootstrap 5+ utility classes (e.g., `text-success`) here to
23+
#' stylize the icon (but also note that those utility classes will only work
24+
#' when Bootstrap 5+ is on the page).
25+
#' @param title If provided (highly recommended), `a11y` defaults to `"sem"`,
26+
#' meaning the title is used for on-hover text and screen reader
27+
#' announcements.
28+
#' @param a11y Cases that distinguish the role of the icon and inform which
29+
#' accessibility attributes to be used. Icons can either be `"deco"`
30+
#' (decorative, the default case), `"sem"` (semantic), `"none"` (no
31+
#' accessibility features). The default, `"auto"`, resolves to `"sem"` if a
32+
#' `title` is provided (and `"deco"` otherwise).
33+
#' @param ... additional CSS properties (e.g., `margin`, `position`, etc.)
34+
#' placed on the `<svg>` tag.
35+
#'
36+
#' @return An [htmltools::HTML()] string containing the SVG icon.
37+
#' @export
38+
bs_icon2 <- function(name, size = "1em", class = NULL, title = NULL,
39+
a11y = c("auto", "deco", "sem", "none"), ...) {
40+
if (length(name) != 1) {
41+
rlang::abort("The number of icons specified in `name` must be 1.")
42+
}
43+
44+
"%||%" <- function(x, y) {
45+
if (is.null(x)) y else x
46+
}
47+
48+
name <- sub("\\s+", "-", tolower(name))
49+
idx <- match(name, tolower(icon_info_mini$name))
50+
stopifnot(!is.na(idx))
51+
svg_children <- icon_info_mini$contents[idx]
52+
size <- htmltools::validateCssUnit(size)
53+
style_attr <- paste0(
54+
"height:", size, ";",
55+
"width:", size, ";",
56+
"fill:currentColor;",
57+
# Better default vertical positioning of icons in a inline context (inspired by fontawesome::fa())
58+
"vertical-align:-0.125em;",
59+
htmltools::css(...)
60+
)
61+
62+
# Generate accessibility attributes if either of
63+
# the "deco" or "sem" cases are chosen
64+
a11y <- rlang::arg_match(a11y)
65+
a11y_attrs <- ""
66+
67+
if (a11y == "auto") {
68+
a11y <- if (is.null(title)) "deco" else "sem"
69+
}
70+
71+
if (a11y == "deco") {
72+
a11y_attrs <- 'aria-hidden="true" role="img" '
73+
} else if (a11y == "sem") {
74+
title <- title %||% name
75+
a11y_attrs <- sprintf(
76+
'aria-label="%s" role="img" ',
77+
htmltools::htmlEscape(title, attribute = TRUE)
78+
)
79+
}
80+
81+
res <- sprintf(
82+
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="bi bi-%s %s" style="%s" %s>%s%s</svg>',
83+
name,
84+
paste(class, collapse = " "),
85+
style_attr,
86+
a11y_attrs,
87+
if (is.null(title)) "" else paste0("<title>", htmltools::htmlEscape(title), "</title>"),
88+
svg_children
89+
)
90+
91+
htmltools::browsable(htmltools::HTML(res))
92+
}

0 commit comments

Comments
 (0)