--- title: "Getting Started with molpathR" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Getting Started with molpathR} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} resource_files: - figures/logo.svg - figures/logo-dark.svg --- [![R-CMD-check](https://github.com/CTTIR/molpathR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/CTTIR/molpathR/actions/workflows/R-CMD-check.yaml) [![pkgdown](https://github.com/CTTIR/molpathR/actions/workflows/pkgdown.yaml/badge.svg)](https://cttir.github.io/molpathR/) [![CRAN status](https://www.r-pkg.org/badges/version/molpathR)](https://CRAN.R-project.org/package=molpathR) [![Codecov test coverage](https://codecov.io/gh/CTTIR/molpathR/branch/main/graph/badge.svg)](https://app.codecov.io/gh/CTTIR/molpathR?branch=main) [![CRAN downloads](https://cranlogs.r-pkg.org/badges/molpathR)](https://cran.r-project.org/package=molpathR) [![CRAN downloads total](https://cranlogs.r-pkg.org/badges/grand-total/molpathR)](https://cran.r-project.org/package=molpathR) [![License: MIT](https://img.shields.io/badge/license-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) ```{r setup, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.width = 7, fig.height = 5 ) ``` ## Installation Install molpathR from GitHub: ```{r install, eval = FALSE} # install.packages("remotes") remotes::install_github("cttir/molpathR") ``` ## Quick start Load the package and create an example database: ```{r load} library(molpathR) db <- mp_example_db(n_patients = 50, seed = 42) db ``` ## Explore the data Get a cohort summary: ```{r summary} mp_summary(db) ``` ## Query patients ```{r query} # Find melanoma patients over 60 melanoma <- mp_query_patients(db, diagnosis == "Melanoma", age > 60) head(melanoma) ``` ## Query variants ```{r variants} # Pathogenic TP53 variants with VAF > 10% tp53 <- mp_query_variants(db, genes = "TP53", classification = "Pathogenic", min_vaf = 0.1) head(tp53) ``` ## Visualize ```{r landscape, fig.width = 8, fig.height = 5, fig.alt = "Recorded variant classifications across synthetic patients for the ten most frequent genes."} mp_plot_variant_landscape(db, top_n = 10) ``` ```{r survival, fig.width = 7, fig.height = 5, fig.alt = "Kaplan-Meier curves by diagnosis for synthetic overall survival times measured in months."} mp_plot_survival(db, group_by = "diagnosis", type = "os") ``` ## Launch the Shiny app ```{r shiny, eval = FALSE} mp_run_app(db) ```