├── pcgr ├── __init__.py ├── _version.py └── splice.py ├── conda ├── recipe │ ├── .gitignore │ ├── pcgr │ │ ├── build.sh │ │ └── meta.yaml │ └── pcgrr │ │ ├── build.sh │ │ └── meta.yaml └── env │ ├── .gitignore │ └── yml │ ├── condabuild.yml │ ├── pkgdown.yml │ ├── pcgrr.yml │ └── pcgr.yml ├── pcgrr ├── tests │ ├── testthat │ │ ├── test_cna.R │ │ ├── test_cpsr.R │ │ ├── test_main.R │ │ ├── test_msi.R │ │ ├── test_utils.R │ │ ├── test_germline.R │ │ ├── test_kataegis.R │ │ ├── test_mutation.R │ │ ├── test_report.R │ │ ├── test_mutational_signatures.R │ │ └── test_biomarker.R │ ├── testthat.R │ ├── test.css │ ├── test.Rmd │ ├── test2.css │ └── cpsr.css ├── LICENSE ├── .gitattributes ├── data │ ├── tsv_cols.rda │ ├── dt_display.rda │ ├── color_palette.rda │ ├── tcga_cohorts.rda │ ├── variant_db_url.rda │ ├── biomarker_evidence.rda │ ├── data_coltype_defs.rda │ ├── immune_celltypes.rda │ ├── exonic_filter_levels.rda │ ├── cancer_phenotypes_regex.rda │ ├── cosmic_sbs_signatures.rda │ ├── effect_prediction_algos.rda │ ├── germline_filter_levels.rda │ └── oncogenicity_criteria.rda ├── inst │ ├── extdata │ │ ├── logo.png │ │ └── oncotree_phenotypes.tsv.gz │ ├── templates │ │ ├── favicon-16x16.png │ │ ├── pcgr_quarto_report │ │ │ ├── expression.qmd │ │ │ ├── expression │ │ │ │ └── immune_contexture.qmd │ │ │ ├── kataegis.qmd │ │ │ ├── mutational_signatures │ │ │ │ ├── signature_similarity.qmd │ │ │ │ └── mutational_spectra.qmd │ │ │ ├── snv_indel.qmd │ │ │ ├── germline.qmd │ │ │ ├── snv_indel │ │ │ │ └── variant_filtering.qmd │ │ │ └── clinicaltrials.qmd │ │ ├── pcgrr.scss │ │ └── pcgr_quarto.css │ └── CITATION ├── man │ ├── figures │ │ └── logo.png │ ├── mkdir.Rd │ ├── tidyeval.Rd │ ├── tsv_cols.Rd │ ├── dt_display.Rd │ ├── init_cna_vstats.Rd │ ├── init_msi_content.Rd │ ├── log4r_info.Rd │ ├── log4r_warn.Rd │ ├── log4r_debug.Rd │ ├── log4r_fatal.Rd │ ├── init_kataegis_content.Rd │ ├── check_file_exists.Rd │ ├── init_snv_indel_vstats.Rd │ ├── load_expression_csq.Rd │ ├── tcga_cohorts.Rd │ ├── init_var_content.Rd │ ├── pkg_exists.Rd │ ├── load_expression_similarity.Rd │ ├── export_quarto_evars.Rd │ ├── init_rainfall_content.Rd │ ├── init_expression_content.Rd │ ├── init_tumor_only_content.Rd │ ├── get_excel_sheets.Rd │ ├── hex_to_rgba.Rd │ ├── init_tmb_content.Rd │ ├── write_report_excel.Rd │ ├── append_tfbs_annotation.Rd │ ├── immune_celltypes.Rd │ ├── init_germline_content.Rd │ ├── assign_mutation_type.Rd │ ├── init_m_signature_content.Rd │ ├── append_dbnsfp_var_link.Rd │ ├── get_genome_obj.Rd │ ├── append_dbmts_var_link.Rd │ ├── biomarker_evidence.Rd │ ├── generate_report.Rd │ ├── generate_report_data_tmb.Rd │ ├── write_report_quarto_html.Rd │ ├── data_coltype_defs.Rd │ ├── oncogenicity_criteria.Rd │ ├── germline_filter_levels.Rd │ ├── init_report.Rd │ ├── plot_value_boxes.Rd │ ├── update_report.Rd │ ├── cancer_phenotypes_regex.Rd │ ├── remove_cols_from_df.Rd │ ├── strip_html.Rd │ ├── generate_report_data_expression.Rd │ ├── append_oncogenicity_docs.Rd │ ├── append_tcga_var_link.Rd │ ├── append_cancer_gene_evidence.Rd │ ├── dbsnp_germline_status.Rd │ ├── af_distribution.Rd │ ├── cosmic_somatic_status.Rd │ ├── get_dt_tables.Rd │ ├── tcga_somatic_status.Rd │ ├── load_yaml.Rd │ ├── log_var_eitem_stats.Rd │ ├── generate_report_data_msi.Rd │ ├── max_af_gnomad.Rd │ ├── filter_eitems_by_site.Rd │ ├── exclude_non_chrom_variants.Rd │ ├── filter_maf_file.Rd │ ├── get_valid_chromosomes.Rd │ ├── get_variant_statistics.Rd │ ├── get_tumor_only_filtering_criteria.Rd │ ├── hom_af_status.Rd │ ├── tier_af_distribution.Rd │ ├── load_reference_data.Rd │ ├── filter_read_support.Rd │ ├── pon_status.Rd │ ├── append_gwas_citation_phenotype.Rd │ ├── structure_var_eitems.Rd │ ├── vaf_plot.Rd │ ├── assign_somatic_germline_evidence.Rd │ ├── check_common_colnames.Rd │ ├── clinvar_germline_status.Rd │ ├── append_drug_var_link.Rd │ ├── append_cancer_association_ranks.Rd │ ├── generate_report_data_kataegis.Rd │ ├── order_variants.Rd │ ├── plot_cna_segments.Rd │ ├── expand_biomarker_items.Rd │ ├── load_somatic_snv_indel.Rd │ ├── append_annotation_links.Rd │ ├── effect_prediction_algos.Rd │ ├── load_all_eitems.Rd │ ├── msi_indel_load_plot.Rd │ ├── generate_tier_tsv.Rd │ ├── get_oncogenic_cna_events.Rd │ ├── append_targeted_drug_annotations.Rd │ ├── generate_report_data_trials.Rd │ ├── variant_stats_report.Rd │ ├── assign_somatic_classification.Rd │ ├── get_clin_assocs_cna.Rd │ ├── msi_indel_fraction_plot.Rd │ ├── write_processed_vcf.Rd │ ├── df_string_replace.Rd │ ├── cosmic_sbs_signatures.Rd │ ├── het_af_germline_status.Rd │ ├── load_expression_outliers.Rd │ ├── plot_signature_contributions.Rd │ ├── qc_var_eitems.Rd │ ├── load_somatic_cna.Rd │ ├── detect_vcf_sample_name.Rd │ ├── load_cpsr_classified_variants.Rd │ ├── generate_report_data_rainfall.Rd │ ├── variant_db_url.Rd │ ├── assign_amp_asco_tiers.Rd │ ├── sort_chromosomal_segments.Rd │ ├── generate_report_data_signatures.Rd │ ├── predict_msi_status.Rd │ ├── deduplicate_eitems.Rd │ ├── kataegis_input.Rd │ ├── assign_germline_popfreq_status.Rd │ ├── load_dna_variants.Rd │ ├── color_palette.Rd │ ├── plot_tmb_primary_site_tcga.Rd │ ├── write_report_tsv.Rd │ ├── get_prevalent_site_signatures.Rd │ ├── generate_annotation_link.Rd │ ├── load_eitems.Rd │ ├── kataegis_detect.Rd │ ├── plotly_pie_chart.Rd │ └── plot_filtering_stats_exonic.Rd ├── .gitignore ├── pkgdown │ ├── assets │ │ └── img │ │ │ ├── sc1.png │ │ │ ├── sc2.png │ │ │ ├── sc3.png │ │ │ ├── docker-logo50.png │ │ │ └── pcgr_dashboard_views.png │ ├── favicon │ │ ├── favicon.ico │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── apple-touch-icon.png │ │ ├── apple-touch-icon-60x60.png │ │ ├── apple-touch-icon-76x76.png │ │ ├── apple-touch-icon-120x120.png │ │ ├── apple-touch-icon-152x152.png │ │ └── apple-touch-icon-180x180.png │ └── _pkgdown.yml ├── .Rbuildignore ├── pcgrr.Rproj ├── R │ ├── utils_shortcuts.R │ ├── value_boxes.R │ ├── clinicaltrials.R │ ├── variant_stats.R │ ├── data.R │ └── expression.R ├── data-raw │ ├── gnomad_populations.tsv │ ├── oncogenicity.tsv │ └── effect_prediction_algorithms.tsv ├── LICENSE.md ├── vignettes │ ├── developers.Rmd │ ├── primary_tumor_sites.Rmd │ ├── annotation_resources.Rmd │ └── faq.Rmd ├── DESCRIPTION └── NAMESPACE ├── .dockerignore ├── PCGR_workflow.png ├── .gitattributes ├── examples ├── T001-BRCA.grch37.vcf.gz ├── T001-BRCA.grch38.vcf.gz ├── T001-COAD.grch37.vcf.gz ├── T001-COAD.grch38.vcf.gz ├── T001-BRCA.grch37.vcf.gz.tbi ├── T001-BRCA.grch38.vcf.gz.tbi ├── T001-COAD.grch37.vcf.gz.tbi ├── T001-COAD.grch38.vcf.gz.tbi ├── gene_expression_example.tsv.gz ├── T001-BRCA.gene_expression.tsv.gz └── T001-COAD.gene_expression.tsv.gz ├── setup.py ├── install ├── 1-download_pcgr_refdata.sh └── 0-download_vep_cache.sh ├── .gitignore ├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── LICENSE ├── Dockerfile ├── scripts ├── cpsr.R └── pcgrr.R ├── pyproject.toml └── .bumpversion.toml /pcgr/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /conda/recipe/.gitignore: -------------------------------------------------------------------------------- 1 | out 2 | -------------------------------------------------------------------------------- /pcgrr/tests/testthat/test_cna.R: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pcgrr/tests/testthat/test_cpsr.R: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pcgrr/tests/testthat/test_main.R: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pcgrr/tests/testthat/test_msi.R: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pcgrr/tests/testthat/test_utils.R: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pcgrr/tests/testthat/test_germline.R: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pcgrr/tests/testthat/test_kataegis.R: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pcgrr/tests/testthat/test_mutation.R: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pcgrr/tests/testthat/test_report.R: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /conda/env/.gitignore: -------------------------------------------------------------------------------- 1 | pcgr/ 2 | pcgrr/ 3 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | * 2 | !conda 3 | !.dockerignore 4 | -------------------------------------------------------------------------------- /pcgrr/tests/testthat/test_mutational_signatures.R: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pcgrr/LICENSE: -------------------------------------------------------------------------------- 1 | YEAR: 2021 2 | COPYRIGHT HOLDER: Sigve Nakken 3 | -------------------------------------------------------------------------------- /pcgr/_version.py: -------------------------------------------------------------------------------- 1 | # versioned by bump2version 2 | __version__ = '2.2.5' 3 | -------------------------------------------------------------------------------- /pcgrr/.gitattributes: -------------------------------------------------------------------------------- 1 | *.R linguist-language=R 2 | *.Rmd linguist-language=R 3 | -------------------------------------------------------------------------------- /PCGR_workflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/PCGR_workflow.png -------------------------------------------------------------------------------- /pcgrr/data/tsv_cols.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/data/tsv_cols.rda -------------------------------------------------------------------------------- /pcgrr/data/dt_display.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/data/dt_display.rda -------------------------------------------------------------------------------- /pcgrr/data/color_palette.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/data/color_palette.rda -------------------------------------------------------------------------------- /pcgrr/data/tcga_cohorts.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/data/tcga_cohorts.rda -------------------------------------------------------------------------------- /pcgrr/inst/extdata/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/inst/extdata/logo.png -------------------------------------------------------------------------------- /pcgrr/man/figures/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/man/figures/logo.png -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.html linguist-documentation 2 | src/R/pcgrr/inst/templates/*.bib linguist-vendored=true 3 | -------------------------------------------------------------------------------- /conda/recipe/pcgr/build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -x 3 | 4 | $PYTHON -m pip install . --no-deps -v 5 | -------------------------------------------------------------------------------- /pcgrr/.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .Ruserdata 5 | renv/ 6 | docs 7 | examples 8 | -------------------------------------------------------------------------------- /pcgrr/data/variant_db_url.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/data/variant_db_url.rda -------------------------------------------------------------------------------- /examples/T001-BRCA.grch37.vcf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/examples/T001-BRCA.grch37.vcf.gz -------------------------------------------------------------------------------- /examples/T001-BRCA.grch38.vcf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/examples/T001-BRCA.grch38.vcf.gz -------------------------------------------------------------------------------- /examples/T001-COAD.grch37.vcf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/examples/T001-COAD.grch37.vcf.gz -------------------------------------------------------------------------------- /examples/T001-COAD.grch38.vcf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/examples/T001-COAD.grch38.vcf.gz -------------------------------------------------------------------------------- /pcgrr/data/biomarker_evidence.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/data/biomarker_evidence.rda -------------------------------------------------------------------------------- /pcgrr/data/data_coltype_defs.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/data/data_coltype_defs.rda -------------------------------------------------------------------------------- /pcgrr/data/immune_celltypes.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/data/immune_celltypes.rda -------------------------------------------------------------------------------- /pcgrr/pkgdown/assets/img/sc1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/pkgdown/assets/img/sc1.png -------------------------------------------------------------------------------- /pcgrr/pkgdown/assets/img/sc2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/pkgdown/assets/img/sc2.png -------------------------------------------------------------------------------- /pcgrr/pkgdown/assets/img/sc3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/pkgdown/assets/img/sc3.png -------------------------------------------------------------------------------- /pcgrr/pkgdown/favicon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/pkgdown/favicon/favicon.ico -------------------------------------------------------------------------------- /pcgrr/data/exonic_filter_levels.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/data/exonic_filter_levels.rda -------------------------------------------------------------------------------- /conda/recipe/pcgrr/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export DISABLE_AUTOBREW=1 4 | ${R} CMD INSTALL --build . ${R_ARGS} 5 | -------------------------------------------------------------------------------- /examples/T001-BRCA.grch37.vcf.gz.tbi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/examples/T001-BRCA.grch37.vcf.gz.tbi -------------------------------------------------------------------------------- /examples/T001-BRCA.grch38.vcf.gz.tbi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/examples/T001-BRCA.grch38.vcf.gz.tbi -------------------------------------------------------------------------------- /examples/T001-COAD.grch37.vcf.gz.tbi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/examples/T001-COAD.grch37.vcf.gz.tbi -------------------------------------------------------------------------------- /examples/T001-COAD.grch38.vcf.gz.tbi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/examples/T001-COAD.grch38.vcf.gz.tbi -------------------------------------------------------------------------------- /pcgrr/data/cancer_phenotypes_regex.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/data/cancer_phenotypes_regex.rda -------------------------------------------------------------------------------- /pcgrr/data/cosmic_sbs_signatures.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/data/cosmic_sbs_signatures.rda -------------------------------------------------------------------------------- /pcgrr/data/effect_prediction_algos.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/data/effect_prediction_algos.rda -------------------------------------------------------------------------------- /pcgrr/data/germline_filter_levels.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/data/germline_filter_levels.rda -------------------------------------------------------------------------------- /pcgrr/data/oncogenicity_criteria.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/data/oncogenicity_criteria.rda -------------------------------------------------------------------------------- /pcgrr/inst/templates/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/inst/templates/favicon-16x16.png -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import setuptools 3 | 4 | if __name__ == "__main__": 5 | setuptools.setup() 6 | -------------------------------------------------------------------------------- /examples/gene_expression_example.tsv.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/examples/gene_expression_example.tsv.gz -------------------------------------------------------------------------------- /pcgrr/pkgdown/favicon/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/pkgdown/favicon/favicon-16x16.png -------------------------------------------------------------------------------- /pcgrr/pkgdown/favicon/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/pkgdown/favicon/favicon-32x32.png -------------------------------------------------------------------------------- /examples/T001-BRCA.gene_expression.tsv.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/examples/T001-BRCA.gene_expression.tsv.gz -------------------------------------------------------------------------------- /examples/T001-COAD.gene_expression.tsv.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/examples/T001-COAD.gene_expression.tsv.gz -------------------------------------------------------------------------------- /pcgrr/pkgdown/assets/img/docker-logo50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/pkgdown/assets/img/docker-logo50.png -------------------------------------------------------------------------------- /pcgrr/pkgdown/favicon/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/pkgdown/favicon/apple-touch-icon.png -------------------------------------------------------------------------------- /pcgrr/inst/extdata/oncotree_phenotypes.tsv.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/inst/extdata/oncotree_phenotypes.tsv.gz -------------------------------------------------------------------------------- /pcgrr/pkgdown/favicon/apple-touch-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/pkgdown/favicon/apple-touch-icon-60x60.png -------------------------------------------------------------------------------- /pcgrr/pkgdown/favicon/apple-touch-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/pkgdown/favicon/apple-touch-icon-76x76.png -------------------------------------------------------------------------------- /pcgrr/pkgdown/assets/img/pcgr_dashboard_views.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/pkgdown/assets/img/pcgr_dashboard_views.png -------------------------------------------------------------------------------- /pcgrr/pkgdown/favicon/apple-touch-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/pkgdown/favicon/apple-touch-icon-120x120.png -------------------------------------------------------------------------------- /pcgrr/pkgdown/favicon/apple-touch-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/pkgdown/favicon/apple-touch-icon-152x152.png -------------------------------------------------------------------------------- /pcgrr/pkgdown/favicon/apple-touch-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigven/pcgr/HEAD/pcgrr/pkgdown/favicon/apple-touch-icon-180x180.png -------------------------------------------------------------------------------- /pcgrr/.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^renv$ 2 | ^renv\.lock$ 3 | ^.*\.Rproj$ 4 | ^\.Rproj\.user$ 5 | 6 | ^data-raw$ 7 | ^LICENSE\.md$ 8 | ^_pkgdown\.yml$ 9 | ^docs$ 10 | ^pkgdown$ 11 | ^\.github$ 12 | ^vignettes$ 13 | -------------------------------------------------------------------------------- /conda/env/yml/condabuild.yml: -------------------------------------------------------------------------------- 1 | name: condabuild 2 | channels: 3 | - conda-forge 4 | - defaults 5 | dependencies: 6 | - boa 7 | - conda-build 8 | - conda-lock 9 | - conda-verify 10 | - anaconda-client 11 | -------------------------------------------------------------------------------- /install/1-download_pcgr_refdata.sh: -------------------------------------------------------------------------------- 1 | GENOME="grch38" # or "grch37" 2 | BUNDLE_VERSION="20240621" 3 | BUNDLE="pcgr_ref_data.${BUNDLE_VERSION}.${GENOME}.tgz" 4 | 5 | wget https://insilico.hpc.uio.no/pcgr/${BUNDLE} 6 | gzip -dc ${BUNDLE} | tar xvf - 7 | -------------------------------------------------------------------------------- /conda/env/yml/pkgdown.yml: -------------------------------------------------------------------------------- 1 | name: pkgdown_env 2 | channels: 3 | - pcgr 4 | - bioconda 5 | - conda-forge 6 | dependencies: 7 | - pcgr::r-pcgrr ==2.2.5 # versioned by bump2version 8 | - r-pkgdown 9 | - r-readr 10 | - r-glue 11 | - pandoc 12 | -------------------------------------------------------------------------------- /install/0-download_vep_cache.sh: -------------------------------------------------------------------------------- 1 | GENOME="GRCh38" # or "GRCh37" 2 | VEP_VERSION="112" 3 | CACHE="homo_sapiens_vep_${VEP_VERSION}_${GENOME}.tar.gz" 4 | 5 | wget https://ftp.ensembl.org/pub/release-${VEP_VERSION}/variation/indexed_vep_cache/${CACHE} 6 | gzip -dc ${CACHE} | tar xvf - 7 | -------------------------------------------------------------------------------- /pcgrr/man/mkdir.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{mkdir} 4 | \alias{mkdir} 5 | \title{Create directory} 6 | \usage{ 7 | mkdir(d) 8 | } 9 | \arguments{ 10 | \item{d}{Directory to create.} 11 | } 12 | \description{ 13 | Create directory 14 | } 15 | -------------------------------------------------------------------------------- /pcgrr/man/tidyeval.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils_shortcuts.R 3 | \name{tidyeval} 4 | \alias{tidyeval} 5 | \title{Tidy eval helpers} 6 | \description{ 7 | \url{https://cran.r-project.org/web/packages/dplyr/vignettes/programming.html} 8 | } 9 | \keyword{internal} 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | *.pyc 3 | __pycache__/ 4 | *.egg-info/ 5 | 6 | # Sphinx documentation 7 | docs/_build/ 8 | 9 | # PyCharm directory 10 | .idea/ 11 | 12 | # macOS files 13 | .DS_Store 14 | 15 | #data 16 | .Rproj.user 17 | 18 | .Rhistory 19 | *.Rproj 20 | 21 | tests 22 | conda/pcgr 23 | conda/pcgrr 24 | -------------------------------------------------------------------------------- /conda/env/yml/pcgrr.yml: -------------------------------------------------------------------------------- 1 | name: pcgrr 2 | 3 | channels: 4 | - pcgr 5 | - bioconda 6 | - conda-forge 7 | 8 | dependencies: 9 | - python 10 | - pcgr::r-pcgrr ==2.2.5 # versioned by bump2version 11 | - pcgr::r-cpsr 12 | - r-argparse 13 | - bioconductor-bsgenome.hsapiens.ucsc.hg38 14 | - bioconductor-bsgenome.hsapiens.ucsc.hg19 15 | -------------------------------------------------------------------------------- /pcgrr/man/tsv_cols.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{tsv_cols} 5 | \alias{tsv_cols} 6 | \title{TSV columns} 7 | \format{ 8 | An object of class \code{list} of length 3. 9 | } 10 | \usage{ 11 | tsv_cols 12 | } 13 | \description{ 14 | TSV columns 15 | } 16 | \keyword{datasets} 17 | -------------------------------------------------------------------------------- /pcgrr/man/dt_display.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{dt_display} 5 | \alias{dt_display} 6 | \title{DT Display} 7 | \format{ 8 | An object of class \code{list} of length 8. 9 | } 10 | \usage{ 11 | dt_display 12 | } 13 | \description{ 14 | DT Display 15 | } 16 | \keyword{datasets} 17 | -------------------------------------------------------------------------------- /pcgrr/man/init_cna_vstats.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/report.R 3 | \name{init_cna_vstats} 4 | \alias{init_cna_vstats} 5 | \title{Function that initiates report element with CNA information} 6 | \usage{ 7 | init_cna_vstats() 8 | } 9 | \description{ 10 | Function that initiates report element with CNA information 11 | } 12 | -------------------------------------------------------------------------------- /pcgrr/man/init_msi_content.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/report.R 3 | \name{init_msi_content} 4 | \alias{init_msi_content} 5 | \title{Function that initiates report element with MSI classification} 6 | \usage{ 7 | init_msi_content() 8 | } 9 | \description{ 10 | Function that initiates report element with MSI classification 11 | } 12 | -------------------------------------------------------------------------------- /pcgrr/man/log4r_info.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{log4r_info} 4 | \alias{log4r_info} 5 | \title{Write messages to logs at a given priority level} 6 | \usage{ 7 | log4r_info(msg) 8 | } 9 | \arguments{ 10 | \item{msg}{Message to log.} 11 | } 12 | \description{ 13 | See \code{\link[log4r:levellog]{log4r::levellog()}} 14 | } 15 | -------------------------------------------------------------------------------- /pcgrr/man/log4r_warn.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{log4r_warn} 4 | \alias{log4r_warn} 5 | \title{Write messages to logs at a given priority level} 6 | \usage{ 7 | log4r_warn(msg) 8 | } 9 | \arguments{ 10 | \item{msg}{Message to log.} 11 | } 12 | \description{ 13 | See \code{\link[log4r:levellog]{log4r::levellog()}} 14 | } 15 | -------------------------------------------------------------------------------- /pcgrr/man/log4r_debug.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{log4r_debug} 4 | \alias{log4r_debug} 5 | \title{Write messages to logs at a given priority level} 6 | \usage{ 7 | log4r_debug(msg) 8 | } 9 | \arguments{ 10 | \item{msg}{Message to log.} 11 | } 12 | \description{ 13 | See \code{\link[log4r:levellog]{log4r::levellog()}} 14 | } 15 | -------------------------------------------------------------------------------- /pcgrr/man/log4r_fatal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{log4r_fatal} 4 | \alias{log4r_fatal} 5 | \title{Write messages to logs at a given priority level} 6 | \usage{ 7 | log4r_fatal(msg) 8 | } 9 | \arguments{ 10 | \item{msg}{Message to log.} 11 | } 12 | \description{ 13 | See \code{\link[log4r:levellog]{log4r::levellog()}} 14 | } 15 | -------------------------------------------------------------------------------- /pcgrr/man/init_kataegis_content.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/report.R 3 | \name{init_kataegis_content} 4 | \alias{init_kataegis_content} 5 | \title{Function that initiates report element with kataegis information} 6 | \usage{ 7 | init_kataegis_content() 8 | } 9 | \description{ 10 | Function that initiates report element with kataegis information 11 | } 12 | -------------------------------------------------------------------------------- /pcgrr/man/check_file_exists.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{check_file_exists} 4 | \alias{check_file_exists} 5 | \title{Function that checks the existence of a file} 6 | \usage{ 7 | check_file_exists(fname) 8 | } 9 | \arguments{ 10 | \item{fname}{Name of file to check} 11 | } 12 | \description{ 13 | Function that checks the existence of a file 14 | } 15 | -------------------------------------------------------------------------------- /pcgrr/man/init_snv_indel_vstats.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/report.R 3 | \name{init_snv_indel_vstats} 4 | \alias{init_snv_indel_vstats} 5 | \title{Function that initiates report element with SNV/InDel statistics information} 6 | \usage{ 7 | init_snv_indel_vstats() 8 | } 9 | \description{ 10 | Function that initiates report element with SNV/InDel statistics information 11 | } 12 | -------------------------------------------------------------------------------- /pcgrr/tests/testthat.R: -------------------------------------------------------------------------------- 1 | #library(testthat) 2 | #library(pcgrr) 3 | # 4 | #context("Biomarker check") 5 | #pcgr_data <- readRDS(file='/Users/sigven/research/databundle/pcgr/20201029/data/grch37/rds/pcgr_data.rds') 6 | # 7 | #test_that("str_length of factor is length of level", { 8 | # expect_equal(str_length(factor("a")), 1) 9 | # expect_equal(str_length(factor("ab")), 2) 10 | # expect_equal(str_length(factor("abc")), 3) 11 | #}) 12 | -------------------------------------------------------------------------------- /pcgrr/man/load_expression_csq.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/input_data.R 3 | \name{load_expression_csq} 4 | \alias{load_expression_csq} 5 | \title{Load expression consequence settings} 6 | \usage{ 7 | load_expression_csq(settings = NULL) 8 | } 9 | \arguments{ 10 | \item{settings}{PCGR run/configuration settings} 11 | } 12 | \description{ 13 | Load expression consequence settings 14 | } 15 | -------------------------------------------------------------------------------- /pcgrr/man/tcga_cohorts.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{tcga_cohorts} 5 | \alias{tcga_cohorts} 6 | \title{Data frame with all TCGA cohorts} 7 | \format{ 8 | A data.frame with 33 rows and 2 columns that indicates TCGA cohorts 9 | } 10 | \usage{ 11 | tcga_cohorts 12 | } 13 | \description{ 14 | Data frame with all TCGA cohorts 15 | } 16 | \keyword{datasets} 17 | -------------------------------------------------------------------------------- /pcgrr/man/init_var_content.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/report.R 3 | \name{init_var_content} 4 | \alias{init_var_content} 5 | \title{Function that initiates report element with variant data} 6 | \usage{ 7 | init_var_content() 8 | } 9 | \value{ 10 | rep Report structure initialized for variant data 11 | } 12 | \description{ 13 | Function that initiates report element with variant data 14 | } 15 | -------------------------------------------------------------------------------- /pcgrr/man/pkg_exists.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{pkg_exists} 4 | \alias{pkg_exists} 5 | \title{Does R Package Exist} 6 | \usage{ 7 | pkg_exists(p) 8 | } 9 | \arguments{ 10 | \item{p}{The R package to check for.} 11 | } 12 | \value{ 13 | TRUE if package exists, FALSE otherwise. 14 | } 15 | \description{ 16 | Checks if the specified R package exists on the local system. 17 | } 18 | -------------------------------------------------------------------------------- /pcgrr/man/load_expression_similarity.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/input_data.R 3 | \name{load_expression_similarity} 4 | \alias{load_expression_similarity} 5 | \title{Load expression similarity results} 6 | \usage{ 7 | load_expression_similarity(settings = NULL) 8 | } 9 | \arguments{ 10 | \item{settings}{PCGR run/configuration settings} 11 | } 12 | \description{ 13 | Load expression similarity results 14 | } 15 | -------------------------------------------------------------------------------- /pcgrr/man/export_quarto_evars.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{export_quarto_evars} 4 | \alias{export_quarto_evars} 5 | \title{Export Quarto Environment Variables} 6 | \usage{ 7 | export_quarto_evars(x) 8 | } 9 | \arguments{ 10 | \item{x}{Path to conda/envs/pcgrr/etc/conda/activate.d/quarto.sh} 11 | } 12 | \description{ 13 | Export quarto environment variables 14 | required when using conda. 15 | } 16 | -------------------------------------------------------------------------------- /pcgrr/man/init_rainfall_content.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/report.R 3 | \name{init_rainfall_content} 4 | \alias{init_rainfall_content} 5 | \title{Function that initiates report element with rainfall information} 6 | \usage{ 7 | init_rainfall_content() 8 | } 9 | \value{ 10 | rep Report structure initialized for rainfall data 11 | } 12 | \description{ 13 | Function that initiates report element with rainfall information 14 | } 15 | -------------------------------------------------------------------------------- /pcgrr/man/init_expression_content.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/report.R 3 | \name{init_expression_content} 4 | \alias{init_expression_content} 5 | \title{Function that initiates report element with expression information} 6 | \usage{ 7 | init_expression_content() 8 | } 9 | \value{ 10 | rep Report structure initialized for expression data 11 | } 12 | \description{ 13 | Function that initiates report element with expression information 14 | } 15 | -------------------------------------------------------------------------------- /pcgrr/man/init_tumor_only_content.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/report.R 3 | \name{init_tumor_only_content} 4 | \alias{init_tumor_only_content} 5 | \title{Function that initiates report element with tumor-only information} 6 | \usage{ 7 | init_tumor_only_content() 8 | } 9 | \value{ 10 | rep Report structure initialized for tumor-only stats 11 | } 12 | \description{ 13 | Function that initiates report element with tumor-only information 14 | } 15 | -------------------------------------------------------------------------------- /pcgrr/man/get_excel_sheets.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/output_data.R 3 | \name{get_excel_sheets} 4 | \alias{get_excel_sheets} 5 | \title{Function that produces the contents of sheets for an Excel report 6 | of PCGR output} 7 | \usage{ 8 | get_excel_sheets(report = NULL) 9 | } 10 | \arguments{ 11 | \item{report}{PCGR report object} 12 | } 13 | \description{ 14 | Function that produces the contents of sheets for an Excel report 15 | of PCGR output 16 | } 17 | -------------------------------------------------------------------------------- /pcgrr/man/hex_to_rgba.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{hex_to_rgba} 4 | \alias{hex_to_rgba} 5 | \title{Convert Hex Color to RGBA} 6 | \usage{ 7 | hex_to_rgba(hex, alpha = 1) 8 | } 9 | \arguments{ 10 | \item{hex}{Hex color code (e.g. "#FF5733").} 11 | 12 | \item{alpha}{Alpha transparency value (0 to 1).} 13 | } 14 | \value{ 15 | RGBA color string (e.g. "rgba(255,87,51,0.5)"). 16 | } 17 | \description{ 18 | Convert Hex Color to RGBA 19 | } 20 | -------------------------------------------------------------------------------- /pcgrr/man/init_tmb_content.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/report.R 3 | \name{init_tmb_content} 4 | \alias{init_tmb_content} 5 | \title{Function that initiates report element with TMB information} 6 | \usage{ 7 | init_tmb_content(ref_data = NULL) 8 | } 9 | \arguments{ 10 | \item{ref_data}{PCGR reference data object} 11 | } 12 | \value{ 13 | rep TMB report element 14 | } 15 | \description{ 16 | Function that initiates report element with TMB information 17 | } 18 | -------------------------------------------------------------------------------- /pcgrr/man/write_report_excel.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/main.R 3 | \name{write_report_excel} 4 | \alias{write_report_excel} 5 | \title{Function that writes key datasets of PCGR object to an Excel workbook} 6 | \usage{ 7 | write_report_excel(report = NULL) 8 | } 9 | \arguments{ 10 | \item{report}{List object with all PCGR report data, settings etc.} 11 | } 12 | \description{ 13 | Function that writes key datasets of PCGR object to an Excel workbook 14 | } 15 | -------------------------------------------------------------------------------- /pcgrr/man/append_tfbs_annotation.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/variant_annotation.R 3 | \name{append_tfbs_annotation} 4 | \alias{append_tfbs_annotation} 5 | \title{Function that adds TFBS annotations (dbMTS) to genetic variant identifiers} 6 | \usage{ 7 | append_tfbs_annotation(var_df) 8 | } 9 | \arguments{ 10 | \item{var_df}{data frame with variants} 11 | } 12 | \description{ 13 | Function that adds TFBS annotations (dbMTS) to genetic variant identifiers 14 | } 15 | -------------------------------------------------------------------------------- /pcgrr/man/immune_celltypes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{immune_celltypes} 5 | \alias{immune_celltypes} 6 | \title{Data frame with immune cell types} 7 | \format{ 8 | A data.frame with 11 rows and 2 columns that indicates immune 9 | cell types used in immune contexture analysis by quanTIseq 10 | } 11 | \usage{ 12 | immune_celltypes 13 | } 14 | \description{ 15 | Data frame with immune cell types 16 | } 17 | \keyword{datasets} 18 | -------------------------------------------------------------------------------- /pcgrr/man/init_germline_content.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/report.R 3 | \name{init_germline_content} 4 | \alias{init_germline_content} 5 | \title{Function that initiates report element with germline variant information (CPSR)} 6 | \usage{ 7 | init_germline_content() 8 | } 9 | \value{ 10 | rep Report structure initialized for germline data (CPSR) 11 | } 12 | \description{ 13 | Function that initiates report element with germline variant information (CPSR) 14 | } 15 | -------------------------------------------------------------------------------- /conda/env/yml/pcgr.yml: -------------------------------------------------------------------------------- 1 | name: pcgr 2 | 3 | channels: 4 | - pcgr 5 | - bioconda 6 | - conda-forge 7 | 8 | dependencies: 9 | - pcgr::pcgr ==2.2.5 # versioned by bump2version 10 | - bedtools 11 | - bcftools 12 | - cyvcf2 13 | - ensembl-vep ==113.4 14 | - htslib 15 | - pandoc 16 | - bioconda::perl-bio-bigfile 17 | - conda-forge::perl-compress-raw-zlib 18 | - pybedtools 19 | - vcfanno 20 | - vt 21 | - bioconda::vcf2maf-umccr ==1.6.21.20230511 22 | - bioconda::vcf2tsvpy ==0.6.1 23 | - yaml 24 | -------------------------------------------------------------------------------- /pcgrr/man/assign_mutation_type.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mutation.R 3 | \name{assign_mutation_type} 4 | \alias{assign_mutation_type} 5 | \title{Function that assigns one of six mutation types to a list of mutations} 6 | \usage{ 7 | assign_mutation_type(var_df) 8 | } 9 | \arguments{ 10 | \item{var_df}{data frame with variants} 11 | } 12 | \value{ 13 | var_df 14 | } 15 | \description{ 16 | Function that assigns one of six mutation types to a list of mutations 17 | } 18 | -------------------------------------------------------------------------------- /pcgrr/man/init_m_signature_content.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/report.R 3 | \name{init_m_signature_content} 4 | \alias{init_m_signature_content} 5 | \title{Function that initiates report element with mutational signatures information} 6 | \usage{ 7 | init_m_signature_content() 8 | } 9 | \value{ 10 | rep Report structure initialized for signature data 11 | } 12 | \description{ 13 | Function that initiates report element with mutational signatures information 14 | } 15 | -------------------------------------------------------------------------------- /pcgrr/man/append_dbnsfp_var_link.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/variant_annotation.R 3 | \name{append_dbnsfp_var_link} 4 | \alias{append_dbnsfp_var_link} 5 | \title{Function that assigns HTML links to dbNSFP prediction entries} 6 | \usage{ 7 | append_dbnsfp_var_link(var_df) 8 | } 9 | \arguments{ 10 | \item{var_df}{data frame with variant entries} 11 | } 12 | \value{ 13 | var_df 14 | } 15 | \description{ 16 | Function that assigns HTML links to dbNSFP prediction entries 17 | } 18 | -------------------------------------------------------------------------------- /pcgrr/man/get_genome_obj.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{get_genome_obj} 4 | \alias{get_genome_obj} 5 | \title{Get BSgenome Object} 6 | \usage{ 7 | get_genome_obj(genome) 8 | } 9 | \arguments{ 10 | \item{genome}{Human genome assembly string: hg38 or hg19.} 11 | } 12 | \value{ 13 | BSgenome object. 14 | } 15 | \description{ 16 | Gets BSgenome object given a human genome assembly string. 17 | } 18 | \examples{ 19 | \dontrun{ 20 | get_genome_obj("hg38") 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /pcgrr/man/append_dbmts_var_link.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/variant_annotation.R 3 | \name{append_dbmts_var_link} 4 | \alias{append_dbmts_var_link} 5 | \title{Function that adds miRNA target annotations (dbMTS) to 6 | genetic variant identifiers} 7 | \usage{ 8 | append_dbmts_var_link(var_df) 9 | } 10 | \arguments{ 11 | \item{var_df}{data frame with variants} 12 | } 13 | \description{ 14 | Function that adds miRNA target annotations (dbMTS) to 15 | genetic variant identifiers 16 | } 17 | -------------------------------------------------------------------------------- /pcgrr/man/biomarker_evidence.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{biomarker_evidence} 5 | \alias{biomarker_evidence} 6 | \title{Fixed data types/categories used for biomarker evidence, e.g. 'types','levels' etc.} 7 | \format{ 8 | An object of class \code{list} of length 1. 9 | } 10 | \usage{ 11 | biomarker_evidence 12 | } 13 | \description{ 14 | Fixed data types/categories used for biomarker evidence, e.g. 'types','levels' etc. 15 | } 16 | \keyword{datasets} 17 | -------------------------------------------------------------------------------- /pcgrr/man/generate_report.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/main.R 3 | \name{generate_report} 4 | \alias{generate_report} 5 | \title{Function that generates all contents of the cancer 6 | genome report (PCGR)} 7 | \usage{ 8 | generate_report(yaml_fname = NULL) 9 | } 10 | \arguments{ 11 | \item{yaml_fname}{Name of PCGR settings file produced by 12 | pre-reporting Python workflow (yaml)} 13 | } 14 | \description{ 15 | Function that generates all contents of the cancer 16 | genome report (PCGR) 17 | } 18 | -------------------------------------------------------------------------------- /pcgrr/man/generate_report_data_tmb.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mutational_burden.R 3 | \name{generate_report_data_tmb} 4 | \alias{generate_report_data_tmb} 5 | \title{Function that reads TSV file with TMB estimates from sample} 6 | \usage{ 7 | generate_report_data_tmb(settings = NULL) 8 | } 9 | \arguments{ 10 | \item{settings}{PCGR run/configuration settings} 11 | } 12 | \value{ 13 | tmb_estimate 14 | } 15 | \description{ 16 | Function that reads TSV file with TMB estimates from sample 17 | } 18 | -------------------------------------------------------------------------------- /pcgrr/man/write_report_quarto_html.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/main.R 3 | \name{write_report_quarto_html} 4 | \alias{write_report_quarto_html} 5 | \title{Function that writes contents of PCGR object to an HTML report (quarto-based)} 6 | \usage{ 7 | write_report_quarto_html(report = NULL) 8 | } 9 | \arguments{ 10 | \item{report}{List object with all report data, settings etc.} 11 | } 12 | \description{ 13 | Function that writes contents of PCGR object to an HTML report (quarto-based) 14 | } 15 | -------------------------------------------------------------------------------- /pcgrr/man/data_coltype_defs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{data_coltype_defs} 5 | \alias{data_coltype_defs} 6 | \title{List of coltype definitions for input files to pcgrr (e.g. VCF-converted TSV, CNA TVS etc.)} 7 | \format{ 8 | An object of class \code{list} of length 5. 9 | } 10 | \usage{ 11 | data_coltype_defs 12 | } 13 | \description{ 14 | List of coltype definitions for input files to pcgrr (e.g. VCF-converted TSV, CNA TVS etc.) 15 | } 16 | \keyword{datasets} 17 | -------------------------------------------------------------------------------- /pcgrr/man/oncogenicity_criteria.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{oncogenicity_criteria} 5 | \alias{oncogenicity_criteria} 6 | \title{Oncogenicity criteria (ClinGen/CGC/VICC)} 7 | \format{ 8 | An object of class \code{spec_tbl_df} (inherits from \code{tbl_df}, \code{tbl}, \code{data.frame}) with 14 rows and 6 columns. 9 | } 10 | \usage{ 11 | oncogenicity_criteria 12 | } 13 | \description{ 14 | Oncogenicity criteria (ClinGen/CGC/VICC) 15 | } 16 | \keyword{datasets} 17 | -------------------------------------------------------------------------------- /pcgrr/pcgrr.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | ProjectId: 54b09f5c-7bcb-48f9-ad45-4e1cfc6104da 3 | 4 | RestoreWorkspace: Default 5 | SaveWorkspace: Default 6 | AlwaysSaveHistory: Default 7 | 8 | EnableCodeIndexing: Yes 9 | UseSpacesForTab: Yes 10 | NumSpacesForTab: 2 11 | Encoding: UTF-8 12 | 13 | RnwWeave: Sweave 14 | LaTeX: pdfLaTeX 15 | 16 | AutoAppendNewline: Yes 17 | StripTrailingWhitespace: Yes 18 | 19 | BuildType: Package 20 | PackageUseDevtools: Yes 21 | PackageInstallArgs: --no-multiarch --with-keep.source 22 | PackageRoxygenize: rd,collate,namespace 23 | -------------------------------------------------------------------------------- /pcgrr/man/germline_filter_levels.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{germline_filter_levels} 5 | \alias{germline_filter_levels} 6 | \title{Data frame with germline filtering criteria} 7 | \format{ 8 | A character vector listing all germline filtering criteria 9 | applied on input callsets (SNVs/InDels) in tumor-only mode 10 | } 11 | \usage{ 12 | germline_filter_levels 13 | } 14 | \description{ 15 | Data frame with germline filtering criteria 16 | } 17 | \keyword{datasets} 18 | -------------------------------------------------------------------------------- /pcgrr/man/init_report.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/report.R 3 | \name{init_report} 4 | \alias{init_report} 5 | \title{Function that initiates PCGR/CPSR report object} 6 | \usage{ 7 | init_report(yaml_fname = NULL, report_mode = "PCGR") 8 | } 9 | \arguments{ 10 | \item{yaml_fname}{Yaml file with configuration settings and paths 11 | to annotated molecular datasets} 12 | 13 | \item{report_mode}{Type of report ('PCGR' or 'CPSR')} 14 | } 15 | \description{ 16 | Function that initiates PCGR/CPSR report object 17 | } 18 | -------------------------------------------------------------------------------- /pcgrr/man/plot_value_boxes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/value_boxes.R 3 | \name{plot_value_boxes} 4 | \alias{plot_value_boxes} 5 | \title{Function that plots four value boxes with the most 6 | important findings in the cancer genome} 7 | \usage{ 8 | plot_value_boxes(pcg_report) 9 | } 10 | \arguments{ 11 | \item{pcg_report}{pcg report with list elements} 12 | } 13 | \value{ 14 | p 15 | } 16 | \description{ 17 | Function that plots four value boxes with the most 18 | important findings in the cancer genome 19 | } 20 | -------------------------------------------------------------------------------- /pcgrr/man/update_report.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/report.R 3 | \name{update_report} 4 | \alias{update_report} 5 | \title{Function that updates a PCGR/CPSR report object structure} 6 | \usage{ 7 | update_report(report, report_data, a_elem = "snv_indel") 8 | } 9 | \arguments{ 10 | \item{report}{PCGR/CPSR report} 11 | 12 | \item{report_data}{Object with report contents} 13 | 14 | \item{a_elem}{section of PCGR report} 15 | } 16 | \description{ 17 | Function that updates a PCGR/CPSR report object structure 18 | } 19 | -------------------------------------------------------------------------------- /pcgrr/man/cancer_phenotypes_regex.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{cancer_phenotypes_regex} 5 | \alias{cancer_phenotypes_regex} 6 | \title{Regular expression of terms indicative of cancer-related phenotypes and syndromes} 7 | \format{ 8 | A long regular expression of cancer-related phenotype terms 9 | } 10 | \usage{ 11 | cancer_phenotypes_regex 12 | } 13 | \description{ 14 | Regular expression of terms indicative of cancer-related phenotypes and syndromes 15 | } 16 | \keyword{datasets} 17 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | Whenever you encounter an error, please also include: 11 | 12 | - [ ] Version of PCGR. 13 | - [ ] Genome build (grch37/grch38). 14 | - [ ] the complete command you used to invoke pcgr (including all explicit options) 15 | - [ ] the **full** error message 16 | 17 | Whenever possible, please also provide links to query VCF file. 18 | 19 | **Additional context** 20 | Add any other context about the problem here. 21 | -------------------------------------------------------------------------------- /pcgrr/man/remove_cols_from_df.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{remove_cols_from_df} 4 | \alias{remove_cols_from_df} 5 | \title{Function that removes column(s) from data frame} 6 | \usage{ 7 | remove_cols_from_df(df, cnames = NULL) 8 | } 9 | \arguments{ 10 | \item{df}{data.frame with data} 11 | 12 | \item{cnames}{character vector with column names} 13 | } 14 | \value{ 15 | df data.frame with columns removed (if present originally) 16 | } 17 | \description{ 18 | Function that removes column(s) from data frame 19 | } 20 | -------------------------------------------------------------------------------- /pcgrr/man/strip_html.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{strip_html} 4 | \alias{strip_html} 5 | \title{Strip HTML tags} 6 | \usage{ 7 | strip_html(x) 8 | } 9 | \arguments{ 10 | \item{x}{A character vector.} 11 | } 12 | \value{ 13 | A character vector with HTML tags and comments stripped off. 14 | } 15 | \description{ 16 | Remove HTML tags and comments from text. 17 | From https://github.com/yihui/xfun/blob/ccee26/R/string.R#L329. 18 | } 19 | \examples{ 20 | strip_html('Hello world!') 21 | } 22 | -------------------------------------------------------------------------------- /pcgrr/man/generate_report_data_expression.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/expression.R 3 | \name{generate_report_data_expression} 4 | \alias{generate_report_data_expression} 5 | \title{Function that generates expression data for PCGR report} 6 | \usage{ 7 | generate_report_data_expression(ref_data = NULL, settings = NULL) 8 | } 9 | \arguments{ 10 | \item{ref_data}{PCGR reference data object} 11 | 12 | \item{settings}{PCGR run/configuration settings} 13 | } 14 | \description{ 15 | Function that generates expression data for PCGR report 16 | } 17 | -------------------------------------------------------------------------------- /pcgrr/R/utils_shortcuts.R: -------------------------------------------------------------------------------- 1 | #' Tidy eval helpers 2 | #' 3 | #' 4 | #' 5 | #' @name tidyeval 6 | #' @keywords internal 7 | #' @importFrom rlang .data := 8 | NULL 9 | 10 | utils::globalVariables(c(".")) 11 | 12 | #' @noRd 13 | dummy1 <- function() { 14 | # Solves R CMD check: Namespaces in Imports field not imported from 15 | DT::datatable 16 | htmltools::br 17 | plotly::plot_ly 18 | caret::createModel 19 | randomForest::importance 20 | shiny::bootstrapPage 21 | bslib::page_fillable 22 | crosstalk::filter_select 23 | } 24 | -------------------------------------------------------------------------------- /pcgrr/man/append_oncogenicity_docs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/variant_annotation.R 3 | \name{append_oncogenicity_docs} 4 | \alias{append_oncogenicity_docs} 5 | \title{Function that adds oncogenicity documentation from codes} 6 | \usage{ 7 | append_oncogenicity_docs(var_df, ref_data = NULL) 8 | } 9 | \arguments{ 10 | \item{var_df}{Data frame of sample variants from VCF} 11 | 12 | \item{ref_data}{PCGR/CPSR reference data object} 13 | } 14 | \value{ 15 | vcf_data_df 16 | } 17 | \description{ 18 | Function that adds oncogenicity documentation from codes 19 | } 20 | -------------------------------------------------------------------------------- /pcgrr/man/append_tcga_var_link.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/variant_annotation.R 3 | \name{append_tcga_var_link} 4 | \alias{append_tcga_var_link} 5 | \title{Function that adds TCGA annotations (cohort, frequency etc.) to variant identifiers} 6 | \usage{ 7 | append_tcga_var_link(var_df, linktype = "dbsource") 8 | } 9 | \arguments{ 10 | \item{var_df}{data frame with variants} 11 | 12 | \item{linktype}{type of link} 13 | } 14 | \value{ 15 | var_df 16 | } 17 | \description{ 18 | Function that adds TCGA annotations (cohort, frequency etc.) to variant identifiers 19 | } 20 | -------------------------------------------------------------------------------- /pcgrr/man/append_cancer_gene_evidence.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/variant_annotation.R 3 | \name{append_cancer_gene_evidence} 4 | \alias{append_cancer_gene_evidence} 5 | \title{Function that appends cancer gene evidence links} 6 | \usage{ 7 | append_cancer_gene_evidence(var_data_df = NULL, ref_data = NULL) 8 | } 9 | \arguments{ 10 | \item{var_data_df}{Data frame of sample variants from VCF} 11 | 12 | \item{ref_data}{PCGR/CPSR reference data object} 13 | } 14 | \value{ 15 | var_data_df 16 | } 17 | \description{ 18 | Function that appends cancer gene evidence links 19 | } 20 | -------------------------------------------------------------------------------- /pcgrr/man/dbsnp_germline_status.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/germline.R 3 | \name{dbsnp_germline_status} 4 | \alias{dbsnp_germline_status} 5 | \title{Function that assigns a logical (STATUS_DBSNP) reflecting whether 6 | a variant co-incides with an entry in dbSNP (germline)} 7 | \usage{ 8 | dbsnp_germline_status(sample_calls) 9 | } 10 | \arguments{ 11 | \item{sample_calls}{data frame with sample variant calls} 12 | } 13 | \description{ 14 | Function that assigns a logical (STATUS_DBSNP) reflecting whether 15 | a variant co-incides with an entry in dbSNP (germline) 16 | } 17 | -------------------------------------------------------------------------------- /pcgrr/man/af_distribution.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{af_distribution} 4 | \alias{af_distribution} 5 | \title{Function that plots a histogram of the the variant allelic 6 | support (tumor)} 7 | \usage{ 8 | af_distribution(var_df, bin_size = 0.05) 9 | } 10 | \arguments{ 11 | \item{var_df}{data frame with somatic mutations} 12 | 13 | \item{bin_size}{size of bins for allelic frequency} 14 | } 15 | \value{ 16 | p geom_histogram plot from ggplot2 17 | } 18 | \description{ 19 | Function that plots a histogram of the the variant allelic 20 | support (tumor) 21 | } 22 | -------------------------------------------------------------------------------- /pcgrr/man/cosmic_somatic_status.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/germline.R 3 | \name{cosmic_somatic_status} 4 | \alias{cosmic_somatic_status} 5 | \title{Function that assigns a logical (STATUS_COSMIC) reflecting whether 6 | a variant co-incides with an entry in COSMIC (germline)} 7 | \usage{ 8 | cosmic_somatic_status(sample_calls) 9 | } 10 | \arguments{ 11 | \item{sample_calls}{data frame with sample variant calls} 12 | } 13 | \description{ 14 | Function that assigns a logical (STATUS_COSMIC) reflecting whether 15 | a variant co-incides with an entry in COSMIC (germline) 16 | } 17 | -------------------------------------------------------------------------------- /pcgrr/man/get_dt_tables.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/biomarkers.R 3 | \name{get_dt_tables} 4 | \alias{get_dt_tables} 5 | \title{Function that gathers data tables on actionable variants 6 | for display in report (tier 1 + tier 2)} 7 | \usage{ 8 | get_dt_tables(rep = NULL, tier = 1, variant_class = "cna") 9 | } 10 | \arguments{ 11 | \item{rep}{report object} 12 | 13 | \item{tier}{tier level} 14 | 15 | \item{variant_class}{cna or snv_indel} 16 | } 17 | \description{ 18 | Function that gathers data tables on actionable variants 19 | for display in report (tier 1 + tier 2) 20 | } 21 | -------------------------------------------------------------------------------- /pcgrr/man/tcga_somatic_status.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/germline.R 3 | \name{tcga_somatic_status} 4 | \alias{tcga_somatic_status} 5 | \title{Function that assigns a logical (STATUS_TCGA_SOMATIC) reflecting whether 6 | a variant co-incides with an entry in TCGA (somatic)} 7 | \usage{ 8 | tcga_somatic_status(sample_calls) 9 | } 10 | \arguments{ 11 | \item{sample_calls}{data frame with sample variant calls} 12 | } 13 | \description{ 14 | Function that assigns a logical (STATUS_TCGA_SOMATIC) reflecting whether 15 | a variant co-incides with an entry in TCGA (somatic) 16 | } 17 | -------------------------------------------------------------------------------- /pcgrr/man/load_yaml.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/report.R 3 | \name{load_yaml} 4 | \alias{load_yaml} 5 | \title{Function that loads YAML data with settings and file paths 6 | to annotated molecular profiles} 7 | \usage{ 8 | load_yaml(yaml_fname, report_mode = "CPSR") 9 | } 10 | \arguments{ 11 | \item{yaml_fname}{Yaml file with configuration settings and paths 12 | to annotated molecular datasets} 13 | 14 | \item{report_mode}{Type of report ('PCGR' or 'CPSR')} 15 | } 16 | \description{ 17 | Function that loads YAML data with settings and file paths 18 | to annotated molecular profiles 19 | } 20 | -------------------------------------------------------------------------------- /pcgrr/man/log_var_eitem_stats.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/biomarkers.R 3 | \name{log_var_eitem_stats} 4 | \alias{log_var_eitem_stats} 5 | \title{Function that logs the number of evidence items found, for different 6 | levels of resolution} 7 | \usage{ 8 | log_var_eitem_stats(var_eitems = NULL, target_type = "exact") 9 | } 10 | \arguments{ 11 | \item{var_eitems}{data frame with variant evidence items} 12 | 13 | \item{target_type}{resolution of evidence items} 14 | } 15 | \description{ 16 | Function that logs the number of evidence items found, for different 17 | levels of resolution 18 | } 19 | -------------------------------------------------------------------------------- /pcgrr/tests/test.css: -------------------------------------------------------------------------------- 1 | .value_box_container { 2 | /*border: 2px dashed #444;*/ 3 | height: 210px; 4 | /*margin: 7px;*/ 5 | 6 | /* just for demo */ 7 | width: 900px; 8 | /*max-width: 600px;*/ 9 | /*height: 500px;*/ 10 | } 11 | 12 | .value_box_tumor_control { 13 | width: 280px; 14 | height: 150px; 15 | font-family: sans-serif; 16 | margin-right: 20px; 17 | margin-top: 20px; 18 | padding: 10px; 19 | color: white; 20 | display: inline-block; 21 | text-align: center; 22 | background: #000; 23 | border-radius: 25px; 24 | 25 | /*display: inline;*/ 26 | /*zoom: 1*/ 27 | } 28 | 29 | -------------------------------------------------------------------------------- /pcgrr/man/generate_report_data_msi.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/msi.R 3 | \name{generate_report_data_msi} 4 | \alias{generate_report_data_msi} 5 | \title{Function that generates MSI prediction data for PCGR report} 6 | \usage{ 7 | generate_report_data_msi(variant_set, ref_data = NULL, settings = NULL) 8 | } 9 | \arguments{ 10 | \item{variant_set}{variant calls subject to MSI classification} 11 | 12 | \item{ref_data}{PCGR reference data object} 13 | 14 | \item{settings}{PCGR run/configuration settings} 15 | } 16 | \description{ 17 | Function that generates MSI prediction data for PCGR report 18 | } 19 | -------------------------------------------------------------------------------- /pcgrr/man/max_af_gnomad.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/germline.R 3 | \name{max_af_gnomad} 4 | \alias{max_af_gnomad} 5 | \title{Function that assigns a maximum value to a variable (MAX_AF_GNOMAD) reflecting 6 | the maximum allele frequency for a given variant across gnomAD populations} 7 | \usage{ 8 | max_af_gnomad(sample_calls) 9 | } 10 | \arguments{ 11 | \item{sample_calls}{data frame with sample variant calls} 12 | } 13 | \description{ 14 | Function that assigns a maximum value to a variable (MAX_AF_GNOMAD) reflecting 15 | the maximum allele frequency for a given variant across gnomAD populations 16 | } 17 | -------------------------------------------------------------------------------- /pcgrr/man/filter_eitems_by_site.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/biomarkers.R 3 | \name{filter_eitems_by_site} 4 | \alias{filter_eitems_by_site} 5 | \title{Function that filters clinical evidence items by tumor type/primary site} 6 | \usage{ 7 | filter_eitems_by_site(eitems = NULL, ontology = NULL, primary_site = "") 8 | } 9 | \arguments{ 10 | \item{eitems}{data frame with clinical evidence items} 11 | 12 | \item{ontology}{phenotype ontology data frame} 13 | 14 | \item{primary_site}{primary tumor site} 15 | } 16 | \description{ 17 | Function that filters clinical evidence items by tumor type/primary site 18 | } 19 | -------------------------------------------------------------------------------- /pcgrr/man/exclude_non_chrom_variants.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{exclude_non_chrom_variants} 4 | \alias{exclude_non_chrom_variants} 5 | \title{Function that excludes genomic aberrations from non-nuclear chromosomes} 6 | \usage{ 7 | exclude_non_chrom_variants(vcf_df, chrom_var = "CHROM") 8 | } 9 | \arguments{ 10 | \item{vcf_df}{data frame} 11 | 12 | \item{chrom_var}{variable name of chromosome in data frame} 13 | } 14 | \value{ 15 | vcf_df data frame with mutations from nuclear chromosomes only 16 | } 17 | \description{ 18 | Function that excludes genomic aberrations from non-nuclear chromosomes 19 | } 20 | -------------------------------------------------------------------------------- /pcgrr/man/filter_maf_file.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/maf.R 3 | \name{filter_maf_file} 4 | \alias{filter_maf_file} 5 | \title{Function that takes a MAF file generated with vcf2maf 6 | and filters out variants that are presumably germline (tumor-only run)} 7 | \usage{ 8 | filter_maf_file(callset, settings) 9 | } 10 | \arguments{ 11 | \item{callset}{Callset with pre-processed somatic SNV/InDel variants} 12 | 13 | \item{settings}{PCGR run/configuration settings} 14 | } 15 | \description{ 16 | Function that takes a MAF file generated with vcf2maf 17 | and filters out variants that are presumably germline (tumor-only run) 18 | } 19 | -------------------------------------------------------------------------------- /pcgrr/man/get_valid_chromosomes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{get_valid_chromosomes} 4 | \alias{get_valid_chromosomes} 5 | \title{Checks for valid chromosome names in data frame of variants} 6 | \usage{ 7 | get_valid_chromosomes(vcf_data_df, chromosome_column = "CHROM", bsg = NULL) 8 | } 9 | \arguments{ 10 | \item{vcf_data_df}{data frame} 11 | 12 | \item{chromosome_column}{name of chromosome column} 13 | 14 | \item{bsg}{BSGenome object} 15 | } 16 | \value{ 17 | vcf_data_df valid data frame with valid mutations 18 | } 19 | \description{ 20 | Checks for valid chromosome names in data frame of variants 21 | } 22 | -------------------------------------------------------------------------------- /pcgrr/man/get_variant_statistics.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/variant_stats.R 3 | \name{get_variant_statistics} 4 | \alias{get_variant_statistics} 5 | \title{Function that computes various variant statistics from a data frame 6 | with variant records} 7 | \usage{ 8 | get_variant_statistics(var_df = NULL, pct_other_limit = 4) 9 | } 10 | \arguments{ 11 | \item{var_df}{data frame with variants} 12 | 13 | \item{pct_other_limit}{numeric value specifying the percentage limit 14 | for the 'Other' category} 15 | } 16 | \description{ 17 | Function that computes various variant statistics from a data frame 18 | with variant records 19 | } 20 | -------------------------------------------------------------------------------- /pcgrr/man/get_tumor_only_filtering_criteria.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/germline.R 3 | \name{get_tumor_only_filtering_criteria} 4 | \alias{get_tumor_only_filtering_criteria} 5 | \title{Function that generates a string with filtering criteria 6 | for callsets coming from tumor-only sequencing} 7 | \usage{ 8 | get_tumor_only_filtering_criteria(conf) 9 | } 10 | \arguments{ 11 | \item{conf}{list object with PCGR run configuration settings} 12 | } 13 | \value{ 14 | string with filtering criteria 15 | } 16 | \description{ 17 | Function that generates a string with filtering criteria 18 | for callsets coming from tumor-only sequencing 19 | } 20 | -------------------------------------------------------------------------------- /pcgrr/man/hom_af_status.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/germline.R 3 | \name{hom_af_status} 4 | \alias{hom_af_status} 5 | \title{Function that assigns a logical (STATUS_LIKELY_GERMLINE_HOMOZYGOUS) reflecting whether 6 | a variant is likely homozygous (germline) - based on allelic fraction (VAF_TUMOR)} 7 | \usage{ 8 | hom_af_status(sample_calls) 9 | } 10 | \arguments{ 11 | \item{sample_calls}{data frame with sample variant calls} 12 | } 13 | \description{ 14 | Function that assigns a logical (STATUS_LIKELY_GERMLINE_HOMOZYGOUS) reflecting whether 15 | a variant is likely homozygous (germline) - based on allelic fraction (VAF_TUMOR) 16 | } 17 | -------------------------------------------------------------------------------- /pcgrr/man/tier_af_distribution.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{tier_af_distribution} 4 | \alias{tier_af_distribution} 5 | \title{Function that plots a histogram of the the variant allelic 6 | support (tumor) - grouped by tiers} 7 | \usage{ 8 | tier_af_distribution(tier_df, bin_size = 0.05) 9 | } 10 | \arguments{ 11 | \item{tier_df}{data frame with somatic mutations} 12 | 13 | \item{bin_size}{size of bins for allelic frequency} 14 | } 15 | \value{ 16 | p geom_histogram plot from ggplot2 17 | } 18 | \description{ 19 | Function that plots a histogram of the the variant allelic 20 | support (tumor) - grouped by tiers 21 | } 22 | -------------------------------------------------------------------------------- /pcgrr/man/load_reference_data.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/reference_data.R 3 | \name{load_reference_data} 4 | \alias{load_reference_data} 5 | \title{Function that parses and loads reference data from files in the 6 | assembly-specific PCGR bundle directory} 7 | \usage{ 8 | load_reference_data(pcgr_db_assembly_dir = NULL, genome_assembly = "grch38") 9 | } 10 | \arguments{ 11 | \item{pcgr_db_assembly_dir}{Assembly-specific root path for data bundle} 12 | 13 | \item{genome_assembly}{grch37/grch38} 14 | } 15 | \description{ 16 | Function that parses and loads reference data from files in the 17 | assembly-specific PCGR bundle directory 18 | } 19 | -------------------------------------------------------------------------------- /conda/recipe/pcgr/meta.yaml: -------------------------------------------------------------------------------- 1 | package: 2 | name: pcgr 3 | version: 2.2.5 # versioned by bump2version 4 | 5 | source: 6 | path: ../../.. 7 | 8 | build: 9 | number: 0 10 | noarch: python 11 | 12 | requirements: 13 | build: 14 | - curl 15 | - unzip 16 | - tar 17 | - python 18 | run: 19 | - python 20 | - pandas 21 | - scipy 22 | - numpy 23 | - pip 24 | - pybedtools 25 | - cyvcf2 26 | - pyyaml 27 | 28 | test: 29 | commands: 30 | - pcgr --version 31 | 32 | about: 33 | home: https://github.com/sigven/pcgr 34 | license: MIT 35 | summary: Personal Cancer Genome Reporter (PCGR) - variant interpretation for precision cancer medicine. 36 | -------------------------------------------------------------------------------- /pcgrr/man/filter_read_support.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{filter_read_support} 4 | \alias{filter_read_support} 5 | \title{Function that filters variant set on depth and allelic fraction 6 | according to settings provided by user (tumor and control)} 7 | \usage{ 8 | filter_read_support(vcf_df, config = NULL) 9 | } 10 | \arguments{ 11 | \item{vcf_df}{data frame with variants} 12 | 13 | \item{config}{list with PCGR configuration settings} 14 | } 15 | \value{ 16 | vcf_df 17 | } 18 | \description{ 19 | Function that filters variant set on depth and allelic fraction 20 | according to settings provided by user (tumor and control) 21 | } 22 | -------------------------------------------------------------------------------- /pcgrr/man/pon_status.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/germline.R 3 | \name{pon_status} 4 | \alias{pon_status} 5 | \title{Function that assigns a logical (STATUS_PON) reflecting whether 6 | a variant is co-inciding with a variant present in a panel-of-normals database 7 | (PANEL_OF_NORMALS column is TRUE)} 8 | \usage{ 9 | pon_status(sample_calls) 10 | } 11 | \arguments{ 12 | \item{sample_calls}{data frame with sample variant calls} 13 | } 14 | \description{ 15 | Function that assigns a logical (STATUS_PON) reflecting whether 16 | a variant is co-inciding with a variant present in a panel-of-normals database 17 | (PANEL_OF_NORMALS column is TRUE) 18 | } 19 | -------------------------------------------------------------------------------- /pcgrr/man/append_gwas_citation_phenotype.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/variant_annotation.R 3 | \name{append_gwas_citation_phenotype} 4 | \alias{append_gwas_citation_phenotype} 5 | \title{Function that adds GWAS citation/phenotype to GWAS hit found through PCGR annotation} 6 | \usage{ 7 | append_gwas_citation_phenotype(vcf_data_df = NULL, ref_data = NULL) 8 | } 9 | \arguments{ 10 | \item{vcf_data_df}{Data frame of sample variants from VCF} 11 | 12 | \item{ref_data}{PCGR/CPSR reference data object} 13 | } 14 | \value{ 15 | vcf_data_df 16 | } 17 | \description{ 18 | Function that adds GWAS citation/phenotype to GWAS hit found through PCGR annotation 19 | } 20 | -------------------------------------------------------------------------------- /pcgrr/man/structure_var_eitems.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/biomarkers.R 3 | \name{structure_var_eitems} 4 | \alias{structure_var_eitems} 5 | \title{Function that structures variant evidence items according 6 | to strength of evidence} 7 | \usage{ 8 | structure_var_eitems(var_eitems, annotation_tags, alteration_type = "MUT") 9 | } 10 | \arguments{ 11 | \item{var_eitems}{variant evidence items} 12 | 13 | \item{annotation_tags}{annotation tags to include for display} 14 | 15 | \item{alteration_type}{type of alteration ('MUT','CNA')} 16 | } 17 | \description{ 18 | Function that structures variant evidence items according 19 | to strength of evidence 20 | } 21 | -------------------------------------------------------------------------------- /pcgrr/man/vaf_plot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mutation.R 3 | \name{vaf_plot} 4 | \alias{vaf_plot} 5 | \title{Function that generates a VAF distribution plot for a given PCGR report object} 6 | \usage{ 7 | vaf_plot(report = NULL, font_size = 12, font_family = "Helvetica") 8 | } 9 | \arguments{ 10 | \item{report}{PCGR report object} 11 | 12 | \item{font_size}{font size for plot text elements} 13 | 14 | \item{font_family}{font family for plot text elements} 15 | } 16 | \value{ 17 | vaf_plot_plotly plotly object with VAF distribution plot 18 | } 19 | \description{ 20 | Function that generates a VAF distribution plot for a given PCGR report object 21 | } 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /pcgrr/man/assign_somatic_germline_evidence.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/germline.R 3 | \name{assign_somatic_germline_evidence} 4 | \alias{assign_somatic_germline_evidence} 5 | \title{Function that appends several tags denoting 6 | evidence for somatic/germline status of variants} 7 | \usage{ 8 | assign_somatic_germline_evidence(sample_calls, settings = NULL) 9 | } 10 | \arguments{ 11 | \item{sample_calls}{data frame with variants} 12 | 13 | \item{settings}{PCGR run/configuration settings} 14 | } 15 | \value{ 16 | sample_calls 17 | } 18 | \description{ 19 | Function that appends several tags denoting 20 | evidence for somatic/germline status of variants 21 | } 22 | -------------------------------------------------------------------------------- /pcgrr/man/check_common_colnames.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{check_common_colnames} 4 | \alias{check_common_colnames} 5 | \title{Function that checks whether a set of column names are present in two 6 | different data frames} 7 | \usage{ 8 | check_common_colnames(df1 = NULL, df2 = NULL, cnames = NULL) 9 | } 10 | \arguments{ 11 | \item{df1}{data frame 1} 12 | 13 | \item{df2}{data frame 2} 14 | 15 | \item{cnames}{character vector with column names to be check for presence} 16 | } 17 | \value{ 18 | existing_common_columns T/F 19 | } 20 | \description{ 21 | Function that checks whether a set of column names are present in two 22 | different data frames 23 | } 24 | -------------------------------------------------------------------------------- /pcgrr/man/clinvar_germline_status.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/germline.R 3 | \name{clinvar_germline_status} 4 | \alias{clinvar_germline_status} 5 | \title{Function that assigns a logical to STATUS_CLINVAR_GERMLINE based on 6 | whether a ClinVar entry of germline origin is found for a given variant 7 | (for entries in a data frame)} 8 | \usage{ 9 | clinvar_germline_status(sample_calls) 10 | } 11 | \arguments{ 12 | \item{sample_calls}{data frame with sample calls} 13 | } 14 | \description{ 15 | Function that assigns a logical to STATUS_CLINVAR_GERMLINE based on 16 | whether a ClinVar entry of germline origin is found for a given variant 17 | (for entries in a data frame) 18 | } 19 | -------------------------------------------------------------------------------- /pcgrr/man/append_drug_var_link.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/variant_annotation.R 3 | \name{append_drug_var_link} 4 | \alias{append_drug_var_link} 5 | \title{Function that adds link to targeted drugs (on and off-label) 6 | for a list of variants and associated targeted} 7 | \usage{ 8 | append_drug_var_link(var_df, primary_site = "Breast", ref_data = NULL) 9 | } 10 | \arguments{ 11 | \item{var_df}{data frame with variants} 12 | 13 | \item{primary_site}{primary tumor sample site} 14 | 15 | \item{ref_data}{PCGR/CPSR reference data object} 16 | } 17 | \description{ 18 | Function that adds link to targeted drugs (on and off-label) 19 | for a list of variants and associated targeted 20 | } 21 | -------------------------------------------------------------------------------- /pcgrr/man/append_cancer_association_ranks.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/variant_annotation.R 3 | \name{append_cancer_association_ranks} 4 | \alias{append_cancer_association_ranks} 5 | \title{Function that appends cancer gene evidence links} 6 | \usage{ 7 | append_cancer_association_ranks( 8 | var_data_df = NULL, 9 | ref_data = NULL, 10 | primary_site = "Any" 11 | ) 12 | } 13 | \arguments{ 14 | \item{var_data_df}{Data frame of sample variants from VCF} 15 | 16 | \item{ref_data}{PCGR/CPSR reference data object} 17 | 18 | \item{primary_site}{Primary tumor site} 19 | } 20 | \value{ 21 | vcf_data_df 22 | } 23 | \description{ 24 | Function that appends cancer gene evidence links 25 | } 26 | -------------------------------------------------------------------------------- /pcgrr/man/generate_report_data_kataegis.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/kataegis.R 3 | \name{generate_report_data_kataegis} 4 | \alias{generate_report_data_kataegis} 5 | \title{Function that generates data frame with potential kataegis events} 6 | \usage{ 7 | generate_report_data_kataegis( 8 | variant_set, 9 | sample_name = "SampleX", 10 | build = "grch37" 11 | ) 12 | } 13 | \arguments{ 14 | \item{variant_set}{data frame with SNVs/InDels (must contain 'CHROM', 15 | 'POS','REF','ALT')} 16 | 17 | \item{sample_name}{name of tumor sample} 18 | 19 | \item{build}{genome assembly (grch37/grch38)} 20 | } 21 | \description{ 22 | Function that generates data frame with potential kataegis events 23 | } 24 | -------------------------------------------------------------------------------- /pcgrr/man/order_variants.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{order_variants} 4 | \alias{order_variants} 5 | \title{Function that orders genomic aberrations according to order 6 | of chromosomes and chromosomal position} 7 | \usage{ 8 | order_variants(vcf_df, chrom_var = "CHROM", pos_var = "POS") 9 | } 10 | \arguments{ 11 | \item{vcf_df}{data frame} 12 | 13 | \item{chrom_var}{variable name of chromosome in data frame} 14 | 15 | \item{pos_var}{variable name for chromosomal position} 16 | } 17 | \value{ 18 | vcf_df data frame with ordered mutations 19 | } 20 | \description{ 21 | Function that orders genomic aberrations according to order 22 | of chromosomes and chromosomal position 23 | } 24 | -------------------------------------------------------------------------------- /pcgrr/man/plot_cna_segments.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/cna.R 3 | \name{plot_cna_segments} 4 | \alias{plot_cna_segments} 5 | \title{Plot allele-specific copy number segments} 6 | \usage{ 7 | plot_cna_segments( 8 | chrom_coordinates = NULL, 9 | cna_segment = NULL, 10 | cna_gene = NULL 11 | ) 12 | } 13 | \arguments{ 14 | \item{chrom_coordinates}{data frame with assembly-specific chromosome coordinate data (length etc)} 15 | 16 | \item{cna_segment}{data frame with annotated copy number segments} 17 | 18 | \item{cna_gene}{data frame with gene-level copy number data} 19 | } 20 | \description{ 21 | Function that plots allele-specific copy number segments 22 | (minor + total allele copies) 23 | } 24 | -------------------------------------------------------------------------------- /pcgrr/man/expand_biomarker_items.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/biomarkers.R 3 | \name{expand_biomarker_items} 4 | \alias{expand_biomarker_items} 5 | \title{Function that expands biomarker evidence items with variant annotations} 6 | \usage{ 7 | expand_biomarker_items( 8 | callset = NULL, 9 | variant_origin = "somatic", 10 | target_genes = NULL 11 | ) 12 | } 13 | \arguments{ 14 | \item{callset}{list object with 'variant' and 'biomarker_evidence' data 15 | frames} 16 | 17 | \item{variant_origin}{'somatic' or 'germline'} 18 | 19 | \item{target_genes}{data frame with target genes of interest} 20 | } 21 | \description{ 22 | Function that expands biomarker evidence items with variant annotations 23 | } 24 | -------------------------------------------------------------------------------- /pcgrr/man/load_somatic_snv_indel.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/input_data.R 3 | \name{load_somatic_snv_indel} 4 | \alias{load_somatic_snv_indel} 5 | \title{Function that reads and validates an annotated somatic SNV/InDel 6 | file from PCGR pre-reporting pipeline} 7 | \usage{ 8 | load_somatic_snv_indel(fname = NA, ref_data = NULL, settings = NULL) 9 | } 10 | \arguments{ 11 | \item{fname}{Path to file with pre-processed somatic SNV/InDel variants} 12 | 13 | \item{ref_data}{PCGR reference data object} 14 | 15 | \item{settings}{PCGR run/configuration settings} 16 | } 17 | \description{ 18 | Function that reads and validates an annotated somatic SNV/InDel 19 | file from PCGR pre-reporting pipeline 20 | } 21 | -------------------------------------------------------------------------------- /pcgrr/man/append_annotation_links.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/variant_annotation.R 3 | \name{append_annotation_links} 4 | \alias{append_annotation_links} 5 | \title{Function that appends multiple HTML annotation links to variant identifiers 6 | e.g. COSMIC, CLINVAR, REFSEQ etc} 7 | \usage{ 8 | append_annotation_links(var_data_df, vartype = "snv_indel", skip = NULL) 9 | } 10 | \arguments{ 11 | \item{var_data_df}{data frame with variant entries} 12 | 13 | \item{vartype}{'snv_indel' or 'cna', or 'exp'} 14 | 15 | \item{skip}{elements to be ignored during annotation} 16 | } 17 | \description{ 18 | Function that appends multiple HTML annotation links to variant identifiers 19 | e.g. COSMIC, CLINVAR, REFSEQ etc 20 | } 21 | -------------------------------------------------------------------------------- /pcgrr/man/effect_prediction_algos.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{effect_prediction_algos} 5 | \alias{effect_prediction_algos} 6 | \title{List of URLs for a range of variant effect prediction algorithms} 7 | \format{ 8 | A data.frame with 21 rows and 3 columns that indicates URL's for 9 | variant effect prediction algorithms 10 | \itemize{ 11 | \item \emph{algorithm} - Name encoding for effect prediction algorithm 12 | \item \emph{url} - URL 13 | \item \emph{display_name} - Display name for use in reporting 14 | } 15 | } 16 | \usage{ 17 | effect_prediction_algos 18 | } 19 | \description{ 20 | List of URLs for a range of variant effect prediction algorithms 21 | } 22 | \keyword{datasets} 23 | -------------------------------------------------------------------------------- /pcgrr/man/load_all_eitems.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/biomarkers.R 3 | \name{load_all_eitems} 4 | \alias{load_all_eitems} 5 | \title{Function that loads all evidence items from CIViC and CGI, and 6 | combines them in a unified data.frame} 7 | \usage{ 8 | load_all_eitems(eitems_raw = NULL, alteration_type = "MUT", origin = "Somatic") 9 | } 10 | \arguments{ 11 | \item{eitems_raw}{raw data frame with evidence items} 12 | 13 | \item{alteration_type}{type of alteration ('MUT','MUT_LOF','CNA')} 14 | 15 | \item{origin}{variant origin ('Germline','Somatic')} 16 | } 17 | \value{ 18 | all_eitems 19 | } 20 | \description{ 21 | Function that loads all evidence items from CIViC and CGI, and 22 | combines them in a unified data.frame 23 | } 24 | -------------------------------------------------------------------------------- /pcgrr/man/msi_indel_load_plot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/msi.R 3 | \name{msi_indel_load_plot} 4 | \alias{msi_indel_load_plot} 5 | \title{Function that plots the indel load for a given sample and 6 | contrasts this with the distribution for MSI-H/MSS samples from TCGA} 7 | \usage{ 8 | msi_indel_load_plot(tcga_msi_dataset, indel_load) 9 | } 10 | \arguments{ 11 | \item{tcga_msi_dataset}{underlying dataset from TCGA used for development 12 | of statistical classifier} 13 | 14 | \item{indel_load}{fraction of indels of all mutations (SNVs + indels)} 15 | } 16 | \value{ 17 | p 18 | } 19 | \description{ 20 | Function that plots the indel load for a given sample and 21 | contrasts this with the distribution for MSI-H/MSS samples from TCGA 22 | } 23 | -------------------------------------------------------------------------------- /pcgrr/man/generate_tier_tsv.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/main.R 3 | \name{generate_tier_tsv} 4 | \alias{generate_tier_tsv} 5 | \title{Function that generates dense and tiered annotated variant datasets} 6 | \usage{ 7 | generate_tier_tsv(variant_set, config, annotation_tags, sample_name = "test") 8 | } 9 | \arguments{ 10 | \item{variant_set}{List with tiered variants} 11 | 12 | \item{config}{PCGR configuration settings} 13 | 14 | \item{annotation_tags}{List with display columns} 15 | 16 | \item{sample_name}{Sample identifier} 17 | } 18 | \value{ 19 | tsv_variants data frame with tier-annotated list of 20 | variants for tab-separated output 21 | } 22 | \description{ 23 | Function that generates dense and tiered annotated variant datasets 24 | } 25 | -------------------------------------------------------------------------------- /pcgrr/man/get_oncogenic_cna_events.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/cna.R 3 | \name{get_oncogenic_cna_events} 4 | \alias{get_oncogenic_cna_events} 5 | \title{Get oncogenic copy number events} 6 | \usage{ 7 | get_oncogenic_cna_events(cna_df_display = NULL) 8 | } 9 | \arguments{ 10 | \item{cna_df_display}{data frame with transcript annotations per 11 | copy number segment} 12 | } 13 | \description{ 14 | Function that extracts oncogenic copy number events from 15 | a data frame of annotated transcripts (within copy number segments), 16 | utilizing oncogene/tumor suppressor status and copy number 17 | variant class (gain/loss). This set is used to highlight 18 | copy-altered transcripts that are presumably oncogenic, yet 19 | not actionable \emph{per se}. 20 | } 21 | -------------------------------------------------------------------------------- /pcgrr/man/append_targeted_drug_annotations.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/variant_annotation.R 3 | \name{append_targeted_drug_annotations} 4 | \alias{append_targeted_drug_annotations} 5 | \title{Function that adds link to targeted drugs (on and off-label) 6 | for a list of variants and associated targeted} 7 | \usage{ 8 | append_targeted_drug_annotations( 9 | var_df, 10 | primary_site = "Breast", 11 | ref_data = NULL 12 | ) 13 | } 14 | \arguments{ 15 | \item{var_df}{data frame with variants} 16 | 17 | \item{primary_site}{primary site of tumor sample} 18 | 19 | \item{ref_data}{PCGR/CPSR reference data object} 20 | } 21 | \description{ 22 | Function that adds link to targeted drugs (on and off-label) 23 | for a list of variants and associated targeted 24 | } 25 | -------------------------------------------------------------------------------- /pcgrr/man/generate_report_data_trials.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/clinicaltrials.R 3 | \name{generate_report_data_trials} 4 | \alias{generate_report_data_trials} 5 | \title{Function that retrieves relevant (interventional based on molecular target) 6 | clinical trials for a given tumor type} 7 | \usage{ 8 | generate_report_data_trials(pcgr_data, config, sample_name) 9 | } 10 | \arguments{ 11 | \item{pcgr_data}{PCGR data bundle object} 12 | 13 | \item{config}{PCGR run configurations} 14 | 15 | \item{sample_name}{sample name} 16 | } 17 | \value{ 18 | pcg_report_trials data frame with all report elements 19 | } 20 | \description{ 21 | Function that retrieves relevant (interventional based on molecular target) 22 | clinical trials for a given tumor type 23 | } 24 | -------------------------------------------------------------------------------- /pcgrr/man/variant_stats_report.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{variant_stats_report} 4 | \alias{variant_stats_report} 5 | \title{Function that generate stats for a given variant set, considering 6 | number of variants/genes affected across tiers, types of variants 7 | ()} 8 | \usage{ 9 | variant_stats_report(callset = NULL, name = "vstats", vartype = "snv_indel") 10 | } 11 | \arguments{ 12 | \item{callset}{list object with callset data (CNA or SNVs/InDels)} 13 | 14 | \item{name}{type of variant statistic} 15 | 16 | \item{vartype}{type of variant ('snv_indel', 'cna')} 17 | } 18 | \description{ 19 | Function that generate stats for a given variant set, considering 20 | number of variants/genes affected across tiers, types of variants 21 | () 22 | } 23 | -------------------------------------------------------------------------------- /pcgrr/man/assign_somatic_classification.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/germline.R 3 | \name{assign_somatic_classification} 4 | \alias{assign_somatic_classification} 5 | \title{Function that assigns a SOMATIC_CLASSIFICATION to variants 6 | based on evidence found in variant set, 7 | potentially limited by user-defined options} 8 | \usage{ 9 | assign_somatic_classification(sample_calls, settings) 10 | } 11 | \arguments{ 12 | \item{sample_calls}{data frame with putative somatic variants} 13 | 14 | \item{settings}{PCGR run/configuration settings} 15 | } 16 | \value{ 17 | sample_calls 18 | } 19 | \description{ 20 | Function that assigns a SOMATIC_CLASSIFICATION to variants 21 | based on evidence found in variant set, 22 | potentially limited by user-defined options 23 | } 24 | -------------------------------------------------------------------------------- /pcgrr/man/get_clin_assocs_cna.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/biomarkers.R 3 | \name{get_clin_assocs_cna} 4 | \alias{get_clin_assocs_cna} 5 | \title{Function that retrieves clinical evidence items (CIVIC, CBMDB) for 6 | CNA aberrations} 7 | \usage{ 8 | get_clin_assocs_cna(onco_ts_sets, annotation_tags = NULL, eitems = NULL) 9 | } 10 | \arguments{ 11 | \item{onco_ts_sets}{data frame with annotations with respect to 12 | lost tumor suppressor genes and gained oncogenes} 13 | 14 | \item{annotation_tags}{list with annotation tags for display in report} 15 | 16 | \item{eitems}{Data frame with clinical evidence items} 17 | } 18 | \value{ 19 | list 20 | } 21 | \description{ 22 | Function that retrieves clinical evidence items (CIVIC, CBMDB) for 23 | CNA aberrations 24 | } 25 | -------------------------------------------------------------------------------- /pcgrr/inst/templates/pcgr_quarto_report/expression.qmd: -------------------------------------------------------------------------------- 1 | ## Gene expression analysis 2 | 3 | ```{r expression_similarity} 4 | #| eval: !expr as.logical(pcg_report$settings$conf$expression$similarity_analysis) == TRUE 5 | #| output: asis 6 | #| child: pcgr_quarto_report/expression/expression_similarity.qmd 7 | 8 | ``` 9 | 10 |
11 | 12 | ```{r expression_outliers} 13 | #| eval: !expr as.logical(NROW(pcg_report$content$expression$outliers) > 0) == TRUE 14 | #| output: asis 15 | #| child: pcgr_quarto_report/expression/expression_outliers.qmd 16 | 17 | ``` 18 | 19 |
20 | 21 | ```{r expression_immune_contexture} 22 | #| eval: !expr as.logical(NROW(pcg_report$content$expression$immune_contexture) > 0) == TRUE 23 | #| output: asis 24 | #| child: pcgr_quarto_report/expression/immune_contexture.qmd 25 | 26 | ``` 27 | 28 | -------------------------------------------------------------------------------- /pcgrr/man/msi_indel_fraction_plot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/msi.R 3 | \name{msi_indel_fraction_plot} 4 | \alias{msi_indel_fraction_plot} 5 | \title{Function that plots the indel fraction for a given sample and 6 | contrasts this with the distribution for MSI-H/MSS samples from TCGA} 7 | \usage{ 8 | msi_indel_fraction_plot(tcga_msi_dataset, indel_fraction) 9 | } 10 | \arguments{ 11 | \item{tcga_msi_dataset}{underlying dataset from TCGA used for development 12 | of statistical classifier} 13 | 14 | \item{indel_fraction}{fraction of indels of all mutations (SNVs + indels)} 15 | } 16 | \value{ 17 | p 18 | } 19 | \description{ 20 | Function that plots the indel fraction for a given sample and 21 | contrasts this with the distribution for MSI-H/MSS samples from TCGA 22 | } 23 | -------------------------------------------------------------------------------- /pcgrr/man/write_processed_vcf.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{write_processed_vcf} 4 | \alias{write_processed_vcf} 5 | \title{Function that writes a VCF intended for mutational signature analysis} 6 | \usage{ 7 | write_processed_vcf( 8 | calls, 9 | sample_name = NULL, 10 | output_directory = NULL, 11 | vcf_fname = NULL, 12 | snv_only = TRUE 13 | ) 14 | } 15 | \arguments{ 16 | \item{calls}{data frame with calls} 17 | 18 | \item{sample_name}{sample name} 19 | 20 | \item{output_directory}{Output directory for output file} 21 | 22 | \item{vcf_fname}{filename for VCF} 23 | 24 | \item{snv_only}{logical, if TRUE only SNVs are written to VCF} 25 | } 26 | \description{ 27 | Function that writes a VCF intended for mutational signature analysis 28 | } 29 | -------------------------------------------------------------------------------- /pcgrr/man/df_string_replace.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{df_string_replace} 4 | \alias{df_string_replace} 5 | \title{Function that performs stringr::str_replace on strings of multiple 6 | string columns of a dataframe} 7 | \usage{ 8 | df_string_replace(df, strings, pattern, replacement, replace_all = F) 9 | } 10 | \arguments{ 11 | \item{df}{data frame} 12 | 13 | \item{strings}{name of columns for which string replace is to be performed} 14 | 15 | \item{pattern}{pattern to replace} 16 | 17 | \item{replacement}{string to replace} 18 | 19 | \item{replace_all}{logical - replace all occurrences} 20 | } 21 | \value{ 22 | df 23 | } 24 | \description{ 25 | Function that performs stringr::str_replace on strings of multiple 26 | string columns of a dataframe 27 | } 28 | -------------------------------------------------------------------------------- /pcgrr/man/cosmic_sbs_signatures.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{cosmic_sbs_signatures} 5 | \alias{cosmic_sbs_signatures} 6 | \title{List of COSMIC reference mutational signatures (SBS, v3.4)} 7 | \format{ 8 | A list with two matrix objects ('all' and 'no_artefacts'). 9 | One matrix contains the COSMIC reference mutational signatures without signature 10 | artefacts ('no_artefacts', number of columns = 68), while the other contains 11 | all signatures, including artefacts ('all', number of columns = 86). Each 12 | matrix has 96 rows, one for each of the 96 possible trinucleotide contexts. 13 | } 14 | \usage{ 15 | cosmic_sbs_signatures 16 | } 17 | \description{ 18 | List of COSMIC reference mutational signatures (SBS, v3.4) 19 | } 20 | \keyword{datasets} 21 | -------------------------------------------------------------------------------- /pcgrr/man/het_af_germline_status.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/germline.R 3 | \name{het_af_germline_status} 4 | \alias{het_af_germline_status} 5 | \title{Function that assigns a logical (STATUS_LIKELY_GERMLINE_HETEROZYGOUS) reflecting whether 6 | a variant is likely heterozygous (germline) - based on allelic fraction (VAF_TUMOR), 7 | presence in gnomAD and dbSNP, and no presence in TCGA and COSMIC} 8 | \usage{ 9 | het_af_germline_status(sample_calls) 10 | } 11 | \arguments{ 12 | \item{sample_calls}{data frame with sample variant calls} 13 | } 14 | \description{ 15 | Function that assigns a logical (STATUS_LIKELY_GERMLINE_HETEROZYGOUS) reflecting whether 16 | a variant is likely heterozygous (germline) - based on allelic fraction (VAF_TUMOR), 17 | presence in gnomAD and dbSNP, and no presence in TCGA and COSMIC 18 | } 19 | -------------------------------------------------------------------------------- /pcgrr/man/load_expression_outliers.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/input_data.R 3 | \name{load_expression_outliers} 4 | \alias{load_expression_outliers} 5 | \title{Load expression outlier results} 6 | \usage{ 7 | load_expression_outliers( 8 | settings = NULL, 9 | ref_data = NULL, 10 | percentile_cutoff_high = 95, 11 | percentile_cutoff_low = 5, 12 | z_score_cutoff = 1.5 13 | ) 14 | } 15 | \arguments{ 16 | \item{settings}{PCGR run/configuration settings} 17 | 18 | \item{ref_data}{PCGR reference data object} 19 | 20 | \item{percentile_cutoff_high}{numeric, percentile cutoff for high expression} 21 | 22 | \item{percentile_cutoff_low}{numeric, percentile cutoff for low expression} 23 | 24 | \item{z_score_cutoff}{numeric, z-score cutoff for expression outliers} 25 | } 26 | \description{ 27 | Load expression outlier results 28 | } 29 | -------------------------------------------------------------------------------- /pcgrr/man/plot_signature_contributions.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mutational_signatures.R 3 | \name{plot_signature_contributions} 4 | \alias{plot_signature_contributions} 5 | \title{Function that makes plots of mutational signature contributions 6 | in a given sample (both ggplot and plotly)} 7 | \usage{ 8 | plot_signature_contributions( 9 | signature_contributions = NULL, 10 | per_signature = TRUE 11 | ) 12 | } 13 | \arguments{ 14 | \item{signature_contributions}{A list with two data frames: 'per_group' and 15 | 'per_signature'.} 16 | 17 | \item{per_signature}{Logical. If TRUE, the plot will show the contribution 18 | per signature. If FALSE, the plot will show the contribution per group.} 19 | } 20 | \description{ 21 | Function that makes plots of mutational signature contributions 22 | in a given sample (both ggplot and plotly) 23 | } 24 | -------------------------------------------------------------------------------- /pcgrr/man/qc_var_eitems.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/biomarkers.R 3 | \name{qc_var_eitems} 4 | \alias{qc_var_eitems} 5 | \title{Function that matches variants to evidence items} 6 | \usage{ 7 | qc_var_eitems(var_eitems = NULL, marker_type = "codon") 8 | } 9 | \arguments{ 10 | \item{var_eitems}{variant-evidence items} 11 | 12 | \item{marker_type}{type of biomarker} 13 | } 14 | \description{ 15 | param sample_calls data frame with variant calls 16 | param db database with evidence items ('civic','cgi') 17 | param colset character vector with column names to pull out from sample_calls 18 | param eitems raw list of evidence items 19 | param region_marker logical indication if region biomarkers are to be matched or not 20 | } 21 | \details{ 22 | export 23 | Function that makes a quality control check of evidence items assigned 24 | to variants 25 | } 26 | -------------------------------------------------------------------------------- /pcgrr/man/load_somatic_cna.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/input_data.R 3 | \name{load_somatic_cna} 4 | \alias{load_somatic_cna} 5 | \title{Function that reads and validates fully annotated CNA data (segments and genes) 6 | from PCGR pre-reporting pipeline} 7 | \usage{ 8 | load_somatic_cna( 9 | fname_cna_segment = NULL, 10 | fname_cna_gene = NULL, 11 | ref_data = NULL, 12 | settings = NULL 13 | ) 14 | } 15 | \arguments{ 16 | \item{fname_cna_segment}{Path to file with pre-processed CNA segments} 17 | 18 | \item{fname_cna_gene}{Path to file with pre-processed CNA gene-level data} 19 | 20 | \item{ref_data}{PCGR reference data object} 21 | 22 | \item{settings}{PCGR run/configuration settings} 23 | } 24 | \description{ 25 | Function that reads and validates fully annotated CNA data (segments and genes) 26 | from PCGR pre-reporting pipeline 27 | } 28 | -------------------------------------------------------------------------------- /pcgrr/man/detect_vcf_sample_name.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{detect_vcf_sample_name} 4 | \alias{detect_vcf_sample_name} 5 | \title{A function that detects whether the sample name in 6 | variant data frame is unique (as present in column name VCF_SAMPLE_ID), throws an error if 7 | multiple sample names are present for the CPSR workflow} 8 | \usage{ 9 | detect_vcf_sample_name(df, sample_name = NULL, cpsr = FALSE) 10 | } 11 | \arguments{ 12 | \item{df}{VCF data frame} 13 | 14 | \item{sample_name}{name of sample identifier} 15 | 16 | \item{cpsr}{logical indicating CPSR workflow} 17 | } 18 | \value{ 19 | df Vranges object 20 | } 21 | \description{ 22 | A function that detects whether the sample name in 23 | variant data frame is unique (as present in column name VCF_SAMPLE_ID), throws an error if 24 | multiple sample names are present for the CPSR workflow 25 | } 26 | -------------------------------------------------------------------------------- /pcgrr/man/load_cpsr_classified_variants.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/input_data.R 3 | \name{load_cpsr_classified_variants} 4 | \alias{load_cpsr_classified_variants} 5 | \title{Function that reads CPSR-classified variants from a TSV file} 6 | \usage{ 7 | load_cpsr_classified_variants( 8 | fname_cpsr_tsv = NA, 9 | fname_cpsr_yaml = NA, 10 | cols = NULL, 11 | ignore_vus = FALSE, 12 | ref_data = NULL 13 | ) 14 | } 15 | \arguments{ 16 | \item{fname_cpsr_tsv}{Path to raw input file with CPSR-classified SNVs/InDels} 17 | 18 | \item{fname_cpsr_yaml}{Path to YAML configuration file for CPSR analysis} 19 | 20 | \item{cols}{column type definitions of raw input file} 21 | 22 | \item{ignore_vus}{logical indicating if VUS should be ignored in report} 23 | 24 | \item{ref_data}{PCGR reference data object} 25 | } 26 | \description{ 27 | Function that reads CPSR-classified variants from a TSV file 28 | } 29 | -------------------------------------------------------------------------------- /pcgrr/data-raw/gnomad_populations.tsv: -------------------------------------------------------------------------------- 1 | code subset db pop_description 2 | afr non-cancer gnomad African non-cancer subset 3 | amr non-cancer gnomad Admixed American non-cancer subset 4 | nfe non-cancer gnomad Non-Finnish European non-cancer subset 5 | fin non-cancer gnomad Finnish non-cancer subset 6 | oth non-cancer gnomad Other non-cancer subset 7 | asj non-cancer gnomad Ashkenazi Jewish non-cancer subset 8 | eas non-cancer gnomad East Asian non-cancer subset 9 | sas non-cancer gnomad South Asian non-cancer subset 10 | global non-cancer gnomad Global non-cancer subset 11 | afr all gnomad African all subset 12 | amr all gnomad Admixed American all subset 13 | nfe all gnomad Non-Finnish European all subset 14 | fin all gnomad Finnish all subset 15 | oth all gnomad Other all subset 16 | asj all gnomad Ashkenazi Jewish all subset 17 | eas all gnomad East Asian all subset 18 | sas all gnomad South Asian all subset 19 | mid all gnomad Middle Eastern subset 20 | global all gnomad Global all subset 21 | -------------------------------------------------------------------------------- /pcgrr/man/generate_report_data_rainfall.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mutational_signatures.R 3 | \name{generate_report_data_rainfall} 4 | \alias{generate_report_data_rainfall} 5 | \title{Function that generates data for rainfall plot (mutation density 6 | along genome, considering SNVs only)} 7 | \usage{ 8 | generate_report_data_rainfall( 9 | variant_set, 10 | colors = NULL, 11 | autosomes = FALSE, 12 | build = NULL 13 | ) 14 | } 15 | \arguments{ 16 | \item{variant_set}{data frame with SNVs/InDels (must contain "CHROM", 17 | "POS","REF","ALT")} 18 | 19 | \item{colors}{character vector of six color codes (denoting the 20 | different mutation types)} 21 | 22 | \item{autosomes}{logical indicating if plotting should only 23 | consider autosomes} 24 | 25 | \item{build}{genome assembly (grch37/grch38)} 26 | } 27 | \description{ 28 | Function that generates data for rainfall plot (mutation density 29 | along genome, considering SNVs only) 30 | } 31 | -------------------------------------------------------------------------------- /pcgrr/man/variant_db_url.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{variant_db_url} 5 | \alias{variant_db_url} 6 | \title{List of URLS and variant identifiers for variant/gene/protein domain databases} 7 | \format{ 8 | A data.frame with 6 rows and 5 columns that indicates URL's for various variant/gene databases 9 | and how to use PCGR annotation columns to generate variant links 10 | \itemize{ 11 | \item \emph{name} - Name encoding for variant/gene database 12 | \item \emph{group_by_var} - Which column should be used for grouping 13 | \item \emph{url_prefix} - URL prefix 14 | \item \emph{link_key_var} - Which column to be used as the key value in link 15 | \item \emph{link_display_var} - Which column to be used as the display variable in link 16 | } 17 | } 18 | \usage{ 19 | variant_db_url 20 | } 21 | \description{ 22 | List of URLS and variant identifiers for variant/gene/protein domain databases 23 | } 24 | \keyword{datasets} 25 | -------------------------------------------------------------------------------- /pcgrr/man/assign_amp_asco_tiers.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/variant_classification.R 3 | \name{assign_amp_asco_tiers} 4 | \alias{assign_amp_asco_tiers} 5 | \title{Function that assigns tier classifications to somatic CNA segments and 6 | SNVs/InDels, based on the presence of biomarker evidence found in 7 | the variant set} 8 | \usage{ 9 | assign_amp_asco_tiers( 10 | vartype = "snv_indel", 11 | primary_site = "Any", 12 | variants_df = NULL, 13 | biomarker_items = NULL 14 | ) 15 | } 16 | \arguments{ 17 | \item{vartype}{variant type ('snv_indel' or 'cna')} 18 | 19 | \item{primary_site}{primary tumor site} 20 | 21 | \item{variants_df}{data frame with variants (SNVs/InDels or CNAs)} 22 | 23 | \item{biomarker_items}{data frame with biomarker evidence items} 24 | } 25 | \description{ 26 | Function that assigns tier classifications to somatic CNA segments and 27 | SNVs/InDels, based on the presence of biomarker evidence found in 28 | the variant set 29 | } 30 | -------------------------------------------------------------------------------- /pcgrr/man/sort_chromosomal_segments.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{sort_chromosomal_segments} 4 | \alias{sort_chromosomal_segments} 5 | \title{Function that sorts chromosomal segments according to chromosome 6 | and chromosomal start/end position} 7 | \usage{ 8 | sort_chromosomal_segments( 9 | df, 10 | chromosome_column = "CHROM", 11 | start_segment = "POS", 12 | end_segment = "POS" 13 | ) 14 | } 15 | \arguments{ 16 | \item{df}{data frame with chromosome and start + end segment} 17 | 18 | \item{chromosome_column}{name of column for chromosome name is sigven} 19 | 20 | \item{start_segment}{name of column that indicates start of 21 | chromosomal segment} 22 | 23 | \item{end_segment}{name of column that indicates end of chromosomal segment} 24 | } 25 | \value{ 26 | df_final data frame with sorted chromosomal segments 27 | } 28 | \description{ 29 | Function that sorts chromosomal segments according to chromosome 30 | and chromosomal start/end position 31 | } 32 | -------------------------------------------------------------------------------- /pcgrr/man/generate_report_data_signatures.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mutational_signatures.R 3 | \name{generate_report_data_signatures} 4 | \alias{generate_report_data_signatures} 5 | \title{Function that generates mutational signatures data for PCGR report} 6 | \usage{ 7 | generate_report_data_signatures( 8 | variant_set = NULL, 9 | vstats = NULL, 10 | ref_data = NULL, 11 | settings = NULL, 12 | n_bootstrap_iterations = 200, 13 | sig_contribution_cutoff = 0.01 14 | ) 15 | } 16 | \arguments{ 17 | \item{variant_set}{Somatic callset (SNV)} 18 | 19 | \item{vstats}{Variant statistics object} 20 | 21 | \item{ref_data}{PCGR reference data object} 22 | 23 | \item{settings}{PCGR run/configuration settings} 24 | 25 | \item{n_bootstrap_iterations}{Number of bootstrap iterations for signature analysis} 26 | 27 | \item{sig_contribution_cutoff}{Minimal signature contribution for reporting} 28 | } 29 | \description{ 30 | Function that generates mutational signatures data for PCGR report 31 | } 32 | -------------------------------------------------------------------------------- /pcgrr/man/predict_msi_status.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/msi.R 3 | \name{predict_msi_status} 4 | \alias{predict_msi_status} 5 | \title{Function that predicts MSI status based on fraction of indels among calls} 6 | \usage{ 7 | predict_msi_status( 8 | variant_set, 9 | ref_data, 10 | msi_prediction_model, 11 | msi_prediction_dataset, 12 | target_size_mb, 13 | sample_name = "Test" 14 | ) 15 | } 16 | \arguments{ 17 | \item{variant_set}{data frame with somatic mutations/indels} 18 | 19 | \item{ref_data}{PCGR reference data object} 20 | 21 | \item{msi_prediction_model}{statistical model for MSI prediction} 22 | 23 | \item{msi_prediction_dataset}{underlying dataset from TCGA used for 24 | development of statistical classifier} 25 | 26 | \item{target_size_mb}{size of targeted genomic region (coding)} 27 | 28 | \item{sample_name}{name of sample} 29 | } 30 | \value{ 31 | msi_data 32 | } 33 | \description{ 34 | Function that predicts MSI status based on fraction of indels among calls 35 | } 36 | -------------------------------------------------------------------------------- /pcgrr/inst/CITATION: -------------------------------------------------------------------------------- 1 | citHeader("To cite PCGR in publications use:") 2 | 3 | citEntry( 4 | entry = "Article", 5 | title = paste0("Personal Cancer Genome Reporter: variant interpretation ", 6 | "report for precision oncology"), 7 | author = personList( 8 | as.person("Sigve Nakken"), 9 | as.person("Ghislain Fournous"), 10 | as.person("Daniel Vodák"), 11 | as.person("Lars Birger Aasheim"), 12 | as.person("Ola Myklebost"), 13 | as.person("Eivind Hovig") 14 | ), 15 | journal = "Bioinformatics", 16 | year = "2017", 17 | month = "12", 18 | volume = "34", 19 | number = "10", 20 | pages = "1778-1780", 21 | url = "https://doi.org/10.1093/bioinformatics/btx817", 22 | textVersion = paste0( 23 | "Sigve Nakken, Ghislain Fournous, Daniel Vodák, ", 24 | "Lars Birger Aaasheim, Ola Myklebost, and Eivind Hovig. ", 25 | "Personal Cancer Genome Reporter: variant interpretation ", 26 | "report for precision oncology (2017). Bioinformatics. ", 27 | "34(10):1778–1780. doi:10.1093/bioinformatics/btx817" 28 | ) 29 | ) 30 | -------------------------------------------------------------------------------- /pcgrr/man/deduplicate_eitems.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/biomarkers.R 3 | \name{deduplicate_eitems} 4 | \alias{deduplicate_eitems} 5 | \title{Function that removes redundancy in variant evidence items (i.e. if 6 | a variant is assicated with evidence at the codon level, evidence 7 | at the exon/gene level is ignored)} 8 | \usage{ 9 | deduplicate_eitems( 10 | var_eitems = NULL, 11 | target_type = "exact", 12 | target_other = c("codon", "exon", "gene") 13 | ) 14 | } 15 | \arguments{ 16 | \item{var_eitems}{data frame with variant evidence items} 17 | 18 | \item{target_type}{which resolution level should be used as the 19 | "best" level ('exact' or 'codon)} 20 | 21 | \item{target_other}{resolution levels for other evidence items 22 | that should be ignored if evidence is found at the target_type level} 23 | } 24 | \description{ 25 | Function that removes redundancy in variant evidence items (i.e. if 26 | a variant is assicated with evidence at the codon level, evidence 27 | at the exon/gene level is ignored) 28 | } 29 | -------------------------------------------------------------------------------- /pcgrr/man/kataegis_input.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/kataegis.R 3 | \name{kataegis_input} 4 | \alias{kataegis_input} 5 | \title{Function that detects kataegis events from a data frame 6 | with genomic cooordinates of mutations} 7 | \usage{ 8 | kataegis_input( 9 | variant_set, 10 | chr = "chr", 11 | pos = "pos", 12 | ref = "ref", 13 | alt = "alt", 14 | build = NULL, 15 | context_size = 10 16 | ) 17 | } 18 | \arguments{ 19 | \item{variant_set}{data frame with raw set of somatic mutations} 20 | 21 | \item{chr}{column name in data that denotes chromosome} 22 | 23 | \item{pos}{column name in data that denotes position} 24 | 25 | \item{ref}{column name in data that denotes reference allele} 26 | 27 | \item{alt}{column name in data that denotes alternate allele} 28 | 29 | \item{build}{genome build (grch37 or hg38)} 30 | 31 | \item{context_size}{size of neighbouring sequence context} 32 | } 33 | \description{ 34 | Function that detects kataegis events from a data frame 35 | with genomic cooordinates of mutations 36 | } 37 | -------------------------------------------------------------------------------- /pcgrr/man/assign_germline_popfreq_status.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/germline.R 3 | \name{assign_germline_popfreq_status} 4 | \alias{assign_germline_popfreq_status} 5 | \title{Function that sets STATUS_POPFREQ_1KG_ABOVE_TOLERATED/ 6 | STATUS_POPFREQ_GNOMAD_ABOVE_TOLERATED to TRUE for variants 7 | if any population frequency exceeds max_tolerated_af} 8 | \usage{ 9 | assign_germline_popfreq_status( 10 | sample_calls, 11 | pop = "NFE", 12 | dbquery = c("gnomADe", "gnomADg"), 13 | max_tolerated_af = 0.01 14 | ) 15 | } 16 | \arguments{ 17 | \item{sample_calls}{data frame with variants} 18 | 19 | \item{pop}{population code (1000 Genomes/gnomAD)} 20 | 21 | \item{dbquery}{character vector with germline db sources, 22 | e.g. c("gnomADe","gnomADg")} 23 | 24 | \item{max_tolerated_af}{max tolerated germline allele frequency} 25 | } 26 | \value{ 27 | sample_calls 28 | } 29 | \description{ 30 | Function that sets STATUS_POPFREQ_1KG_ABOVE_TOLERATED/ 31 | STATUS_POPFREQ_GNOMAD_ABOVE_TOLERATED to TRUE for variants 32 | if any population frequency exceeds max_tolerated_af 33 | } 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Sigve Nakken 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /pcgrr/LICENSE.md: -------------------------------------------------------------------------------- 1 | # MIT License 2 | 3 | Copyright (c) 2021 Sigve Nakken 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /pcgrr/man/load_dna_variants.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/input_data.R 3 | \name{load_dna_variants} 4 | \alias{load_dna_variants} 5 | \title{Function that reads and validates CNA or SNV/InDel TSV files 6 | file from PCGR/CPSR pre-report (Python) pipeline} 7 | \usage{ 8 | load_dna_variants( 9 | fname = NA, 10 | cols = NULL, 11 | ref_data = NULL, 12 | vartype = "snv_indel", 13 | primary_site = "Any", 14 | retained_info_tags = "None", 15 | variant_origin = "Somatic" 16 | ) 17 | } 18 | \arguments{ 19 | \item{fname}{Path to raw input file with DNA aberrations (PCGR/CPSR)} 20 | 21 | \item{cols}{column type definitions of raw input file} 22 | 23 | \item{ref_data}{PCGR reference data object} 24 | 25 | \item{vartype}{type of DNA aberrations ('snv_indel','cna')} 26 | 27 | \item{primary_site}{primary site of tumor} 28 | 29 | \item{retained_info_tags}{VCF INFO tags to be retained in output (SNVs/InDels)} 30 | 31 | \item{variant_origin}{Germline/Somatic} 32 | } 33 | \description{ 34 | Function that reads and validates CNA or SNV/InDel TSV files 35 | file from PCGR/CPSR pre-report (Python) pipeline 36 | } 37 | -------------------------------------------------------------------------------- /pcgrr/man/color_palette.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{color_palette} 5 | \alias{color_palette} 6 | \title{Color encodings for report elements of PCGR/CPSR} 7 | \format{ 8 | A list object with different report elements that are color-coded in 9 | PCGR/CPSR reports. Each list element have two vectors: 'levels' and 'values'. 10 | Currently, the following list elements are included: 11 | \itemize{ 12 | \item \emph{pathogenicity} - Colors for five-level pathogenicity levels (CPSR) 13 | \item \emph{clinical_evidence} - Colors for strength of evidence of cancer-variant associations (A-E) 14 | \item \emph{tier} - Colors for tier levels for variant prioritization (PCGR) 15 | \item \emph{report_color} - Colors for PCGR assay mode (tumor-control vs. tumor-only) 16 | \item \emph{warning} - Color for warning (low confidence in PCGR analysis output) 17 | \item \emph{success} - Color for success (no evident uncertainty in PCGR analysis output) 18 | } 19 | } 20 | \usage{ 21 | color_palette 22 | } 23 | \description{ 24 | Color encodings for report elements of PCGR/CPSR 25 | } 26 | \keyword{datasets} 27 | -------------------------------------------------------------------------------- /pcgr/splice.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import csv 5 | from logging import Logger 6 | 7 | 8 | def load_splice_effects(mutsplice_db_fname: str, logger: Logger): 9 | """ 10 | Load splice variants with functional effects (MutSpliceDB) from a file. 11 | """ 12 | 13 | splice_variants = {} 14 | if not os.path.exists(mutsplice_db_fname): 15 | logger.info(f"ERROR: File '{mutsplice_db_fname}' does not exist - exiting") 16 | exit(1) 17 | 18 | with open(mutsplice_db_fname, mode='rt') as f: 19 | reader = csv.DictReader(f, delimiter='\t') 20 | for row in reader: 21 | key = str(row['ENTREZGENE']) + '_' + str(row['REFSEQ_TRANSCRIPT_ID']) + '_' + str(row['HGVSC']) 22 | splice_variants[key] = \ 23 | str(row['ENTREZGENE']) + '|' + \ 24 | str(row['SYMBOL']) + '|' + \ 25 | str(row['REFSEQ_TRANSCRIPT_ID']) + '|' + \ 26 | str(row['HGVSC']) + '|' + \ 27 | str(row['SPLICE_EFFECT']) + '|' + \ 28 | str(row['AFFECTED_EXONS']) + '|' + \ 29 | str(row['SOURCE']) 30 | 31 | return splice_variants -------------------------------------------------------------------------------- /pcgrr/man/plot_tmb_primary_site_tcga.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mutational_burden.R 3 | \name{plot_tmb_primary_site_tcga} 4 | \alias{plot_tmb_primary_site_tcga} 5 | \title{Function that makes a plot with TMB boxplots for reference cohorts, highlighting 6 | the TMB estimate for a given sample and the cohort/primary site of interest} 7 | \usage{ 8 | plot_tmb_primary_site_tcga( 9 | tmb_reference, 10 | p_site = "Liver", 11 | tmb_estimates = NULL, 12 | tmb_display_type = "missense_only", 13 | tumor_only = FALSE 14 | ) 15 | } 16 | \arguments{ 17 | \item{tmb_reference}{data frame with TMB estimates for reference samples (e.g. TCGA)} 18 | 19 | \item{p_site}{primary tumor_site (sample)} 20 | 21 | \item{tmb_estimates}{data frame with estimates of mutational burden (sample)} 22 | 23 | \item{tmb_display_type}{TMB estimation used for display (e.g. missense_only)} 24 | 25 | \item{tumor_only}{logical, if TRUE color using tumor-only color} 26 | } 27 | \description{ 28 | Function that makes a plot with TMB boxplots for reference cohorts, highlighting 29 | the TMB estimate for a given sample and the cohort/primary site of interest 30 | } 31 | -------------------------------------------------------------------------------- /pcgrr/man/write_report_tsv.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/main.R 3 | \name{write_report_tsv} 4 | \alias{write_report_tsv} 5 | \title{Function that writes contents of PCGR object to various output formats 6 | (Rmarkdown/flexdashboard HTML reports, JSON, tab-separated etc)} 7 | \usage{ 8 | write_report_tsv(report = NULL, output_type = "snv_indel") 9 | } 10 | \arguments{ 11 | \item{report}{List object with all report data, settings etc.} 12 | 13 | \item{output_type}{character indicating output type for TSV, 14 | i.e. 'snv_indel', 'snv_indel_unfiltered', 'cna_gene', or 'msigs'} 15 | } 16 | \description{ 17 | param report List object with all report data (PCGR/CPSR), settings etc. 18 | param tier_model type of tier model 19 | param output_format contents/file format of output 20 | (html/json/tsv/cna_tsv etc) 21 | param flexdb logical indicating if HTML output should be dashboard 22 | } 23 | \details{ 24 | export 25 | Function that writes contents of PCGR object to flexdashboard 26 | HTML reports 27 | 28 | param report List object with all report data, settings etc. 29 | 30 | export 31 | Function that writes contents of PCGR object to a TSV file 32 | } 33 | -------------------------------------------------------------------------------- /pcgrr/man/get_prevalent_site_signatures.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mutational_signatures.R 3 | \name{get_prevalent_site_signatures} 4 | \alias{get_prevalent_site_signatures} 5 | \title{Function that retrieves prevalent signatures for a given tumor type/primary site 6 | Data is collected from COSMIC v3.4.} 7 | \usage{ 8 | get_prevalent_site_signatures( 9 | site = "Any", 10 | custom_collection = NULL, 11 | ref_data = NULL, 12 | min_prevalence_pct = 0.1, 13 | incl_poss_artifacts = T 14 | ) 15 | } 16 | \arguments{ 17 | \item{site}{Primary tumor site} 18 | 19 | \item{custom_collection}{Custom collection of signatures from COSMIC} 20 | 21 | \item{ref_data}{PCGR reference data object} 22 | 23 | \item{min_prevalence_pct}{Minimum prevalence (pct) of signature in 24 | cohorts associated with primary site - 25 | used to select reference signatures for inclusion in signature reconstruction} 26 | 27 | \item{incl_poss_artifacts}{logical indicating if artefact signatures 28 | are to be included} 29 | } 30 | \description{ 31 | Function that retrieves prevalent signatures for a given tumor type/primary site 32 | Data is collected from COSMIC v3.4. 33 | } 34 | -------------------------------------------------------------------------------- /pcgrr/man/generate_annotation_link.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/variant_annotation.R 3 | \name{generate_annotation_link} 4 | \alias{generate_annotation_link} 5 | \title{A function that generates a HTML link for selected 6 | identifiers (DBSNP, COSMIC, CLINVAR, ENTREZ)} 7 | \usage{ 8 | generate_annotation_link( 9 | var_df, 10 | vardb = "DBSNP", 11 | vartype = "snv_indel", 12 | group_by_var = c("VAR_ID", "ENTREZGENE"), 13 | url_prefix = "http://www.ncbi.nlm.nih.gov/projects/SNP/snp_ref.cgi?rs=", 14 | link_key_var = "DBSNP_RSID", 15 | link_display_var = "DBSNP_RSID" 16 | ) 17 | } 18 | \arguments{ 19 | \item{var_df}{data frame} 20 | 21 | \item{vardb}{type of database} 22 | 23 | \item{vartype}{'snv_indel' or 'cna'} 24 | 25 | \item{group_by_var}{variable used for grouping (VAR_ID)} 26 | 27 | \item{url_prefix}{url prefix for link generation} 28 | 29 | \item{link_key_var}{variable used in url for linking} 30 | 31 | \item{link_display_var}{variable used in url for display} 32 | } 33 | \value{ 34 | df_annotation_links 35 | } 36 | \description{ 37 | A function that generates a HTML link for selected 38 | identifiers (DBSNP, COSMIC, CLINVAR, ENTREZ) 39 | } 40 | -------------------------------------------------------------------------------- /pcgrr/man/load_eitems.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/biomarkers.R 3 | \name{load_eitems} 4 | \alias{load_eitems} 5 | \title{Function that loads specific set of clinical variant evidence items (CIViC + CGI) based 6 | on given parameters (mutation type, variant origin, tumor type etc)} 7 | \usage{ 8 | load_eitems( 9 | eitems_raw = NULL, 10 | ontology = NULL, 11 | alteration_types = c("MUT"), 12 | origin = "Somatic", 13 | tumor_type_specificity = NULL, 14 | tumor_type = NULL 15 | ) 16 | } 17 | \arguments{ 18 | \item{eitems_raw}{complete set of clinical variant evidence items} 19 | 20 | \item{ontology}{phenotype ontology data frame} 21 | 22 | \item{alteration_types}{types of alteration ('MUT', 'CNA', 'MUT_LOF')} 23 | 24 | \item{origin}{variant origin ('Somatic','Germline')} 25 | 26 | \item{tumor_type_specificity}{tumor type specificity ('any', 'specific')} 27 | 28 | \item{tumor_type}{primary tumor site} 29 | } 30 | \value{ 31 | eitems variant evidence items 32 | } 33 | \description{ 34 | Function that loads specific set of clinical variant evidence items (CIViC + CGI) based 35 | on given parameters (mutation type, variant origin, tumor type etc) 36 | } 37 | -------------------------------------------------------------------------------- /pcgrr/man/kataegis_detect.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/kataegis.R 3 | \name{kataegis_detect} 4 | \alias{kataegis_detect} 5 | \title{Function that detects kataegis events from a data frame 6 | with genomic cooordinates of mutations} 7 | \usage{ 8 | kataegis_detect( 9 | data, 10 | sample_id = "sample_id", 11 | build = "grch37", 12 | min.mut = 6, 13 | max.dis = 1000, 14 | chr = "chr", 15 | pos = "pos", 16 | txdb = NULL 17 | ) 18 | } 19 | \arguments{ 20 | \item{data}{data frame with somatic mutations, as produced by kataegis_input} 21 | 22 | \item{sample_id}{sample identifier} 23 | 24 | \item{build}{genomoe assembly build} 25 | 26 | \item{min.mut}{minimum number of mutations in localized hypermutated region} 27 | 28 | \item{max.dis}{maximum distance of kataegis event (basepairs)} 29 | 30 | \item{chr}{column name in data that denotes chromosome} 31 | 32 | \item{pos}{column name in data that denotes position} 33 | 34 | \item{txdb}{transcript database (txdb)} 35 | } 36 | \value{ 37 | kataegis_df data frame with potential kataegis events 38 | } 39 | \description{ 40 | Function that detects kataegis events from a data frame 41 | with genomic cooordinates of mutations 42 | } 43 | -------------------------------------------------------------------------------- /pcgrr/man/plotly_pie_chart.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{plotly_pie_chart} 4 | \alias{plotly_pie_chart} 5 | \title{Plotly Pie Chart - variant statistics} 6 | \usage{ 7 | plotly_pie_chart( 8 | df_variant_stats = NULL, 9 | category = "CODING_STATUS", 10 | plot_margin_top = 50, 11 | plot_margin_bottom = 20, 12 | plot_margin_left = 20, 13 | plot_margin_right = 20, 14 | font_family = "Helvetica", 15 | font_size = 15, 16 | pie_line_width = 3, 17 | opacity_filtered_categories = 0.4, 18 | hole_size_pie = 0.4 19 | ) 20 | } 21 | \arguments{ 22 | \item{df_variant_stats}{Data frame with variant statistics} 23 | 24 | \item{category}{Category for pie chart (e.g. CODING_STATUS)} 25 | 26 | \item{plot_margin_top}{Top margin} 27 | 28 | \item{plot_margin_bottom}{Bottom margin} 29 | 30 | \item{plot_margin_left}{Left margin} 31 | 32 | \item{plot_margin_right}{Right margin} 33 | 34 | \item{font_family}{Font family} 35 | 36 | \item{font_size}{Font size} 37 | 38 | \item{pie_line_width}{Line width for pie chart segments} 39 | 40 | \item{opacity_filtered_categories}{Opacity for filtered categories} 41 | 42 | \item{hole_size_pie}{Hole size for pie chart (0 to 1)} 43 | } 44 | \value{ 45 | Plotly pie chart object 46 | } 47 | \description{ 48 | Function that generates a pie chart using plotly 49 | for a given category in a data frame 50 | } 51 | -------------------------------------------------------------------------------- /pcgrr/vignettes/developers.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Developers" 3 | output: rmarkdown::html_document 4 | --- 5 | 6 | ## Development notes 7 | 8 | ### R package dev 9 | 10 | | Command | Comment | 11 | |---------|---------| 12 | | `devtools::check()` | build and check the pkg | 13 | | `devtools::load_all()` | load the pkg | 14 | | `R CMD INSTALL --no-multiarch --with-keep.source pcgr.git/pcgrr` | install the pkg into the first library of `.libPaths()` | 15 | 16 | ### Python package dev 17 | 18 | | Command | Comment | 19 | |---------|---------| 20 | | `pip install -e .` | install Python pkg in [editable mode](https://stackoverflow.com/a/35064498/2169986) (think of it like loading the dev version) | 21 | 22 | ### conda 23 | 24 | | Command | Comment | 25 | |---------|---------| 26 | | `mamba install foo -c bar` | install pkg `foo` from channel `bar` | 27 | | `mamba create --file env.yml --prefix ./pcgr` | install conda pkgs listed in `env.yml` into the `./pcgr` directory | 28 | | `conda info -e` | list conda environments installed on this machine | 29 | | `conda-lock --mamba -f env.yml -p osx-64 -p linux-64` | build conda lock files from given `env.yml` for both osx and linux | 30 | | `conda mambabuild recipe_folder/ -c conda-forge -c bioconda` | build conda pkg from given recipe (folder with `meta.yaml`, `build.sh`) | 31 | 32 | ### pkgdown 33 | 34 | | Command | Comment | 35 | |---------|---------| 36 | | `pkgdown::build_site()` | builds entire site | 37 | | `pkgdown::build_articles()` | builds vignettes only | 38 | -------------------------------------------------------------------------------- /pcgrr/inst/templates/pcgr_quarto_report/expression/immune_contexture.qmd: -------------------------------------------------------------------------------- 1 | ### Immune contexture 2 | 3 | The immune contexture of the sample is here assessed using the [quanTIseq](https://icbi.i-med.ac.at/software/quantiseq/doc/index.html) algorithm [@Finotello2019-ko], which estimates the relative proportions of various immune cell types in the RNA sample. 4 |
5 | 6 | ```{r immune_contexture_prep} 7 | #| eval: !expr as.logical(NROW(pcg_report$content$expression$immune_contexture) > 0) == TRUE 8 | #| echo: false 9 | 10 | cell_fracs <- 11 | plotly::plot_ly( 12 | pcg_report$content$expression$immune_contexture, 13 | marker = list( 14 | colors = pcgrr::color_palette$tier$values, 15 | line = list( 16 | color = '#FFFFFF', width = 2))) |> 17 | plotly::add_pie( 18 | pcg_report$content$expression$immune_contexture, 19 | labels =~ cell_type, 20 | values = ~fraction, 21 | textinfo = "Fraction", 22 | type = 'pie', 23 | hole = 0.4) |> 24 | plotly::layout(legend = list(orientation = "h", font = t)) 25 | 26 | 27 | ``` 28 | 29 | 30 | ```{r immune_contexture_pie} 31 | #| eval: !expr as.logical(NROW(pcg_report$content$expression$immune_contexture) > 0) == TRUE & as.logical(!is.null(cell_fracs)) == TRUE 32 | #| echo: false 33 | #| output: asis 34 | 35 | bslib::card( 36 | full_screen = TRUE, 37 | height = "450px", 38 | bslib::card_header( 39 | class = "bg-dark", 40 | paste0("Immune contexture - ", 41 | pcg_report$settings$sample_id)), 42 | cell_fracs 43 | ) 44 | 45 | ``` 46 | 47 | 48 | -------------------------------------------------------------------------------- /pcgrr/man/plot_filtering_stats_exonic.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/germline.R 3 | \name{plot_filtering_stats_exonic} 4 | \alias{plot_filtering_stats_exonic} 5 | \title{Function that generates a pie chart for exonic/non-exonic variant 6 | statistics (for callsets coming from tumor-only sequencing)} 7 | \usage{ 8 | plot_filtering_stats_exonic( 9 | report = NULL, 10 | plot_margin_top = 50, 11 | plot_margin_bottom = 20, 12 | plot_margin_left = 20, 13 | plot_margin_right = 20, 14 | font_family = "Helvetica", 15 | font_size = 15, 16 | pie_line_width = 3, 17 | opacity_filtered_categories = 0.4, 18 | hole_size_pie = 0.4 19 | ) 20 | } 21 | \arguments{ 22 | \item{report}{list object with PCGR report content} 23 | 24 | \item{plot_margin_top}{top margin of the plot} 25 | 26 | \item{plot_margin_bottom}{bottom margin of the plot} 27 | 28 | \item{plot_margin_left}{left margin of the plot} 29 | 30 | \item{plot_margin_right}{right margin of the plot} 31 | 32 | \item{font_family}{font family for plot text} 33 | 34 | \item{font_size}{font size for plot text} 35 | 36 | \item{pie_line_width}{line width for pie chart segments} 37 | 38 | \item{opacity_filtered_categories}{opacity for filtered categories} 39 | 40 | \item{hole_size_pie}{size of the hole in the pie chart} 41 | } 42 | \value{ 43 | filtering_stats list with data frame and plotly pie chart 44 | } 45 | \description{ 46 | Function that generates a pie chart for exonic/non-exonic variant 47 | statistics (for callsets coming from tumor-only sequencing) 48 | } 49 | -------------------------------------------------------------------------------- /pcgrr/vignettes/primary_tumor_sites.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Primary Tumor Sites" 3 | output: rmarkdown::html_document 4 | --- 5 | 6 | ```{r load_pkgs, echo=FALSE, message=FALSE, warning=FALSE} 7 | require(DT) 8 | require(readr) 9 | ``` 10 | 11 | PCGR integrates a variety of different datasets relating to precision cancer medicine, that often use different ontologies when it comes to diseases or phenotypes. We have cross-referenced a variety of ontologies (DiseaseOntology, EFO, OncoTree, UMLS, ICD-10) that are in use in the oncology domain, and organized all the various tumor subtypes into 30 different main tumor sites (see also https://github.com/sigven/phenOncoX). 12 | 13 | Below you can browse all the various phenotype terms (including specific tumor subtypes) that are associated with each of the primary sites. This as a guide to choose the primary tumor type when running PCGR for a given sample (option `--tumor_site`). 14 | 15 |

16 | 17 | ```{r read_table, echo=FALSE, message=FALSE, warning=FALSE} 18 | tab <- system.file("extdata/oncotree_phenotypes.tsv.gz", package = "pcgrr") 19 | readr::read_tsv(tab, col_types = readr::cols(.default = "character")) |> 20 | dplyr::arrange(primary_site) |> 21 | DT::datatable(filter = list(position = "top", clear = FALSE, plain = TRUE), 22 | class = "cell-border display compact", 23 | rownames = FALSE, extensions = c("Buttons", "KeyTable"), 24 | options = list( 25 | pageLength = 300, autoWidth = FALSE, keys = TRUE, 26 | buttons = c("csv", "excel"), dom = "Blfrtip")) 27 | ``` 28 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:20.04 2 | LABEL org.opencontainers.image.authors='sigven@ifi.uio.no, peterdiakumis@gmail.com' \ 3 | org.opencontainers.image.description='Personal Cancer Genome Reporter (PCGR)' \ 4 | org.opencontainers.image.source='https://github.com/sigven/pcgr' \ 5 | org.opencontainers.image.url='https://github.com/sigven/pcgr' \ 6 | org.opencontainers.image.documentation='https://sigven.github.io/pcgr' \ 7 | org.opencontainers.image.licenses='MIT' 8 | 9 | ARG MINI_VERSION=24.3.0-0 10 | ARG MINI_URL=https://github.com/conda-forge/miniforge/releases/download/${MINI_VERSION}/Mambaforge-${MINI_VERSION}-Linux-x86_64.sh 11 | 12 | # install core pkgs, mambaforge 13 | RUN apt-get update && \ 14 | apt-get install --yes --no-install-recommends \ 15 | bash bzip2 curl less wget zip ca-certificates && \ 16 | apt-get clean && \ 17 | curl --silent -L "${MINI_URL}" -o "mambaforge.sh" && \ 18 | /bin/bash mambaforge.sh -b -p /opt/mambaforge/ && \ 19 | rm mambaforge.sh 20 | 21 | # create conda envs 22 | ENV PATH="/opt/mambaforge/bin:$PATH" 23 | ARG PCGR_CONDA_ENV_DIR=/home/pcgr_conda_envs 24 | COPY ./conda/env/lock ${PCGR_CONDA_ENV_DIR} 25 | RUN mamba create -n pcgr --file ${PCGR_CONDA_ENV_DIR}/pcgr-linux-64.lock 26 | RUN mamba create -n pcgrr --file ${PCGR_CONDA_ENV_DIR}/pcgrr-linux-64.lock 27 | RUN mamba clean --all --force-pkgs-dirs --yes 28 | 29 | FROM quay.io/bioconda/base-glibc-debian-bash:3.1 30 | 31 | COPY --from=0 /opt/mambaforge/envs/ /opt/mambaforge/envs/ 32 | 33 | ARG PCGR_ENV_NAME="pcgr" 34 | # pcgr env is activated by default 35 | ENV PATH="/opt/mambaforge/envs/${PCGR_ENV_NAME}/bin:${PATH}" 36 | ENV CONDA_PREFIX="/opt/mambaforge/envs/${PCGR_ENV_NAME}" 37 | -------------------------------------------------------------------------------- /scripts/cpsr.R: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env Rscript 2 | 3 | options(warn=-1) 4 | .libPaths(R.home("library")) # use conda R pkgs, not e.g. user's local installation 5 | 6 | args <- commandArgs(trailingOnly=TRUE) 7 | 8 | suppressWarnings(suppressPackageStartupMessages(library(cpsr))) 9 | suppressWarnings(suppressPackageStartupMessages(library(log4r))) 10 | 11 | ## YAML file produced by CPSR Python workflow 12 | ## - settings and paths to reference data and annotated input sample files 13 | yaml_fname <- as.character(args[1]) 14 | quarto_evars_path <- as.character(args[2]) 15 | pcgrr::export_quarto_evars(quarto_evars_path) 16 | 17 | my_log4r_layout <- function(level, ...) { 18 | paste0(format(Sys.time()), " - cpsr-report-generation - ", 19 | level, " - ", ..., "\n", collapse = "") 20 | } 21 | 22 | log4r_logger <- 23 | log4r::logger( 24 | threshold = "INFO", appenders = log4r::console_appender(my_log4r_layout)) 25 | 26 | # this gets passed on to all the log4r_* functions inside the pkg 27 | options("PCGRR_LOG4R_LOGGER" = log4r_logger) 28 | 29 | ## Generate report content 30 | cps_report <- cpsr::generate_cpsr_report( 31 | yaml_fname = yaml_fname 32 | ) 33 | 34 | ## Write report contents to output files (HTML, XLSX, TSV) 35 | if(!is.null(cps_report)){ 36 | cpsr::write_cpsr_output( 37 | cps_report, 38 | output_format = 'tsv') 39 | cpsr::write_cpsr_output( 40 | cps_report, 41 | output_format = 'xlsx') 42 | 43 | if(cps_report$settings$conf$other$no_html == FALSE){ 44 | cpsr::write_cpsr_output( 45 | cps_report, 46 | output_format = 'html') 47 | } 48 | else{ 49 | pcgrr::log4r_info("Skipping HTML report generation (option '--no_html' set to TRUE)") 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /pcgrr/tests/test.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Gene list display" 3 | output: html_document 4 | css: test.css 5 | --- 6 | 7 | ```{r setup, include=FALSE} 8 | knitr::opts_chunk$set(echo = TRUE) 9 | 10 | ``` 11 | 12 |
13 |
14 |
TIER 1 - SNV/INDEL

POLE/MMR deficiency 15 |
16 |
17 |
TIER 2 - SNV/INDEL

POLD1/MMR deficiency 18 |
19 |
20 |
sCNA

MUTYH/BER deficiency 21 |
22 | 23 |
24 |
TUMOR PURITY

MUTYH/BER deficiency 25 |
26 |
27 |
TUMOR PLOIDY

Aristolochic acid exposure 28 |
29 |
30 |
MSI STATUS

POLD1/MMR deficiency 31 |
32 |
33 |
DOMINANT SIGNATURE ETIOLOGY

Sequencing artefact 34 |
35 |
36 |
MUTATIONAL BURDEN 37 |
38 |
39 |
KATAEGIS EVENTS 40 |
41 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools >= 61.0"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | 6 | [project] 7 | name = "pcgr" 8 | version = "2.2.5" # versioned by bump2version 9 | description = "Personal Cancer Genome Reporter (PCGR) - variant interpretation for precision cancer medicine" 10 | authors = [ 11 | {name = "Sigve Nakken", email = "sigven@gmail.com"}, 12 | ] 13 | maintainers = [ 14 | {name = "Sigve Nakken", email = "sigven@gmail.com"}, 15 | {name = "Peter Diakumis", email = "peterdiakumis@gmail.com"}, 16 | ] 17 | readme = "README.md" 18 | license = {file = "LICENSE"} 19 | keywords = ["cancer", "genomics", "pcgr"] 20 | classifiers = [ 21 | "License :: OSI Approved :: MIT License", 22 | "Development Status :: 5 - Production/Stable", 23 | "Intended Audience :: Science/Research", 24 | "Operating System :: MacOS :: MacOS X", 25 | "Operating System :: POSIX", 26 | "Operating System :: Unix", 27 | "Programming Language :: Python :: 3", 28 | "Programming Language :: R", 29 | "Topic :: Scientific/Engineering :: Bio-Informatics", 30 | ] 31 | 32 | 33 | [project.urls] 34 | Homepage = "https://sigven.github.io/pcgr/" 35 | Documentation = "https://sigven.github.io/pcgr/" 36 | Repository = "https://github.com/sigven/pcgr" 37 | Changelog = "https://sigven.github.io/pcgr/articles/CHANGELOG.html" 38 | 39 | 40 | [project.scripts] 41 | pcgr = "pcgr.main:cli" 42 | cpsr = "pcgr.cpsr:main" 43 | 44 | [tool.setuptools.packages] 45 | find = {} 46 | 47 | [tool.setuptools] 48 | script-files = [ 49 | "scripts/cpsr_validate_input.py", 50 | "scripts/pcgr_summarise.py", 51 | "scripts/pcgr_validate_input.py", 52 | "scripts/pcgr_vcfanno.py", 53 | "scripts/pcgrr.R", 54 | "scripts/cpsr.R", 55 | ] 56 | -------------------------------------------------------------------------------- /pcgrr/data-raw/oncogenicity.tsv: -------------------------------------------------------------------------------- 1 | code score category pole description resource 2 | ONCG_OVS1 8 funcvar P Null variant - predicted as LoF - in bona fide tumor suppressor gene VEP;CGC;CancerMine 3 | ONCG_OS1 4 funcvar P Same amino acid change as previously established oncogenic variant - regardless of nucleotide change ClinVar 4 | ONCG_OS3 4 funcvar P Located in a mutation hotspot with >= 50 samples with variant at AA position, >= 10 samples with same AA change cancerhotspots.org 5 | ONCG_OM1 2 funcvar P Presumably critical site of functional domain CIViC 6 | ONCG_OM2 2 funcvar P Protein length changes from in-frame dels/ins in known oncogene/tumor suppressor genes or stop-loss variants in a tumor suppressor gene VEP;CGC;CancerMine 7 | ONCG_OM3 2 funcvar P Missense variant at an amino acid residue where a different missense variant determined to be oncogenic (using this standard) has been documented ClinVar 8 | ONCG_OM4 2 funcvar P Located in a mutation hotspot with < 50 samples with variant at AA position, >= 10 samples with same AA change cancerhotspots.org 9 | ONCG_OP1 1 funccomp P Multiple lines of computational evidence support of a damaging variant effect on the gene or gene product dbNSFP 10 | ONCG_OP3 1 funcvar P Located in a mutation hotspot with < 10 samples with the same amino acid change cancerhotspots.org 11 | ONCG_OP4 1 clinpop P Absent from controls (gnomAD) / very low MAF (any five major gnomAD subpopulations) gnomAD 12 | ONCG_SBVS1 -8 clinpop B Very high MAF (any five major gnomAD subpopulations) gnomAD 13 | ONCG_SBS1 -4 clinpop B High MAF (any five major gnomAD subpopulations) gnomAD 14 | ONCG_SBP1 -1 funccomp B Multiple lines of computational evidence support a benign variant effect on the gene or gene product dbNSFP 15 | ONCG_SBP2 -1 funcvar B Silent and intronic changes outside of the consensus splice site VEP 16 | -------------------------------------------------------------------------------- /pcgrr/tests/test2.css: -------------------------------------------------------------------------------- 1 | #container { 2 | /*border: 2px dashed #444;*/ 3 | height: 30px; 4 | margin: 7px; 5 | 6 | /* just for demo */ 7 | min-width: 750px; 8 | } 9 | 10 | .red, .amber, .exploratory, .green, .nolist, .custom { 11 | width: 100px; 12 | height: 28px; 13 | /*font-family: Helvetica;*/ 14 | margin-right: 5px; 15 | margin-top: 8px; 16 | padding: 5px; 17 | color: white; 18 | display: inline-block; 19 | text-align: center; 20 | 21 | /*display: inline;*/ 22 | /*zoom: 1*/ 23 | } 24 | /*.stretch { 25 | width: 100%; 26 | display: inline-block; 27 | font-size: 0; 28 | line-height: 0 29 | } 30 | */ 31 | 32 | .exploratory { 33 | background: #000; 34 | border-radius: 5px; 35 | 36 | } 37 | 38 | .green { 39 | background: #3fad46; 40 | border-radius: 5px; 41 | 42 | } 43 | 44 | .red { 45 | background: #d9534f; 46 | border-radius: 5px; 47 | 48 | } 49 | 50 | .nolist { 51 | background: #b8b8ba; 52 | border-radius: 5px; 53 | 54 | 55 | } 56 | 57 | .amber { 58 | background: #f0ad4e; 59 | border-radius: 5px; 60 | 61 | } 62 | 63 | .custom { 64 | background: darkmagenta; 65 | border-radius: 5px; 66 | 67 | } 68 | 69 | .custom > a:hover, 70 | .green > a:hover, 71 | .red > a:hover, 72 | .amber > a:hover, 73 | .nolist > a:hover, 74 | .exploratory > a:hover { 75 | color: white; 76 | text-decoration: underline; 77 | } 78 | 79 | .custom > a:link, 80 | .green > a:link, 81 | .red > a:link, 82 | .amber > a:link, 83 | .nolist > a:link, 84 | .exploratory > a:link{ 85 | text-decoration: none; 86 | color: white; 87 | } 88 | 89 | .custom > a:visited, 90 | .green > a:visited, 91 | .red > a:visited, 92 | .amber > a:visited, 93 | .nolist > a:visited, 94 | .exploratory > a:visited{ 95 | text-decoration: none; 96 | color: white; 97 | } 98 | -------------------------------------------------------------------------------- /pcgrr/tests/cpsr.css: -------------------------------------------------------------------------------- 1 | #container { 2 | /*border: 2px dashed #444;*/ 3 | height: 30px; 4 | margin: 7px; 5 | 6 | /* just for demo */ 7 | min-width: 750px; 8 | } 9 | 10 | .red, .amber, .exploratory, .green, .nolist, .custom { 11 | width: 100px; 12 | height: 28px; 13 | /*font-family: Helvetica;*/ 14 | margin-right: 5px; 15 | margin-top: 8px; 16 | padding: 5px; 17 | color: white; 18 | display: inline-block; 19 | text-align: center; 20 | 21 | /*display: inline;*/ 22 | /*zoom: 1*/ 23 | } 24 | /*.stretch { 25 | width: 100%; 26 | display: inline-block; 27 | font-size: 0; 28 | line-height: 0 29 | } 30 | */ 31 | 32 | .exploratory { 33 | background: #000; 34 | border-radius: 5px; 35 | 36 | } 37 | 38 | .green { 39 | background: #3fad46; 40 | border-radius: 5px; 41 | 42 | } 43 | 44 | .red { 45 | background: #d9534f; 46 | border-radius: 5px; 47 | 48 | } 49 | 50 | .nolist { 51 | background: #b8b8ba; 52 | border-radius: 5px; 53 | 54 | 55 | } 56 | 57 | .amber { 58 | background: #f0ad4e; 59 | border-radius: 5px; 60 | 61 | } 62 | 63 | .custom { 64 | background: darkmagenta; 65 | border-radius: 5px; 66 | 67 | } 68 | 69 | .custom > a:hover, 70 | .green > a:hover, 71 | .red > a:hover, 72 | .amber > a:hover, 73 | .nolist > a:hover, 74 | .exploratory > a:hover { 75 | color: white; 76 | text-decoration: underline; 77 | } 78 | 79 | .custom > a:link, 80 | .green > a:link, 81 | .red > a:link, 82 | .amber > a:link, 83 | .nolist > a:link, 84 | .exploratory > a:link{ 85 | text-decoration: none; 86 | color: white; 87 | } 88 | 89 | .custom > a:visited, 90 | .green > a:visited, 91 | .red > a:visited, 92 | .amber > a:visited, 93 | .nolist > a:visited, 94 | .exploratory > a:visited{ 95 | text-decoration: none; 96 | color: white; 97 | } 98 | 99 | -------------------------------------------------------------------------------- /pcgrr/data-raw/effect_prediction_algorithms.tsv: -------------------------------------------------------------------------------- 1 | algorithm url display_name 2 | primateai https://github.com/Illumina/PrimateAI PrimateAI 3 | metalr https://www.ncbi.nlm.nih.gov/pubmed/25552646 Ensembl-LogisticRegression 4 | metasvm https://www.ncbi.nlm.nih.gov/pubmed/25552646 Ensembl-SVM 5 | deogen2 https://www.ncbi.nlm.nih.gov/pubmed/28498993 DEOGEN2 6 | mutationassessor http://mutationassessor.org MutationAssessor 7 | mutationtaster http://www.mutationtaster.org MutationTaster 8 | sift https://sift.bii.a-star.edu.sg/ SIFT 9 | lrt http://www.genetics.wustl.edu/jflab/lrt_query.html LRT 10 | provean http://provean.jcvi.org/index.php PROVEAN 11 | mutpred http://mutpred.mutdb.org MutPred 12 | m-cap http://bejerano.stanford.edu/MCAP/ M-CAP 13 | splice_site_rf http://nar.oxfordjournals.org/content/42/22/13534 Splice site effect (Random forest) 14 | splice_site_ada http://nar.oxfordjournals.org/content/42/22/13534 Splice site effect (Adaptive boosting) 15 | gerp_rs http://mendel.stanford.edu/SidowLab/downloads/gerp/ GERP++ RS score 16 | list_s2 https://doi.org/10.1093/nar/gkaa288 LIST-S2 17 | bayesdel_addaf https://doi.org/10.1002/humu.23158 BayesDel 18 | aloft http://aloft.gersteinlab.org/ ALoFT 19 | esm1b https://huggingface.co/spaces/ntranoslab/esm_variants/tree/main ESM1b 20 | alphamissense https://console.cloud.google.com/storage/browser/dm_alphamissense AlphaMissense 21 | mutformer https://github.com/WGLab/mutformer MutFormer 22 | phactboost https://github.com/CompGenomeLab/PHACTboost PHACTboost 23 | metarnn http://www.liulab.science/metarnn.html MetaRNN 24 | cadd https://cadd.gs.washington.edu/ CADD 25 | vest4 https://www.cravat.us/CRAVAT/help.jsp#vest-4 VEST-4 26 | fathmm_xf https://fathmm.biocompute.org.uk/fathmm-xf/ FATHMM-XF 27 | clinpred https://sites.google.com/site/clinpred/ ClinPred 28 | polyphen2_hvar http://genetics.bwh.harvard.edu/pph2/ PolyPhen2 29 | revel https://sites.google.com/site/revelgenomics/ REVEL 30 | -------------------------------------------------------------------------------- /scripts/pcgrr.R: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env Rscript 2 | 3 | options(warn=-1) 4 | .libPaths(R.home("library")) # use conda R pkgs, not e.g. user's local installation 5 | 6 | suppressWarnings(suppressPackageStartupMessages(library(pcgrr))) 7 | suppressWarnings(suppressPackageStartupMessages(library(log4r))) 8 | suppressWarnings(suppressPackageStartupMessages(library(argparse))) 9 | 10 | args <- commandArgs(trailingOnly=TRUE) 11 | 12 | ## YAML file produced by PCGR Python workflow 13 | ## - settings and paths to reference data and annotated input sample files 14 | yaml_fname <- as.character(args[1]) 15 | quarto_evars_path <- as.character(args[2]) 16 | pcgrr::export_quarto_evars(quarto_evars_path) 17 | 18 | my_log4r_layout <- function(level, ...) { 19 | paste0(format(Sys.time()), " - pcgr-report-generation - ", 20 | level, " - ", ..., "\n", collapse = "") 21 | } 22 | 23 | log4r_logger <- 24 | log4r::logger( 25 | threshold = "INFO", appenders = log4r::console_appender(my_log4r_layout)) 26 | 27 | ## this gets passed on to all the log4r_* functions inside the pkg 28 | options("PCGRR_LOG4R_LOGGER" = log4r_logger) 29 | 30 | ## Generate report content 31 | pcg_report <- pcgrr::generate_report( 32 | yaml_fname = yaml_fname 33 | ) 34 | 35 | ## Write report contents to output files (HTML, XLSX, TSV) 36 | if (!is.null(pcg_report)) { 37 | if(pcg_report$settings$conf$other$no_html == FALSE){ 38 | pcgrr::write_report_quarto_html(report = pcg_report) 39 | } 40 | else{ 41 | pcgrr::log4r_info("Skipping HTML report generation (option '--no_html' set to TRUE)") 42 | } 43 | 44 | pcgrr::write_report_excel(report = pcg_report) 45 | pcgrr::write_report_tsv(report = pcg_report, output_type = 'snv_indel') 46 | pcgrr::write_report_tsv(report = pcg_report, output_type = 'snv_indel_unfiltered') 47 | pcgrr::write_report_tsv(report = pcg_report, output_type = 'cna_gene') 48 | pcgrr::write_report_tsv(report = pcg_report, output_type = 'msigs') 49 | } 50 | -------------------------------------------------------------------------------- /pcgrr/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: pcgrr 2 | Type: Package 3 | Title: Personal Cancer Genome ReporteR 4 | Version: 2.2.5 5 | Authors@R: 6 | c(person(given = "Sigve", 7 | family = "Nakken", 8 | role = c("aut", "cre"), 9 | email = "sigven@ifi.uio.no", 10 | comment = c(ORCID = "0000-0001-8468-2050")), 11 | person(given = "Peter", 12 | family = "Diakumis", 13 | role = c("aut", "ctb"), 14 | email = "peterdiakumis@gmail.com", 15 | comment = c(ORCID = "0000-0002-7502-7545"))) 16 | Maintainer: Sigve Nakken , Peter Diakumis 17 | URL: https://github.com/sigven/pcgr, 18 | https://sigven.github.io/pcgr/ 19 | BugReports: https://github.com/sigven/pcgr/issues 20 | Description: Functions, tools and utilities for the generation of clinical 21 | cancer genome reports with PCGR. This R package is an integrated part of 22 | the PCGR workflow (https://github.com/sigven/pcgr), it should thus not be 23 | used as a stand-alone package. 24 | License: MIT + file LICENSE 25 | biocViews: 26 | Imports: 27 | assertable, 28 | assertthat, 29 | Biostrings, 30 | bslib, 31 | caret, 32 | crosstalk, 33 | dplyr, 34 | DT, 35 | formattable, 36 | GenomeInfoDb, 37 | ggplot2, 38 | glue, 39 | htmltools, 40 | log4r, 41 | MutationalPatterns, 42 | openxlsx2, 43 | plotly, 44 | quantiseqr, 45 | quarto, 46 | randomForest, 47 | readr, 48 | reshape2, 49 | rlang, 50 | rrapply, 51 | S4Vectors, 52 | scales, 53 | shiny, 54 | stringr, 55 | tibble, 56 | tidyr, 57 | yaml 58 | Depends: 59 | R (>= 4.0) 60 | Suggests: 61 | testthat, 62 | devtools, 63 | stringi, 64 | BSgenome.Hsapiens.UCSC.hg19, 65 | BSgenome.Hsapiens.UCSC.hg38 66 | Encoding: UTF-8 67 | LazyData: true 68 | RoxygenNote: 7.3.2 69 | Roxygen: list(markdown = TRUE) 70 | -------------------------------------------------------------------------------- /pcgrr/R/value_boxes.R: -------------------------------------------------------------------------------- 1 | 2 | #' Function that plots four value boxes with the most 3 | #' important findings in the cancer genome 4 | #' 5 | #' @param pcg_report pcg report with list elements 6 | #' @return p 7 | #' 8 | #' @export 9 | 10 | plot_value_boxes <- function(pcg_report) { 11 | df <- data.frame( 12 | x = rep(seq(0, 16, 8), 3), 13 | y = c(rep(1, 3), rep(4.5, 3), rep(8, 3)), 14 | h = rep(3, 9), 15 | w = rep(7, 9), 16 | info = c(pcg_report[["content"]][["value_box"]][["tmb"]], 17 | pcg_report[["content"]][["value_box"]][["signatures"]], 18 | pcg_report[["content"]][["value_box"]][["kataegis"]], 19 | pcg_report[["content"]][["value_box"]][["tier1"]], 20 | pcg_report[["content"]][["value_box"]][["tier2"]], 21 | pcg_report[["content"]][["value_box"]][["scna"]], 22 | pcg_report[["content"]][["value_box"]][["tumor_purity"]], 23 | pcg_report[["content"]][["value_box"]][["tumor_ploidy"]], 24 | pcg_report[["content"]][["value_box"]][["msi"]] 25 | 26 | ), 27 | color = factor(1:9) 28 | ) 29 | 30 | assay_props <- 31 | pcg_report[["metadata"]][["config"]][["assay_props"]] 32 | 33 | ## color - tumor-control 34 | color <- rep(pcgrr::color_palette[["tier"]][["values"]][1], 9) 35 | if (assay_props[["vcf_tumor_only"]] == T) { 36 | ## color - tumor-only 37 | color <- rep(pcgrr::color_palette[["report_color"]][["values"]][2], 9) 38 | } 39 | 40 | p <- ggplot2::ggplot(df, ggplot2::aes(.data$x, .data$y, height = .data$h, width = .data$w, 41 | label = .data$info, fill = color)) + 42 | ggplot2::geom_tile() + 43 | ggplot2::geom_text(color = "white", fontface = "bold", size = 7) + 44 | ggplot2::coord_fixed() + 45 | ggplot2::scale_fill_manual(values = rep(color, 9)) + 46 | ggplot2::theme_void() + 47 | ggplot2::guides(fill = F) 48 | 49 | return(p) 50 | } 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /pcgrr/inst/templates/pcgr_quarto_report/kataegis.qmd: -------------------------------------------------------------------------------- 1 | ## Kataegis events 2 | 3 | Kataegis describes a pattern of localized hypermutations identified in some cancer genomes, in which [a large number of highly-patterned basepair mutations occur in a small region of DNA](https://en.wikipedia.org/wiki/Kataegis). Kataegis is prevalently seen among breast cancer patients, and it is also exists in lung cancers, cervical, head and neck, and bladder cancers, as shown in the results from tracing APOBEC mutation signatures (ref Wikipedia). PCGR implements the kataegis detection algorithm outlined in the [KataegisPortal R package](https://github.com/MeichunCai/KataegisPortal). 4 | 5 | Explanation of key columns in the resulting table of potential kataegis events: 6 | 7 | * __weight.C>X__: proportion of C>X mutations 8 | * __confidence__: confidence degree of potential kataegis events (range: 0 to 3) 9 | - 0 - a hypermutation with weight.C>X < 0.8; 10 | - 1 - one hypermutation with weight.C>X >= 0.8 in a chromosome; 11 | - 2 - two hypermutations with weight.C>X >= 0.8 in a chromosome; 12 | - 3 - high confidence with three or more hypermutations with weight.C>X >= 0.8 in a chromosome) 13 | 14 | 15 | ```{r mutsigs_kataegis} 16 | #| echo: false 17 | #| eval: true 18 | 19 | df <- data.frame( 20 | 'sample_id' = character(), 21 | 'chrom' = character(), 22 | 'start' = integer(), 23 | 'end' = integer(), 24 | 'chrom.arm' = character(), 25 | 'length' = integer(), 26 | 'number.mut' = integer(), 27 | 'weight.C>X' = numeric(), 28 | 'confidence' = integer(), 29 | stringsAsFactors = F) 30 | 31 | if(is.data.frame(pcg_report$content$kataegis$events)){ 32 | df <- pcg_report$content$kataegis$events 33 | } 34 | ## data frame with potential kataegis events present in tumor sample 35 | myOptions <- list(paging = F,pageLength=5, searching=F,caching=F, 36 | buttons = c('csv','excel'),dom = 'Bfrtip') 37 | DT::datatable(df ,options = myOptions,extensions=c("Buttons","Responsive")) 38 | 39 | ``` 40 | 41 | -------------------------------------------------------------------------------- /.bumpversion.toml: -------------------------------------------------------------------------------- 1 | [tool.bumpversion] 2 | current_version = "2.2.5" 3 | search = "{current_version}" 4 | replace = "{new_version}" 5 | message = "Bump version: {current_version} → {new_version}" 6 | regex = false 7 | ignore_missing_version = false 8 | ignore_missing_files = false 9 | commit = true 10 | parse = """(?x) 11 | (?P0|[1-9]\\d*)\\. 12 | (?P0|[1-9]\\d*)\\. 13 | (?P0|[1-9]\\d*) 14 | (?:\\.(?P\\d+))? 15 | """ 16 | 17 | serialize = [ 18 | "{major}.{minor}.{patch}.{dev}", 19 | "{major}.{minor}.{patch}", 20 | ] 21 | 22 | [[tool.bumpversion.files]] 23 | filename = "pcgrr/DESCRIPTION" 24 | search = "Version: {current_version}" 25 | replace = "Version: {new_version}" 26 | 27 | [[tool.bumpversion.files]] 28 | filename = "pcgrr/vignettes/installation.Rmd" 29 | search = "{current_version}" 30 | replace = "{new_version}" 31 | 32 | [[tool.bumpversion.files]] 33 | filename = "pcgr/_version.py" 34 | search = "__version__ = '{current_version}'" 35 | replace = "__version__ = '{new_version}'" 36 | 37 | [[tool.bumpversion.files]] 38 | filename = "pyproject.toml" 39 | search = 'version = "{current_version}"' 40 | replace = 'version = "{new_version}"' 41 | 42 | [[tool.bumpversion.files]] 43 | filename = "conda/recipe/pcgr/meta.yaml" 44 | search = "version: {current_version}" 45 | replace = "version: {new_version}" 46 | 47 | [[tool.bumpversion.files]] 48 | filename = "conda/recipe/pcgrr/meta.yaml" 49 | search = "version: {current_version}" 50 | replace = "version: {new_version}" 51 | 52 | [[tool.bumpversion.files]] 53 | filename = "conda/env/yml/pcgr.yml" 54 | search = "pcgr =={current_version}" 55 | replace = "pcgr =={new_version}" 56 | 57 | [[tool.bumpversion.files]] 58 | filename = "conda/env/yml/pcgrr.yml" 59 | search = "pcgrr =={current_version}" 60 | replace = "pcgrr =={new_version}" 61 | 62 | [[tool.bumpversion.files]] 63 | filename = "conda/env/yml/pkgdown.yml" 64 | search = "pcgrr =={current_version}" 65 | replace = "pcgrr =={new_version}" 66 | 67 | [[tool.bumpversion.files]] 68 | filename = ".github/workflows/build_conda_recipes.yaml" 69 | search = "VERSION: '{current_version}'" 70 | replace = "VERSION: '{new_version}'" 71 | -------------------------------------------------------------------------------- /pcgrr/pkgdown/_pkgdown.yml: -------------------------------------------------------------------------------- 1 | url: https://sigven.github.io/pcgr/ 2 | title: PCGR 3 | toc: 4 | depth: 3 5 | template: 6 | bootstrap: 5 7 | bslib: 8 | info: "#9B3297" 9 | dropdown-link-hover-bg: "#9B3297" 10 | dropdown-link-hover-color: "white" 11 | dropdown-link-active-color: "white" 12 | navbar-light-color: "white" 13 | navbar-light-brand-color: "white" 14 | navbar-light-brand-hover-color: "white" 15 | navbar-link-color: "white" 16 | includes: 17 | in_header: | 18 | 19 | 26 | authors: 27 | Sigve Nakken: 28 | href: "https://github.com/sigven" 29 | Peter Diakumis: 30 | href: "https://github.com/pdiakumis" 31 | navbar: 32 | link-color: "white" 33 | light-color: "white" 34 | light-brand-color: "white" 35 | type: light 36 | bg: info 37 | structure: 38 | left: [installation, running, articles, faq, changelog] 39 | right: [search, github] 40 | components: 41 | installation: 42 | text: Installation 43 | href: articles/installation.html 44 | running: 45 | text: Running 46 | href: articles/running.html 47 | articles: 48 | text: Articles 49 | menu: 50 | - text: Input files 51 | href: articles/input.html 52 | - text: Output files 53 | href: articles/output.html 54 | - text: Variant classification 55 | href: articles/variant_classification.html 56 | - text: Annotation resources 57 | href: articles/annotation_resources.html 58 | - text: Developer notes 59 | href: articles/developers.html 60 | - text: Primary tumor sites 61 | href: articles/primary_tumor_sites.html 62 | faq: 63 | text: FAQ 64 | href: articles/faq.html 65 | changelog: 66 | text: CHANGELOG 67 | href: articles/CHANGELOG.html 68 | home: 69 | sidebar: 70 | structure: [links, license, community, citation, authors, dev] 71 | components: 72 | citation: 73 | title: Citation 74 | text: "[Citing PCGR](authors.html#citation)" 75 | news: 76 | one_page: true 77 | -------------------------------------------------------------------------------- /conda/recipe/pcgrr/meta.yaml: -------------------------------------------------------------------------------- 1 | package: 2 | name: r-pcgrr 3 | version: 2.2.5 # versioned by bump2version 4 | 5 | source: 6 | path: ../../../pcgrr 7 | 8 | build: 9 | number: 0 10 | noarch: generic 11 | rpaths: 12 | - lib/R/lib/ 13 | - lib/ 14 | 15 | requirements: 16 | build: 17 | - git 18 | host: 19 | - r-base ==4.3.3 20 | - r-assertable 21 | - r-assertthat 22 | - bioconductor-biostrings 23 | - r-bslib 24 | - r-caret 25 | - r-crosstalk 26 | - r-dplyr 27 | - r-dt 28 | - r-formattable 29 | - bioconductor-genomeinfodb 30 | - r-ggplot2 31 | - r-glue 32 | - r-htmltools 33 | - r-log4r 34 | - bioconductor-mutationalpatterns 35 | - r-openxlsx2 36 | - r-plotly 37 | - bioconductor-quantiseqr 38 | - r-quarto 39 | - quarto 40 | - r-randomforest 41 | - r-readr 42 | - r-reshape2 43 | - r-rlang 44 | - r-rrapply 45 | - bioconductor-s4vectors 46 | - r-scales 47 | - r-shiny 48 | - r-stringr 49 | - r-stringi 50 | - r-tidyr 51 | - r-yaml 52 | 53 | run: 54 | - r-base ==4.3.3 55 | - r-assertable 56 | - r-assertthat 57 | - bioconductor-biostrings 58 | - r-bslib 59 | - r-caret 60 | - r-crosstalk 61 | - r-dplyr 62 | - r-dt 63 | - r-formattable 64 | - bioconductor-genomeinfodb 65 | - r-ggplot2 66 | - r-glue 67 | - r-htmltools 68 | - r-log4r 69 | - bioconductor-mutationalpatterns 70 | - r-openxlsx2 71 | - r-plotly 72 | - bioconductor-quantiseqr 73 | - r-quarto 74 | - quarto 75 | - r-randomforest 76 | - r-readr 77 | - r-reshape2 78 | - r-rlang 79 | - r-rrapply 80 | - bioconductor-s4vectors 81 | - r-scales 82 | - r-shiny 83 | - r-stringr 84 | - r-stringi 85 | - r-tidyr 86 | - r-yaml 87 | 88 | test: 89 | commands: 90 | - $R -e "library('pcgrr')" 91 | 92 | about: 93 | home: https://github.com/sigven/pcgr/pcgrr 94 | license: MIT 95 | summary: Personal Cancer Genome ReporteR. 96 | Functions, tools and utilities for the generation of clinical 97 | cancer genome reports with PCGR. This R package is an integrated 98 | part of the Docker/Conda-based PCGR workflow (https://github.com/sigven/pcgr), 99 | it should thus not be used as a stand-alone package. 100 | -------------------------------------------------------------------------------- /pcgrr/inst/templates/pcgr_quarto_report/mutational_signatures/signature_similarity.qmd: -------------------------------------------------------------------------------- 1 | ### Signature similarity 2 | 3 | Here, we perform a comparison of the sample's raw mutational spectrum to each of the known signatures (SBS) in COSMIC. Input samples with less than 30 SNVs are omitted from this analysis. The cosine similarity is calculated between the mutational spectrum of the sample (i.e. frequency of DNA trinucleotide contexts) and each of the COSMIC signatures. The cosine similarity (*SIMILARITY* column below) ranges from 0 to 1, where 1 indicates a perfect match. 4 | 5 | ```{r highlight_signatures} 6 | #| echo: false 7 | #| eval: !expr as.logical(pcg_report$settings$conf$somatic_snv$mutational_signatures$all_reference_signatures) == FALSE & as.logical(pcg_report$settings$conf$somatic_snv$mutational_signatures$no_prevalence_data) == FALSE 8 | #| output: asis 9 | 10 | cat('\n::: {.callout-note}\n## Site-specific signatures\n\n', 11 | 'Signatures that are previously attributed to ', 12 | conf$sample_properties$site, 13 | ' cancers (if any available, with prevalence >= ', 14 | as.character(msig_conf$prevalence_reference_signatures), 15 | '%) are highlighted. If you see non site-attributed signatures ', 16 | 'with very high similarity to the mutational spectrum of the input sample, a re-run of the fitting procedure using all ', 17 | 'reference signatures is warranted. \n\n:::\n\n', sep='') 18 | ``` 19 | 20 |
21 | 22 | ```{r signature_similarity} 23 | #| eval: !expr is.null(msig_content$result$signature_similarity) == FALSE 24 | #| output: asis 25 | 26 | similarity_table <- 27 | DT::datatable( 28 | msig_content$result$signature_similarity, 29 | extensions = "Responsive", 30 | options = list( 31 | pageLength = 13, 32 | dom = 'tp'), 33 | escape = F) |> 34 | DT::formatStyle( 35 | 'SIMILARITY', 36 | fontWeight = 'bold') |> 37 | DT::formatStyle( 38 | c('SIGNATURE_ID', 39 | 'AETIOLOGY_KEYWORD'), 40 | 'SITE_SPECIFIC', 41 | fontWeight = 'bold', 42 | color = "white", 43 | backgroundColor = DT::styleEqual( 44 | c('YES','NO','NOT_DEFINED'), 45 | c(pcg_report$settings$conf$report_color, 46 | pcgrr::color_palette$none, 47 | pcgrr::color_palette$none) 48 | ) 49 | ) 50 | 51 | #similarity_table$x$data$SITE_SPECIFIC <- NULL 52 | 53 | bslib::card( 54 | height = "700px", 55 | bslib::card_header( 56 | class = "bg-dark", 57 | paste0( 58 | "Similarity of ", 59 | pcg_report$settings$sample_id, 60 | " to COSMIC signatures (SBS)") 61 | ), 62 | bslib::card_body( 63 | similarity_table 64 | ) 65 | ) 66 | 67 | 68 | 69 | ``` 70 | 71 |
72 | -------------------------------------------------------------------------------- /pcgrr/inst/templates/pcgr_quarto_report/snv_indel.qmd: -------------------------------------------------------------------------------- 1 | ## Somatic SNVs/InDels 2 | 3 |
4 | 5 | ```{r key_snv_indel_numbers} 6 | #| echo: false 7 | #| output: asis 8 | #| eval: true 9 | 10 | 11 | bslib::page_fillable( 12 | bslib::layout_columns( 13 | col_widths = c(3,3,3,3), 14 | height = "100px", 15 | bslib::value_box( 16 | title = "Total variants", 17 | value = paste0( 18 | pcg_report$content$snv_indel$vstats$n), 19 | showcase = NULL, 20 | theme = dplyr::if_else( 21 | pcg_report$content$snv_indel$vstats$n > 0, 22 | "dark", 23 | "dark" 24 | ) 25 | ), 26 | bslib::value_box( 27 | title = "Coding variants", 28 | value = paste0( 29 | pcg_report$content$snv_indel$vstats$n_coding), 30 | showcase = NULL, 31 | theme = dplyr::if_else( 32 | pcg_report$content$snv_indel$vstats$n_coding > 0, 33 | "dark", 34 | "dark" 35 | ) 36 | ), 37 | bslib::value_box( 38 | title = "SNVs", 39 | value = paste0( 40 | pcg_report$content$snv_indel$vstats$n_snv), 41 | showcase = NULL, 42 | theme = dplyr::if_else( 43 | pcg_report$content$snv_indel$vstats$n_snv > 0, 44 | "dark", 45 | "dark" 46 | ) 47 | ), 48 | bslib::value_box( 49 | title = "InDels", 50 | value = paste0( 51 | pcg_report$content$snv_indel$vstats$n_indel), 52 | showcase = NULL, 53 | theme = dplyr::if_else( 54 | pcg_report$content$snv_indel$vstats$n_indel > 0, 55 | "dark", 56 | "dark" 57 | ) 58 | ) 59 | ) 60 | ) 61 | 62 | ``` 63 | 64 | 65 | ```{r section_variant_filtering} 66 | #| eval: !expr as.logical(pcg_report$settings$conf$assay_properties$vcf_tumor_only) == TRUE 67 | #| output: asis 68 | #| child: pcgr_quarto_report/snv_indel/variant_filtering.qmd 69 | 70 | ``` 71 | 72 | 73 | ```{r section_variant_statistics} 74 | #| eval: !expr as.logical(pcg_report$content$snv_indel$vstats$n > 0) == TRUE 75 | #| output: asis 76 | #| child: pcgr_quarto_report/snv_indel/variant_statistics.qmd 77 | 78 | ``` 79 | 80 | 81 |
82 |
83 |
84 | 85 | ```{r section_oncogenicity} 86 | #| output: asis 87 | #| eval: !expr as.logical(pcg_report$content$snv_indel$vstats$n != 0) == TRUE 88 | #| child: pcgr_quarto_report/snv_indel/oncogenicity.qmd 89 | 90 | ``` 91 | 92 |
93 | 94 | ```{r section_actionability} 95 | #| output: asis 96 | #| eval: !expr as.logical(pcg_report$content$snv_indel$vstats$n != 0) == TRUE 97 | #| child: pcgr_quarto_report/snv_indel/actionability.qmd 98 | ``` 99 | 100 | -------------------------------------------------------------------------------- /pcgrr/inst/templates/pcgrr.scss: -------------------------------------------------------------------------------- 1 | /*-- scss:defaults --*/ 2 | 3 | $theme: "cosmo" !default; 4 | 5 | // 6 | // Color system 7 | // 8 | 9 | $white: #fff !default; 10 | $gray-100: #f8f9fa !default; 11 | $gray-200: #e9ecef !default; 12 | $gray-300: #dee2e6 !default; 13 | $gray-400: #ced4da !default; 14 | $gray-500: #adb5bd !default; 15 | $gray-600: #868e96 !default; 16 | $gray-700: #495057 !default; 17 | $gray-800: #373a3c !default; 18 | $gray-900: #212529 !default; 19 | $black: #000 !default; 20 | 21 | $blue: #2780e3 !default; 22 | $indigo: #6610f2 !default; 23 | $purple: #613d7c !default; 24 | $pink: #e83e8c !default; 25 | $red: #ff0039 !default; 26 | $orange: #f0ad4e !default; 27 | $yellow: #ff7518 !default; 28 | $green: #3fb618 !default; 29 | $teal: #20c997 !default; 30 | $cyan: #9954bb !default; 31 | 32 | $primary: $blue !default; 33 | $secondary: $gray-800 !default; 34 | $success: $green !default; 35 | $info: $cyan !default; 36 | $warning: $yellow !default; 37 | $danger: $red !default; 38 | $light: $gray-100 !default; 39 | $dark: $gray-800 !default; 40 | $navbar-bg: #9954bb; 41 | $min-contrast-ratio: 2.6 !default; 42 | 43 | // Options 44 | 45 | $enable-rounded: false !default; 46 | 47 | // Body 48 | 49 | $body-color: $gray-800 !default; 50 | 51 | // Fonts 52 | 53 | // stylelint-disable-next-line value-keyword-case 54 | $font-family-sans-serif: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !default; 55 | $headings-font-weight: 400 !default; 56 | 57 | // Navbar 58 | 59 | $navbar-dark-hover-color: rgba($white, 1) !default; 60 | $navbar-light-hover-color: rgba($black, .9) !default; 61 | 62 | // Alerts 63 | 64 | $alert-border-width: 0 !default; 65 | 66 | // Progress bars 67 | 68 | $progress-height: .5rem !default; 69 | 70 | 71 | 72 | /*-- scss:rules --*/ 73 | 74 | 75 | // Variables 76 | 77 | $web-font-path: "https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@300;400;700&display=swap" !default; 78 | @if $web-font-path { 79 | @import url($web-font-path); 80 | } 81 | 82 | // Typography 83 | 84 | body { 85 | -webkit-font-smoothing: antialiased; 86 | } 87 | 88 | // Indicators 89 | 90 | .badge { 91 | &.bg-light { 92 | color: $dark; 93 | } 94 | } 95 | 96 | // Progress bars 97 | 98 | .progress { 99 | @include box-shadow(none); 100 | 101 | .progress-bar { 102 | font-size: 8px; 103 | line-height: 8px; 104 | } 105 | } 106 | 107 | 108 | -------------------------------------------------------------------------------- /pcgrr/inst/templates/pcgr_quarto.css: -------------------------------------------------------------------------------- 1 | 2 | .value_box_container { 3 | /*border: 2px dashed #444;*/ 4 | height: 210px; 5 | /*margin: 7px;*/ 6 | 7 | /* just for demo */ 8 | width: 1200px; 9 | position: absolute; 10 | /*max-width: 600px;*/ 11 | /*height: 500px;*/ 12 | } 13 | 14 | .quarto-title-banner { 15 | /*height: 120px;*/ 16 | margin-left: -15px; 17 | margin-right: -15px; 18 | margin-top: -15px; 19 | } 20 | 21 | .value_box { 22 | width: 250px; 23 | height: 150px; 24 | /*position: fixed;*/ 25 | font-family: sans-serif; 26 | margin-right: 15px; 27 | margin-top: 15px; 28 | padding: 10px; 29 | color: white; 30 | position: relative; 31 | display: inline-block; 32 | text-align: center; 33 | background: #000; 34 | /*border-radius: 25px;*/ 35 | 36 | /*display: inline;*/ 37 | /*zoom: 1*/ 38 | } 39 | 40 | h2.title{ 41 | color: black; 42 | } 43 | 44 | h2 { 45 | color: black; 46 | } 47 | 48 | h2, #TOC>ul>li { 49 | color: black; 50 | } 51 | 52 | #container { 53 | /*border: 2px dashed #444;*/ 54 | height: 30px; 55 | margin: 7px; 56 | 57 | /* just for demo */ 58 | min-width: 750px; 59 | } 60 | 61 | .red, .amber, .exploratory, .green, .nolist, .custom, .app_combo { 62 | width: 100px; 63 | height: 28px; 64 | /*font-family: Helvetica;*/ 65 | margin-right: 5px; 66 | margin-top: 8px; 67 | padding: 5px; 68 | color: white; 69 | display: inline-block; 70 | text-align: center; 71 | 72 | /*display: inline;*/ 73 | /*zoom: 1*/ 74 | } 75 | /*.stretch { 76 | width: 100%; 77 | display: inline-block; 78 | font-size: 0; 79 | line-height: 0 80 | } 81 | */ 82 | 83 | .exploratory { 84 | background: #000; 85 | border-radius: 5px; 86 | 87 | } 88 | 89 | .app_combo { 90 | background: #084594; 91 | border-radius: 5px; 92 | color: white; 93 | 94 | } 95 | 96 | .green { 97 | background: #3fad46; 98 | border-radius: 5px; 99 | 100 | } 101 | 102 | .red { 103 | background: #d9534f; 104 | border-radius: 5px; 105 | 106 | } 107 | 108 | .nolist { 109 | background: #b8b8ba; 110 | border-radius: 5px; 111 | 112 | 113 | } 114 | 115 | .amber { 116 | background: #f0ad4e; 117 | border-radius: 5px; 118 | 119 | } 120 | 121 | .custom { 122 | background: darkmagenta; 123 | border-radius: 5px; 124 | 125 | } 126 | 127 | .custom > a:hover, 128 | .green > a:hover, 129 | .red > a:hover, 130 | .amber > a:hover, 131 | .app_combo > a:hover, 132 | .nolist > a:hover, 133 | .exploratory > a:hover { 134 | color: white; 135 | text-decoration: underline; 136 | } 137 | 138 | .custom > a:link, 139 | .green > a:link, 140 | .red > a:link, 141 | .amber > a:link, 142 | .nolist > a:link, 143 | .app_combo > a:link, 144 | .exploratory > a:link{ 145 | text-decoration: none; 146 | color: white; 147 | } 148 | 149 | .custom > a:visited, 150 | .green > a:visited, 151 | .red > a:visited, 152 | .amber > a:visited, 153 | .nolist > a:visited, 154 | .app_combo > a:visited, 155 | .exploratory > a:visited{ 156 | text-decoration: none; 157 | color: white; 158 | } 159 | 160 | .bslib-value-box .value-box-value { 161 | font-size: clamp(.1em, 8cqw, 4em) !important; 162 | } 163 | 164 | -------------------------------------------------------------------------------- /pcgrr/vignettes/annotation_resources.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Annotation resources" 3 | output: rmarkdown::html_document 4 | --- 5 | 6 | ### Basic variant consequence annotation 7 | * [VEP](http://www.ensembl.org/info/docs/tools/vep/index.html) - Variant Effect Predictor release 113 ([GENCODE v47](https://www.gencodegenes.org/human/) as gene reference database (v19 for grch37)) 8 | 9 | ### *Insilico* predictions of effect of coding variants 10 | * [dBNSFP](https://sites.google.com/site/jpopgen/dbNSFP) - database of non-synonymous functional predictions (v5.0, January 2025) 11 | 12 | ### Variant frequency databases 13 | * [gnomAD](http://exac.broadinstitute.org/) - germline variant frequencies exome-wide (r4.1, April 2024) 14 | * [dbSNP](http://www.ncbi.nlm.nih.gov/SNP/) - database of short genetic variants (build 156) 15 | * [Cancer Hotspots](http://cancerhotspots.org) - a resource for statistically significant mutations in cancer (v2, 2017) 16 | * [TCGA](https://portal.gdc.cancer.gov/) - somatic mutations discovered across 33 tumor type cohorts (release 41.0, August 2024) 17 | 18 | ### Variant databases of clinical utility 19 | * [ClinVar](http://www.ncbi.nlm.nih.gov/clinvar/) - database of clinically related variants (March 2025) 20 | * [CIViC](https://civicdb.org) - clinical interpretations of variants in cancer (March 13th 2025) 21 | * [CGI](http://www.cancergenomeinterpreter.org/biomarkers) - Cancer Genome Interpreter Cancer Biomarkers Database (CGI) (October 18th 2022) 22 | 23 | ### Protein domains/functional features 24 | * [UniProt/SwissProt KnowledgeBase](http://www.uniprot.org) - resource on protein sequence and functional information (2025_01) 25 | * [Pfam](https://www.ebi.ac.uk/interpro/entry/pfam/#table) - database of protein families and domains (v37.0) 26 | 27 | ### Knowledge resources on gene and protein targets 28 | * [CancerMine](https://zenodo.org/records/7689627) - Literature-mined database of tumor suppressor genes/proto-oncogenes (v50, March 2023) 29 | * [Open Targets Platform](https://www.targetvalidation.org/) - Database on disease-target associations, molecularly targeted drugs and tractability aggregated from multiple sources (literature, pathways, mutations) (2024.09) 30 | 31 | ### Notes on variant annotation datasets 32 | 33 | #### Data quality 34 | 35 | __Genomic biomarkers__ 36 | 37 | Genomic biomarkers utilized in PCGR are currently limited to the following: 38 | 39 | * Evidence items for specific markers in CIViC must be *accepted* (*submitted* evidence items are not considered or shown) 40 | * Markers reported at the exact variant level (e.g. __BRAF p.V600E__, __MET c.3028+1G>T__, __g.7:140753336A>T__) 41 | * Markers reported at the codon level (e.g. __KRAS p.G12__) 42 | * Markers reported at the exon level (e.g. __KIT exon 11 mutation__, __EGFR exon 19 deletion__) 43 | * Markers reported at the gene level (e.g. __BRAF mutation__, __TP53 loss-of-function mutation__, __BRCA1 oncogenic mutation__) 44 | * Within the [Cancer bioMarkers database (CGI)](https://www.cancergenomeinterpreter.org/biomarkers), only biomarkers curated from FDA/NCCN guidelines, scientific literature, and clinical trials are included (biomarkers collected from conference abstracts etc. are not included) 45 | * Copy number gains/losses 46 | * RNA fusion and gene expression biomarkers are included in the PCGR reference databundle, but are not currently utilized in the PCGR biomarker matching procedure 47 | -------------------------------------------------------------------------------- /pcgrr/tests/testthat/test_biomarker.R: -------------------------------------------------------------------------------- 1 | #context("Biomarker check") 2 | #pcgr_data <- readRDS(file='/Users/sigven/research/docker/pcgr/data/grch37/rds/pcgr_data.rds') 3 | # 4 | #eitems_raw <- pcgr_data[["biomarkers"]] 5 | # 6 | #test_that("Biomarker load returns correct origin/type", { 7 | # expect_error(pcgrr::load_all_eitems(eitems_raw = eitems_raw, 8 | # alteration_type = "", 9 | # origin = "Somatic")) 10 | # expect_error(pcgrr::load_all_eitems(eitems_raw = eitems_raw, 11 | # alteration_type = "MUT", 12 | # origin = "")) 13 | # expect_error(pcgrr::load_all_eitems(eitems_raw = NULL, 14 | # alteration_type = "MUT", 15 | # origin = "Somatic")) 16 | # expect_equal(unique(pcgrr::load_all_eitems(eitems_raw = eitems_raw, 17 | # alteration_type = "MUT", 18 | # origin = "Somatic")$VARIANT_ORIGIN), 19 | # c('Somatic','Somatic Mutation')) 20 | # expect_equal(unique(pcgrr::load_all_eitems(eitems_raw = eitems_raw, 21 | # alteration_type = "MUT", 22 | # origin = "Germline")$VARIANT_ORIGIN), 23 | # "Germline") 24 | # expect_equal(unique(pcgrr::load_all_eitems(eitems_raw = eitems_raw, 25 | # alteration_type = "CNA", 26 | # origin = "Somatic")$VARIANT_ORIGIN), 27 | # c("Somatic", "Somatic Mutation")) 28 | # expect_equal(unique(pcgrr::load_all_eitems(eitems_raw = eitems_raw, 29 | # alteration_type = "MUT", 30 | # origin = "Somatic")$ALTERATION_TYPE), 31 | # "MUT") 32 | # expect_equal(unique(pcgrr::load_all_eitems(eitems_raw = eitems_raw, 33 | # alteration_type = "CNA", 34 | # origin = "Somatic")$ALTERATION_TYPE), 35 | # "CNA") 36 | # expect_equal(unique(pcgrr::load_all_eitems(eitems_raw = eitems_raw, 37 | # alteration_type = "CNA", 38 | # origin = "Germline")$ALTERATION_TYPE), 39 | # "CNA") 40 | # expect_gte(ncol(pcgrr::load_all_eitems(eitems_raw = eitems_raw, 41 | # alteration_type = "MUT", 42 | # origin = "Somatic")), 19) 43 | # expect_gte(nrow(pcgrr::load_all_eitems(eitems_raw = eitems_raw, 44 | # alteration_type = "MUT_LOF", 45 | # origin = "Germline")), 1) 46 | # expect_gte(ncol(pcgrr::load_all_eitems(eitems_raw = eitems_raw, 47 | # alteration_type = "CNA", 48 | # origin = "Somatic")), 17) 49 | # expect_equal(unique(pcgrr::load_all_eitems(eitems_raw = eitems_raw, 50 | # alteration_type = "MUT", 51 | # origin = "Somatic")$BIOMARKER_MAPPING), 52 | # c("exact", "gene", "codon", "exon")) 53 | #}) 54 | -------------------------------------------------------------------------------- /pcgrr/inst/templates/pcgr_quarto_report/mutational_signatures/mutational_spectra.qmd: -------------------------------------------------------------------------------- 1 | ### Raw mutational spectrum 2 | 3 | As a background perspective, we here provide various views of the raw mutational spectrum for the sample, i.e. not considering a signature re-fitting analysis. 4 | 5 | ::: {.panel-tabset .nav-pills} 6 | 7 | #### SBS - mutational contexts 8 | 9 |
10 | 11 | ```{r setup_spectra_data} 12 | #| echo: false 13 | #| eval: true 14 | 15 | msig_content <- 16 | pcg_report$content$mutational_signatures 17 | ``` 18 | 19 | ```{r raw_context_plot} 20 | #| output: asis 21 | #| eval: !expr is.null(msig_content$result$mut_mat) == FALSE 22 | 23 | catalogue_mat <- 24 | msig_content$result$mut_mat 25 | 26 | y_max <- 27 | plyr::round_any( 28 | max(catalogue_mat[,1] / sum(catalogue_mat[,1])), 29 | 0.05, f = ceiling) 30 | 31 | plotly::ggplotly( 32 | height = 400, 33 | MutationalPatterns::plot_96_profile( 34 | catalogue_mat, 35 | colors = head(pcgrr::color_palette$tier$values, 6), 36 | ymax = y_max) 37 | ) 38 | 39 | ``` 40 | 41 | 42 | ```{r missing_context_plot} 43 | #| output: asis 44 | #| eval: !expr is.null(msig_content$result$mut_mat) == TRUE 45 | 46 | cat("\n::: {.callout-warning}\n## No SNVs\n\nNo SNVs/single base substitutions", 47 | "were found in this sample\n\n:::\n\n") 48 | 49 | ``` 50 | 51 | 52 | #### SBS - type occurrences 53 | 54 |
55 | 56 | ```{r sbs_type_occurrences} 57 | #| eval: !expr is.null(msig_content$result$type_occurrences) == FALSE 58 | #| output: asis 59 | 60 | 61 | if(rowSums(msig_content$result$type_occurrences[1:6]) > 0){ 62 | plotly::ggplotly( 63 | height = 400, 64 | MutationalPatterns::plot_spectrum( 65 | msig_content$result$type_occurrences, 66 | CT = TRUE, 67 | error_bars = 'none', 68 | colors = head( 69 | pcgrr::color_palette$tier$values, 7))) |> 70 | plotly::layout( 71 | legend = list( 72 | orientation = "h", # horizontal legend 73 | x = 0.5, # center it 74 | xanchor = "center", # anchor it at the center 75 | y = -0.2 # place it below the plot 76 | ) 77 | ) 78 | } 79 | 80 | ``` 81 | 82 | ```{r sbs_types_missing} 83 | #| eval: !expr (is.null(msig_content$result$type_occurrences) == TRUE) & pcg_report$content$snv_indel$vstats$n_snv == 0 84 | #| output: asis 85 | 86 | cat("\n::: {.callout-warning}\n## No SNVs\n\nNo SNVs/single base substitutions", 87 | "were found in this sample\n\n:::\n\n") 88 | 89 | ``` 90 | 91 | 92 | #### ID - mutational contexts 93 | 94 |
95 | 96 | ```{r indel_contexts} 97 | #| eval: !expr is.null(msig_content$result$indel_counts) == FALSE 98 | #| fig-width: 14 99 | #| fig-height: 7 100 | 101 | MutationalPatterns::plot_indel_contexts( 102 | counts = msig_content$result$indel_counts, 103 | condensed = T) + 104 | ggplot2::theme(legend.position = "bottom") + 105 | ggplot2::theme(text = ggplot2::element_text(size = 14)) 106 | 107 | 108 | ``` 109 | 110 | ```{r indel_contexts_missing} 111 | #| eval: !expr is.null(msig_content$result$indel_counts) == TRUE 112 | #| output: asis 113 | 114 | cat( 115 | "\n::: {.callout-warning}\n## No/very few InDels\n\nNo/very few insertion/deletions", 116 | "were analyzed in this sample\n\n:::\n") 117 | 118 | ``` 119 | 120 | ::: 121 | -------------------------------------------------------------------------------- /pcgrr/inst/templates/pcgr_quarto_report/germline.qmd: -------------------------------------------------------------------------------- 1 | ## Germline findings 2 | 3 | ```{r prepare_panel_url} 4 | #| echo: false 5 | #| results: asis 6 | 7 | panel_link <- pcg_report[['content']][['germline_classified']][['panel_info']][['description']] 8 | if(pcg_report[['content']][['germline_classified']][['panel_info']][['panel_id']] != "-1" & 9 | !stringr::str_detect(pcg_report[['content']][['germline_classified']][['panel_info']][['url']], ",")){ 10 | description <- pcg_report[['content']][['germline_classified']][['panel_info']][['description']] 11 | description_trait <- 12 | pcg_report[['content']][['germline_classified']][['panel_info']][['description_trait']] 13 | url_raw <- pcg_report[['content']][['germline_classified']][['panel_info']][['url']] 14 | description_full <- paste0(description,': ', description_trait) 15 | if(pcg_report[['content']][['germline_classified']][['panel_info']][['panel_id']] == "0"){ 16 | description_full <- description 17 | } 18 | panel_link <- paste0("", 19 | description_full, 20 | "") 21 | } 22 | 23 | ``` 24 | 25 | 26 | * Based on a germline variant analysis of the query case using the [Cancer Predisposition Sequencing Reporter (CPSR)](https://github.com/sigven/cpsr), we here list the variants of clinical significance in cancer predisposition genes, both novel (not recorded in ClinVar), and those with existing classifications in ClinVar. 27 | * Virtual panel of cancer predisposition genes screened: `r panel_link` 28 | * Protein-coding variants of uncertain significance shown: __`r !pcg_report$settings$conf$germline$ignore_vus`__ 29 | 30 | 31 | ```{r cpsr_clinvar_findings} 32 | #| echo: false 33 | #| eval: true 34 | #| output: asis 35 | 36 | cat('\n') 37 | htmltools::br() 38 | 39 | germline_calls <- pcg_report[['content']][['germline_classified']][['callset']] 40 | 41 | if(NROW(germline_calls$variant_display) > 100){ 42 | cat('NOTE - only considering top 100 variants (due to limitations with client-side tables)
',sep="\n") 43 | cat('
') 44 | germline_calls$variant_display <- 45 | head(germline_calls$variant_display, 100) 46 | } 47 | 48 | germline_dt <- DT::datatable( 49 | germline_calls$variant_display, 50 | escape = F, 51 | extensions = c("Buttons","Responsive"), 52 | options = list( 53 | pageLength = 10, 54 | scrollCollapse = T, 55 | buttons = c('csv','excel'), 56 | dom = 'Bfrtip' 57 | )) |> 58 | DT::formatStyle( 59 | columns = c("SYMBOL","ALTERATION"), 60 | valueColumns = c("CLINICAL_SIGNIFICANCE"), 61 | color = "white", 62 | backgroundColor = 63 | DT::styleEqual( 64 | c("Pathogenic", "Likely_Pathogenic","VUS"), 65 | c("#9E0142","#D53E4F","#000000") 66 | ) 67 | ) 68 | 69 | bslib::page_fillable( 70 | bslib::card( 71 | bslib::card_header( 72 | class = "bg-dark", 73 | paste0("Germline variants - ", 74 | pcg_report[['content']][['germline_classified']]$sample_id) 75 | ), 76 | bslib::card_body( 77 | height = min(500, 150 + NROW(germline_calls$variant_display) * 80), 78 | if(NROW(germline_calls$variant_display) > 0){ 79 | germline_dt 80 | }else{ 81 | "NO cancer-predisposing variants of clinical significance were found in the query case (CPSR report)." 82 | } 83 | ) 84 | ) 85 | ) 86 | 87 | 88 | ``` 89 | 90 |
91 | 92 | -------------------------------------------------------------------------------- /pcgrr/R/clinicaltrials.R: -------------------------------------------------------------------------------- 1 | #' Function that retrieves relevant (interventional based on molecular target) 2 | #' clinical trials for a given tumor type 3 | #' @param pcgr_data PCGR data bundle object 4 | #' @param config PCGR run configurations 5 | #' @param sample_name sample name 6 | #' 7 | #' @return pcg_report_trials data frame with all report elements 8 | #' @export 9 | 10 | generate_report_data_trials <- function(pcgr_data, config, sample_name) { 11 | 12 | 13 | invisible(assertthat::assert_that(!is.null(pcgr_data))) 14 | invisible(assertthat::assert_that(!is.null(pcgr_data$clinicaltrials$trials))) 15 | invisible(assertthat::assert_that(is.data.frame( 16 | pcgr_data$clinicaltrials$trials))) 17 | invisible(assertthat::assert_that( 18 | NROW(pcgr_data$clinicaltrials$trials) > 0)) 19 | 20 | 21 | pcg_report_trials <- pcgrr::init_report(config = config, 22 | class = "clinicaltrials") 23 | pcg_report_trials[["eval"]] <- T 24 | 25 | pcg_report_trials[["trials"]] <- 26 | pcgr_data[["clinicaltrials"]][["trials"]] |> 27 | dplyr::filter(.data$primary_site == 28 | config[["t_props"]][["tumor_type"]]) 29 | 30 | if (nrow(pcg_report_trials[["trials"]]) > 0) { 31 | 32 | pcg_report_trials[["trials"]] <- pcg_report_trials[["trials"]] |> 33 | dplyr::select(.data$nct_id, .data$title, .data$overall_status, 34 | .data$cui_link, .data$intervention_link, 35 | .data$phase, .data$start_date, 36 | .data$primary_completion_date, .data$cui_name, 37 | .data$intervention, 38 | .data$intervention_target, 39 | .data$biomarker_context, 40 | .data$chromosome_abnormality, 41 | .data$clinical_context, 42 | .data$world_region, 43 | .data$metastases, .data$gender, 44 | .data$minimum_age, .data$maximum_age, .data$phase, 45 | .data$n_primary_cancer_sites, 46 | .data$study_design_primary_purpose) |> 47 | dplyr::rename(condition_raw = .data$cui_name, 48 | condition = .data$cui_link, 49 | intervention2 = .data$intervention_link, 50 | intervention_raw = .data$intervention, 51 | biomarker_index = .data$biomarker_context, 52 | keyword = .data$clinical_context, 53 | chrom_abnormalities = .data$chromosome_abnormality, 54 | metastases_index = .data$metastases) |> 55 | dplyr::rename(intervention = .data$intervention2) 56 | 57 | colnames(pcg_report_trials[["trials"]]) <- 58 | toupper(colnames(pcg_report_trials[["trials"]])) 59 | pcg_report_trials[["trials"]] <- pcg_report_trials[["trials"]] 60 | #magrittr::set_colnames(toupper(names(.))) |> 61 | dplyr::arrange(.data$N_PRIMARY_CANCER_SITES, 62 | .data$OVERALL_STATUS, 63 | dplyr::desc(.data$START_DATE), 64 | dplyr::desc(nchar(.data$BIOMARKER_INDEX)), 65 | dplyr::desc(.data$STUDY_DESIGN_PRIMARY_PURPOSE)) |> 66 | dplyr::select(-c(.data$N_PRIMARY_CANCER_SITES, .data$STUDY_DESIGN_PRIMARY_PURPOSE)) 67 | 68 | if (nrow(pcg_report_trials[["trials"]]) > 2000) { 69 | pcg_report_trials[["trials"]] <- 70 | utils::head(pcg_report_trials[["trials"]], 2000) 71 | } 72 | 73 | }else{ 74 | pcg_report_trials[["missing_data"]] <- T 75 | } 76 | return(pcg_report_trials) 77 | } 78 | -------------------------------------------------------------------------------- /pcgrr/NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(af_distribution) 4 | export(append_annotation_links) 5 | export(append_cancer_association_ranks) 6 | export(append_cancer_gene_evidence) 7 | export(append_dbmts_var_link) 8 | export(append_dbnsfp_var_link) 9 | export(append_drug_var_link) 10 | export(append_gwas_citation_phenotype) 11 | export(append_oncogenicity_docs) 12 | export(append_targeted_drug_annotations) 13 | export(append_tcga_var_link) 14 | export(append_tfbs_annotation) 15 | export(assign_amp_asco_tiers) 16 | export(assign_germline_popfreq_status) 17 | export(assign_mutation_type) 18 | export(assign_somatic_classification) 19 | export(assign_somatic_germline_evidence) 20 | export(check_common_colnames) 21 | export(check_file_exists) 22 | export(clinvar_germline_status) 23 | export(cosmic_somatic_status) 24 | export(dbsnp_germline_status) 25 | export(deduplicate_eitems) 26 | export(detect_vcf_sample_name) 27 | export(df_string_replace) 28 | export(exclude_non_chrom_variants) 29 | export(expand_biomarker_items) 30 | export(export_quarto_evars) 31 | export(filter_eitems_by_site) 32 | export(filter_maf_file) 33 | export(filter_read_support) 34 | export(generate_annotation_link) 35 | export(generate_report) 36 | export(generate_report_data_expression) 37 | export(generate_report_data_kataegis) 38 | export(generate_report_data_msi) 39 | export(generate_report_data_rainfall) 40 | export(generate_report_data_signatures) 41 | export(generate_report_data_tmb) 42 | export(generate_report_data_trials) 43 | export(generate_tier_tsv) 44 | export(get_clin_assocs_cna) 45 | export(get_dt_tables) 46 | export(get_excel_sheets) 47 | export(get_genome_obj) 48 | export(get_oncogenic_cna_events) 49 | export(get_prevalent_site_signatures) 50 | export(get_tumor_only_filtering_criteria) 51 | export(get_valid_chromosomes) 52 | export(get_variant_statistics) 53 | export(het_af_germline_status) 54 | export(hex_to_rgba) 55 | export(hom_af_status) 56 | export(init_cna_vstats) 57 | export(init_expression_content) 58 | export(init_germline_content) 59 | export(init_kataegis_content) 60 | export(init_m_signature_content) 61 | export(init_msi_content) 62 | export(init_rainfall_content) 63 | export(init_report) 64 | export(init_snv_indel_vstats) 65 | export(init_tmb_content) 66 | export(init_tumor_only_content) 67 | export(init_var_content) 68 | export(kataegis_detect) 69 | export(kataegis_input) 70 | export(load_all_eitems) 71 | export(load_cpsr_classified_variants) 72 | export(load_dna_variants) 73 | export(load_eitems) 74 | export(load_expression_csq) 75 | export(load_expression_outliers) 76 | export(load_expression_similarity) 77 | export(load_reference_data) 78 | export(load_somatic_cna) 79 | export(load_somatic_snv_indel) 80 | export(load_yaml) 81 | export(log4r_debug) 82 | export(log4r_fatal) 83 | export(log4r_info) 84 | export(log4r_warn) 85 | export(log_var_eitem_stats) 86 | export(max_af_gnomad) 87 | export(mkdir) 88 | export(msi_indel_fraction_plot) 89 | export(msi_indel_load_plot) 90 | export(order_variants) 91 | export(plot_cna_segments) 92 | export(plot_filtering_stats_exonic) 93 | export(plot_filtering_stats_germline) 94 | export(plot_signature_contributions) 95 | export(plot_tmb_primary_site_tcga) 96 | export(plot_value_boxes) 97 | export(plotly_pie_chart) 98 | export(pon_status) 99 | export(predict_msi_status) 100 | export(qc_var_eitems) 101 | export(remove_cols_from_df) 102 | export(sort_chromosomal_segments) 103 | export(strip_html) 104 | export(structure_var_eitems) 105 | export(tcga_somatic_status) 106 | export(tier_af_distribution) 107 | export(update_report) 108 | export(vaf_plot) 109 | export(variant_stats_report) 110 | export(write_processed_vcf) 111 | export(write_report_excel) 112 | export(write_report_quarto_html) 113 | export(write_report_tsv) 114 | importFrom(rlang,":=") 115 | importFrom(rlang,.data) 116 | -------------------------------------------------------------------------------- /pcgrr/R/variant_stats.R: -------------------------------------------------------------------------------- 1 | #' Function that computes various variant statistics from a data frame 2 | #' with variant records 3 | #' 4 | #' @param var_df data frame with variants 5 | #' @param pct_other_limit numeric value specifying the percentage limit 6 | #' for the 'Other' category 7 | #' 8 | #' @export 9 | #' 10 | get_variant_statistics <- function(var_df = NULL, pct_other_limit = 4){ 11 | 12 | assertthat::assert_that( 13 | !is.null(var_df), 14 | is.data.frame(var_df), 15 | msg = "Argument 'var_df' must be a valid data.frame" 16 | ) 17 | 18 | assertable::assert_colnames( 19 | var_df, c("VARIANT_CLASS", "CONSEQUENCE","CODING_STATUS"), 20 | only_colnames = F, quiet = T 21 | ) 22 | 23 | consequence_stats <- 24 | var_df |> 25 | dplyr::mutate(CONSEQUENCE = stringr::str_replace_all( 26 | .data$CONSEQUENCE, "(, [0-9A-Za-z_]{1,}){1,}$","" 27 | )) |> 28 | dplyr::group_by(.data$CONSEQUENCE) |> 29 | dplyr::summarise( 30 | N = dplyr::n(), 31 | .groups = "drop" 32 | ) |> 33 | dplyr::arrange(dplyr::desc(.data$N)) 34 | 35 | if(NROW(consequence_stats) > 5) { 36 | consequence_stats_top <- utils::head(consequence_stats, 4) 37 | consequence_stats_other <- consequence_stats |> 38 | dplyr::slice_tail(n = -4) |> 39 | dplyr::summarise( 40 | N = sum(.data$N), 41 | CONSEQUENCE = "other_consequences" 42 | ) 43 | consequence_stats <- dplyr::bind_rows( 44 | consequence_stats_top, consequence_stats_other) |> 45 | dplyr::arrange(dplyr::desc(.data$N)) 46 | } 47 | 48 | consequence_stats <- consequence_stats |> 49 | dplyr::mutate(Pct = .data$N / sum(.data$N) * 100) 50 | 51 | consequence_stats_coding <- 52 | var_df |> 53 | dplyr::filter(.data$CODING_STATUS == "coding") 54 | 55 | if(NROW(consequence_stats_coding) > 0) { 56 | consequence_stats_coding <- 57 | consequence_stats_coding |> 58 | dplyr::mutate(CONSEQUENCE = stringr::str_replace_all( 59 | .data$CONSEQUENCE, "(, [0-9A-Za-z_]{1,}){1,}$","" 60 | )) |> 61 | dplyr::group_by(.data$CONSEQUENCE) |> 62 | dplyr::summarise( 63 | N = dplyr::n(), 64 | .groups = "drop" 65 | ) |> 66 | dplyr::arrange(dplyr::desc(.data$N)) 67 | 68 | if(NROW(consequence_stats_coding) > 5) { 69 | consequence_stats_coding_top <- utils::head(consequence_stats_coding, 4) 70 | consequence_stats_coding_other <- consequence_stats_coding |> 71 | dplyr::slice_tail(n = -4) |> 72 | dplyr::summarise( 73 | N = sum(.data$N), 74 | CONSEQUENCE = "other_consequences" 75 | ) 76 | consequence_stats_coding <- dplyr::bind_rows( 77 | consequence_stats_coding_top, 78 | consequence_stats_coding_other) |> 79 | dplyr::arrange(dplyr::desc(.data$N)) 80 | } 81 | 82 | consequence_stats_coding <- 83 | consequence_stats_coding |> 84 | dplyr::mutate(Pct = .data$N / sum(.data$N) * 100) 85 | } 86 | 87 | 88 | variant_class_stats <- 89 | var_df |> 90 | dplyr::group_by(.data$VARIANT_CLASS) |> 91 | dplyr::summarise( 92 | N = dplyr::n(), 93 | .groups = "drop" 94 | ) |> 95 | dplyr::mutate(Pct = .data$N / sum(.data$N) * 100) |> 96 | dplyr::arrange(dplyr::desc(.data$Pct)) 97 | 98 | coding_stats <- 99 | var_df |> 100 | dplyr::group_by(.data$CODING_STATUS) |> 101 | dplyr::summarise( 102 | N = dplyr::n(), 103 | .groups = "drop" 104 | ) |> 105 | dplyr::mutate(Pct = .data$N / sum(.data$N) * 100) |> 106 | dplyr::arrange(dplyr::desc(.data$Pct)) 107 | 108 | result <- list() 109 | result[['consequence']] <- consequence_stats 110 | result[['consequence_coding']] <- consequence_stats_coding 111 | result[['variant_class']] <- variant_class_stats 112 | result[['coding']] <- coding_stats 113 | 114 | return(result) 115 | } 116 | -------------------------------------------------------------------------------- /pcgrr/R/data.R: -------------------------------------------------------------------------------- 1 | #' List of URLS and variant identifiers for variant/gene/protein domain databases 2 | #' 3 | #' 4 | #' @format A data.frame with 6 rows and 5 columns that indicates URL's for various variant/gene databases 5 | #' and how to use PCGR annotation columns to generate variant links 6 | #' \itemize{ 7 | #' \item \emph{name} - Name encoding for variant/gene database 8 | #' \item \emph{group_by_var} - Which column should be used for grouping 9 | #' \item \emph{url_prefix} - URL prefix 10 | #' \item \emph{link_key_var} - Which column to be used as the key value in link 11 | #' \item \emph{link_display_var} - Which column to be used as the display variable in link 12 | #' } 13 | #' 14 | "variant_db_url" 15 | 16 | 17 | #' Oncogenicity criteria (ClinGen/CGC/VICC) 18 | #' 19 | "oncogenicity_criteria" 20 | 21 | #' Fixed data types/categories used for biomarker evidence, e.g. 'types','levels' etc. 22 | #' 23 | "biomarker_evidence" 24 | 25 | #' List of coltype definitions for input files to pcgrr (e.g. VCF-converted TSV, CNA TVS etc.) 26 | #' 27 | "data_coltype_defs" 28 | 29 | #' List of COSMIC reference mutational signatures (SBS, v3.4) 30 | #' 31 | #' @format A list with two matrix objects ('all' and 'no_artefacts'). 32 | #' One matrix contains the COSMIC reference mutational signatures without signature 33 | #' artefacts ('no_artefacts', number of columns = 68), while the other contains 34 | #' all signatures, including artefacts ('all', number of columns = 86). Each 35 | #' matrix has 96 rows, one for each of the 96 possible trinucleotide contexts. 36 | #' 37 | "cosmic_sbs_signatures" 38 | 39 | #' Data frame with all TCGA cohorts 40 | #' 41 | #' @format A data.frame with 33 rows and 2 columns that indicates TCGA cohorts 42 | "tcga_cohorts" 43 | 44 | 45 | #' Data frame with immune cell types 46 | #' 47 | #' @format A data.frame with 11 rows and 2 columns that indicates immune 48 | #' cell types used in immune contexture analysis by quanTIseq 49 | #' 50 | #' 51 | "immune_celltypes" 52 | 53 | #' Data frame with germline filtering criteria 54 | #' 55 | #' @format A character vector listing all germline filtering criteria 56 | #' applied on input callsets (SNVs/InDels) in tumor-only mode 57 | #' 58 | "germline_filter_levels" 59 | 60 | #' List of URLs for a range of variant effect prediction algorithms 61 | #' 62 | #' 63 | #' @format A data.frame with 21 rows and 3 columns that indicates URL's for 64 | #' variant effect prediction algorithms 65 | #' \itemize{ 66 | #' \item \emph{algorithm} - Name encoding for effect prediction algorithm 67 | #' \item \emph{url} - URL 68 | #' \item \emph{display_name} - Display name for use in reporting 69 | #' } 70 | #' 71 | "effect_prediction_algos" 72 | 73 | #' Regular expression of terms indicative of cancer-related phenotypes and syndromes 74 | #' 75 | #' @format A long regular expression of cancer-related phenotype terms 76 | #' 77 | "cancer_phenotypes_regex" 78 | 79 | #' Color encodings for report elements of PCGR/CPSR 80 | #' 81 | #' @format A list object with different report elements that are color-coded in 82 | #' PCGR/CPSR reports. Each list element have two vectors: 'levels' and 'values'. 83 | #' Currently, the following list elements are included: 84 | #' \itemize{ 85 | #' \item \emph{pathogenicity} - Colors for five-level pathogenicity levels (CPSR) 86 | #' \item \emph{clinical_evidence} - Colors for strength of evidence of cancer-variant associations (A-E) 87 | #' \item \emph{tier} - Colors for tier levels for variant prioritization (PCGR) 88 | #' \item \emph{report_color} - Colors for PCGR assay mode (tumor-control vs. tumor-only) 89 | #' \item \emph{warning} - Color for warning (low confidence in PCGR analysis output) 90 | #' \item \emph{success} - Color for success (no evident uncertainty in PCGR analysis output) 91 | #' } 92 | #' 93 | "color_palette" 94 | 95 | #' TSV columns 96 | "tsv_cols" 97 | 98 | #' DT Display 99 | "dt_display" 100 | -------------------------------------------------------------------------------- /pcgrr/R/expression.R: -------------------------------------------------------------------------------- 1 | #' Function that generates expression data for PCGR report 2 | #' 3 | #' @param ref_data PCGR reference data object 4 | #' @param settings PCGR run/configuration settings 5 | #' 6 | #' @export 7 | generate_report_data_expression <- 8 | function(ref_data = NULL, 9 | settings = NULL) { 10 | 11 | pcg_report_expression <- 12 | pcgrr::init_expression_content() 13 | 14 | pcg_report_expression[["eval"]] <- TRUE 15 | 16 | if(as.logical(settings$conf$expression$similarity_analysis) == TRUE){ 17 | pcg_report_expression[["similarity_analysis"]] <- 18 | load_expression_similarity(settings = settings) 19 | } 20 | 21 | if(settings$molecular_data$fname_expression_outliers_tsv != "None" & 22 | file.exists(settings$molecular_data$fname_expression_outliers_tsv)){ 23 | 24 | pcg_report_expression[["outliers"]] <- 25 | pcgrr::load_expression_outliers(settings = settings, 26 | ref_data = ref_data) 27 | } 28 | 29 | if(settings$molecular_data$fname_expression_tsv != "None" & 30 | file.exists(settings$molecular_data$fname_expression_tsv)){ 31 | 32 | exp_data <- 33 | readr::read_tsv( 34 | settings$molecular_data$fname_expression_tsv, 35 | show_col_types = F, na = "." 36 | ) 37 | 38 | pcg_report_expression[["expression"]] <- exp_data 39 | 40 | if("SYMBOL" %in% colnames(exp_data) == FALSE | 41 | ("TPM" %in% colnames(exp_data) == FALSE & 42 | "TPM_GENE" %in% colnames(exp_data) == FALSE) | 43 | "BIOTYPE" %in% colnames(exp_data) == FALSE){ 44 | pcgrr::log4r_warn( 45 | "Missing a required column in expression file: SYMBOL, TPM/TPM_GENE, BIOTYPE") 46 | }else{ 47 | 48 | n_pc <- sum(exp_data$BIOTYPE == "protein_coding") 49 | 50 | if("TPM_GENE" %in% colnames(exp_data)){ 51 | exp_data$TPM <- as.numeric(exp_data$TPM_GENE) 52 | } 53 | 54 | if(n_pc > 0){ 55 | pcgrr::log4r_info( 56 | "Estimating immune contexture of tumor sample from RNA-seq data") 57 | exp_protein_coding <- exp_data |> 58 | dplyr::filter(.data$BIOTYPE == "protein_coding") |> 59 | dplyr::group_by(.data$SYMBOL) |> 60 | dplyr::summarise(TPM = sum(.data$TPM, na.rm = TRUE)) |> 61 | dplyr::select(c("SYMBOL", "TPM")) |> 62 | dplyr::distinct() 63 | 64 | if(NROW(exp_protein_coding) > 0){ 65 | rown <- exp_protein_coding$SYMBOL 66 | mat <- as.matrix(exp_protein_coding$TPM) 67 | rownames(mat) <- rown 68 | colnames(mat) <- "TPM" 69 | 70 | pcg_report_expression[["immune_contexture"]] <- 71 | suppressMessages(quantiseqr::run_quantiseq( 72 | expression_data = mat, 73 | is_tumordata = TRUE, 74 | )) 75 | 76 | if(is.data.frame(pcg_report_expression[["immune_contexture"]]) & 77 | "Sample" %in% colnames(pcg_report_expression[["immune_contexture"]])){ 78 | pcg_report_expression[["immune_contexture"]] <- 79 | pcg_report_expression[["immune_contexture"]] |> 80 | dplyr::rename(sample_id = "Sample") |> 81 | dplyr::mutate(sample_id = settings$sample_id) 82 | rownames(pcg_report_expression[["immune_contexture"]]) <- NULL 83 | 84 | pcg_report_expression[["immune_contexture"]] <- 85 | pcg_report_expression[["immune_contexture"]] |> 86 | tidyr::pivot_longer( 87 | !.data$sample_id, names_to = "method_cell_type", 88 | values_to = "fraction") |> 89 | dplyr::mutate(fraction = round( 90 | .data$fraction, digits = 3)) |> 91 | dplyr::left_join( 92 | pcgrr::immune_celltypes, by = "method_cell_type") |> 93 | dplyr::distinct() 94 | 95 | } 96 | } 97 | } 98 | } 99 | 100 | } 101 | 102 | 103 | return(pcg_report_expression) 104 | } 105 | 106 | 107 | -------------------------------------------------------------------------------- /pcgrr/inst/templates/pcgr_quarto_report/snv_indel/variant_filtering.qmd: -------------------------------------------------------------------------------- 1 | ```{r variant_filtering_prep} 2 | #| eval: true 3 | #| output: asis 4 | #| echo: false 5 | 6 | #pcg_report <- readRDS( 7 | # file = "/Users/sigven/project_data/packages/package__pcgr/pcgr/pcgrr/pcg_report.rds") 8 | 9 | to_settings <- pcg_report$settings$conf$somatic_snv$tumor_only 10 | 11 | filtering_stats <- list() 12 | 13 | filtering_stats[['germline']] <- pcgrr::plot_filtering_stats_germline( 14 | report = pcg_report) 15 | 16 | 17 | if(pcg_report$settings$conf$somatic_snv$tumor_only$exclude_nonexonic == TRUE){ 18 | 19 | filtering_stats[['exonic']] <- pcgrr::plot_filtering_stats_exonic( 20 | report = pcg_report, 21 | plot_margin_bottom = 100) 22 | } 23 | 24 | 25 | 26 | ``` 27 | 28 | ### Variant filtering 29 | 30 | In an effort to minimize the presence/impact of germline events from input variants (SNVs/InDels) called through a **tumor-only assay**, we here show the results of germline variant filters applied on the raw input set. The filters provide a classification of variants as somatic or likely germline (i.e. catched by various filters), where the latter set are removed/excluded, and not used for any analysis shown in this report. 31 | 32 | ::: {.panel-tabset} 33 | 34 | #### Filtering results 35 | 36 | ```{r variant_filtering_pie} 37 | #| eval: true 38 | #| output: asis 39 | #| echo: false 40 | 41 | 42 | if(pcg_report$settings$conf$somatic_snv$tumor_only$exclude_nonexonic == TRUE){ 43 | 44 | bslib::card( 45 | full_screen = TRUE, 46 | height = "365px", 47 | bslib::card_header( 48 | class = "bg-dark", 49 | paste0("Variant filtering statistics - ", 50 | pcg_report$settings$sample_id)), 51 | bslib::card_body( 52 | bslib::layout_columns( 53 | widths = c(6,6), 54 | filtering_stats[['germline']]$plot, 55 | filtering_stats[['exonic']]$plot 56 | ) 57 | ) 58 | ) 59 | 60 | }else{ 61 | bslib::card( 62 | full_screen = TRUE, 63 | height = "365px", 64 | bslib::card_header( 65 | class = "bg-dark", 66 | paste0("Variant filtering statistics - ", 67 | pcg_report$settings$sample_id)), 68 | bslib::card_body( 69 | filtering_stats[['germline']]$plot) 70 | ) 71 | } 72 | 73 | 74 | ``` 75 | 76 | #### Settings 77 | 78 | The variant filtering has been performed based on the following criteria: 79 | 80 | :::: {.columns} 81 | 82 | ::: {.column width="47.5%"} 83 | 84 | * Variant filtering aginst gnomAD (filter *GERMLINE_GNOMAD*): __TRUE__ (not configurable) 85 | * maximum allowed population-specific gnomAD MAF's for somatic events (configurable): 86 | * AFR: __`r to_settings$maf_gnomad_afr`__ 87 | * AMR: __`r to_settings$maf_gnomad_amr`__ 88 | * ASJ: __`r to_settings$maf_gnomad_asj`__ 89 | * EAS: __`r to_settings$maf_gnomad_eas`__ 90 | * FIN: __`r to_settings$maf_gnomad_fin`__ 91 | * NFE: __`r to_settings$maf_gnomad_nfe`__ 92 | * OTH: __`r to_settings$maf_gnomad_oth`__ 93 | * SAS: __`r to_settings$maf_gnomad_sas`__ 94 | * maximum allowed global gnomAD MAF for somatic events: __`r to_settings$maf_gnomad_global`__ 95 | 96 | ::: 97 | 98 | ::: {.column width="5%"} 99 | 100 | ::: 101 | 102 | ::: {.column width="47.5%"} 103 | * Variant filtering against ClinVar (filter *GERMLINE_CLINVAR*): __`r as.logical(to_settings$exclude_clinvar_germline)`__ 104 | * Variant filtering against dbSNP (filter *GERMLINE_DBSNP*): __`r as.logical(to_settings$exclude_dbsnp_nonsomatic)`__ 105 | * Variant filtering based on tumor VAF value (likely heterozygous germline event, VAF in 0.4 - 0.6, filter *GERMLINE_HET*): __`r as.logical(to_settings$exclude_likely_het_germline)`__ 106 | * Variant filtering based on tumor VAF value (likely homozygous germline event, VAF = 1, filter *GERMLINE_HOM*): __`r as.logical(to_settings$exclude_likely_hom_germline)`__ 107 | * Variant filtering against panel-of-normals (filter *GERMLINE_PON*: __`r as.logical(to_settings$exclude_pon)`__ 108 | * Variant filtering based on exonic regions: __`r as.logical(to_settings$exclude_nonexonic)`__ 109 | 110 | ::: 111 | 112 | :::: 113 | 114 | ::: 115 | 116 |
117 | -------------------------------------------------------------------------------- /pcgrr/inst/templates/pcgr_quarto_report/clinicaltrials.qmd: -------------------------------------------------------------------------------- 1 | 2 | ## Clinical trials 3 | 4 | * Ongoing or planned clinical trials in the relevant tumor type have been retrieved from [clinicaltrials.gov](https://clinicaltrials.gov), focusing on the subset with molecularly targeted therapies 5 | * Key information entities (interventions/drugs, conditions) in trial records have been mapped to established thesauri ([ChEMBL](https://www.ebi.ac.uk/chembl/), [NCI Thesaurus](https://ncithesaurus.nci.nih.gov/ncitbrowser/), [UMLS/MedGen](https://www.ncbi.nlm.nih.gov/medgen/)) 6 | * Results from a text-mining procedure on unstructured trial text (e.g. inclusion/exclusion criteria) attempts to highlight the presence of established molecular biomarkers in cancer and relevant therapeutic contexts. 7 | 8 |
9 | 10 | ```{r table_browse_trials, echo=F, results = "asis", eval = !pcg_report[['content']][['clinicaltrials']][['missing_data']]} 11 | 12 | trials_ttype <- crosstalk::SharedData$new(pcg_report[['content']][['clinicaltrials']][['trials']]) 13 | crosstalk::bscols( 14 | list( 15 | crosstalk::filter_select("CONDITION_RAW", "Condition (cancer subtype)", trials_ttype, ~CONDITION_RAW), 16 | crosstalk::filter_select("OVERALL_STATUS", "Status", trials_ttype, ~OVERALL_STATUS), 17 | crosstalk::filter_select("WORLD_REGION", "Location", trials_ttype, ~WORLD_REGION), 18 | crosstalk::filter_select("INTERVENTION_RAW", "Drug(s)", trials_ttype, ~INTERVENTION_RAW), 19 | crosstalk::filter_select("INTERVENTION_TARGET", "Drug target(s)", trials_ttype, ~INTERVENTION_TARGET), 20 | crosstalk::filter_select("KEYWORD", "Therapeutic context mentions (text-mined)", trials_ttype, ~KEYWORD), 21 | crosstalk::filter_select("BIOMARKER_INDEX", "Biomarker mentions (text-mined)", trials_ttype, ~BIOMARKER_INDEX) 22 | 23 | ), 24 | list( 25 | crosstalk::filter_select("PHASE","Phase",trials_ttype,~PHASE), 26 | crosstalk::filter_checkbox("GENDER", "Gender", trials_ttype, ~GENDER), 27 | crosstalk::filter_slider("MINIMUM_AGE", "Minimum age", trials_ttype, ~MINIMUM_AGE), 28 | crosstalk::filter_slider("MAXIMUM_AGE", "Maximum age", trials_ttype, ~MAXIMUM_AGE), 29 | crosstalk::filter_select("METASTASES_INDEX", "Metastases mentions (text-mined)", trials_ttype, ~METASTASES_INDEX) 30 | ) 31 | ) 32 | 33 | 34 | ``` 35 | 36 | 37 | ```{r trials_missing_filters, echo=F, results = 'asis', eval = pcg_report[['content']][['clinicaltrials']][['missing_data']]} 38 | cat('\n* No molecularly targeted trials retrieved for the tumor type in question.', sep='\n') 39 | cat('\n') 40 | ``` 41 | 42 | 43 |
44 | 45 | ```{r trials_table_all, eval = !pcg_report[['content']][['clinicaltrials']][['missing_data']]} 46 | 47 | trials_ttype |> 48 | DT::datatable(escape = F, 49 | extensions = c("Buttons","Responsive"), 50 | options = list(pageLength = 10, 51 | buttons = c('csv','excel'), 52 | dom = 'Bfrtip')) |> 53 | DT::formatStyle("OVERALL_STATUS",color="white", 54 | backgroundColor = DT::styleEqual(c('Recruiting', 55 | 'Not yet recruiting', 56 | 'Active, not recruiting', 57 | 'Enrolling by invitation', 58 | 'Completed', 59 | 'Suspended', 60 | 'Withdrawn', 61 | 'Unknown status'), c("#00a65a","#00a65a","#CD534C","#CD534C","#CD534C","#CD534C","#CD534C", "#8F7700"))) 62 | 63 | # DT::formatStyle(color="white", "SYMBOL", "BM_RESOLUTION", fontWeight = 'bold', `text-align` = 'center', 64 | # backgroundColor = DT::styleEqual(c('exact','codon','exon','gene'), 65 | # c('#000','#000',pcgrr::color_palette[['warning']][['values']][1], pcgrr::color_palette[['warning']][['values']][1]))) 66 | 67 | ``` 68 | 69 | 70 | ```{r trials_missing_data, echo=F, results = 'asis', eval = pcg_report[['content']][['clinicaltrials']][['missing_data']]} 71 | cat('\n* No molecularly targeted trials retrieved for the tumor type in question .',sep='\n') 72 | cat('\n') 73 | ``` 74 | -------------------------------------------------------------------------------- /pcgrr/vignettes/faq.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "FAQ" 3 | output: rmarkdown::html_document 4 | --- 5 | 6 | Frequently asked questions regarding PCGR usage and functionality: 7 | 8 | __1. I do not see any data related to allelic depth/support in my report. I thought that PCGR can grab this information automatically from my VCF?__ 9 | 10 | _Answer: VCF variant genotype data (i.e. AD/DP) is something that you as a user need to specify explicitly when running PCGR. In our experience, there is currently no uniform way that variant callers format these types of data (allelic fraction/depth, tumor/normal) in the VCF, and this makes it very challenging for PCGR to automatically grab this information from any VCF. Please take a careful look at the example VCF files (`examples` folder) that comes with PCGR for how PCGR expects this information to be formatted, and make sure your VCF is formatted accordingly. There is also an in-depth explanation on the matter [described here](input.html#formatting-of-allelic-depthsupport-dpad)_ 11 | 12 | __2. Is it possible to utilize PCGR for analysis of multiple samples?__ 13 | 14 | _Answer: As the name of the tool implies, PCGR was developed for the detailed analysis of individual tumor samples. However, if you take advantage of the different outputs from PCGR, it can also be utilized for analysis of multiple samples. First, make sure your input files are organized per sample (i.e. one VCF file per sample, one CNA file per sample), so that they can be fed directly to PCGR. Now, once all samples have been processed with PCGR, note that all the tab-separated output files (i.e. annotated SNVs, gene copy numbers) contain the sample identifier, which enable them to be aggregated and suitable for a downstream multi-sample analysis. Also note the multi-sheet Excel workbook, which contains numerous outputs from PCGR, and can be processed to aggregate findings across samples._ 15 | 16 | __3. I do not see the expected transcript-specific consequence for a particular variant. In what way is the primary variant consequence established?__ 17 | 18 | _Answer: PCGR relies upon_ [VEP](https://www.ensembl.org/info/docs/tools/vep/index.html) _for consequence prioritization, in which a specific transcript-specific consequence is chosen as the primary variant consequence. In the PCGR configuration file, you may customise how this is chosen by changing the order of criteria applied when choosing a primary consequence block - parameter_ [vep_pick_order](https://www.ensembl.org/info/docs/tools/vep/script/vep_other.html#pick_options) 19 | 20 | __4. Is it possible to use RefSeq as the underlying gene transcript model in PCGR?__ 21 | 22 | _Answer: PCGR uses GENCODE as the primary gene transcript model, but we provide cross-references to corresponding RefSeq transcripts when this is available._ 23 | 24 | __5. I have a VCF with structural variants detected in my tumor sample, can PCGR process those as well?__ 25 | 26 | _Answer: This is currently not supported as input for PCGR, but is something we want to incorporate in the future._ 27 | 28 | __6. Is it possible to see all the invididual cancer subtypes that belong to each of the 30 different tumor sites?__ 29 | 30 | _Answer: Yes, see_ [an overview of phenotypes associated with primary tumor sites](primary_tumor_sites.html). See also the related GitHub repository [phenOncoX](https://github.com/sigven/phenOncoX) 31 | 32 | __7. Are there any plans to incorporate genomic biomarker evidence from__ [OncoKB](https://www.oncokb.org) __in PCGR?__ 33 | 34 | _Answer: No. PCGR relies upon publicly available, open-source resources, and further that the PCGR reference bundle can be distributed freely to the user community. It is our understanding that_ [OncoKB's terms of use](https://www.oncokb.org/terms) _do not fit well with this strategy._ 35 | 36 | __8. I have RNA fusion data that I want to analyse and include in the report. Is this possible with PCGR?__ 37 | 38 | _Answer: This is currently not supported as input for PCGR, but is something we are actively working on. The focus will be on whether detected RNA fusion events are previously known (i.e. seen in other tumor samples, e.g. from the Mitelman database), and whether some of them are presently in use as biomarkers for diagnosis or treatment._ 39 | 40 | __9. Is it possible for the users to update the data bundle to get the most recent versions of all underlying data sources?__ 41 | 42 | _Answer: As of now, the data bundle is updated only with each release of PCGR. The data harmonization pipeline of knowledge databases in PCGR contain numerous and complex procedures, with several cleaning, quality control, and re-formatting steps, and is semi-automated in its present form. The versions of all databases and key software elements are outlined in each PCGR report._ 43 | --------------------------------------------------------------------------------