Skip to content
Merged

Dev #443

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 0 additions & 45 deletions .github/workflows/dockerhub.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
needs: website

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE, run_dont_run = FALSE)
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE, run_dont_run = TRUE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: immunarch
Type: Package
Title: Multi-Modal Immune Repertoire Analytics for Immunotherapy and Vaccine Design in R
Version: 0.10.2
Version: 0.10.3
Authors@R: c(
person("Vadim I.", "Nazarov", , "support@immunomind.com", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-3659-2709")),
Expand Down
90 changes: 18 additions & 72 deletions R/v0_vis.R
Original file line number Diff line number Diff line change
Expand Up @@ -169,90 +169,36 @@ theme_cleveland2 <- function(rotate = TRUE) {
#'
#' @description
#'
#' `r lifecycle::badge('deprecated')`
#' `r lifecycle::badge('experimental')`
#'
#' **`vis()` is a lightweight, quick-look plotting helper.**
#' It's designed to help you **visualise results fast** with sensible defaults.
#' It automatically detects the input type and chooses an appropriate visualisation
#' (e.g., output from `airr_stats_genes()` is recognised as gene usage values and plotted
#' without extra arguments).
#'
#' Output from every function in immunarch can be visualised with a
#' single function - `vis`. The `vis` automatically detects
#' the type of the data and draws a proper visualisation. For example, output
#' from the `repOverlap` function will be identified as repertoire overlap values
#' and respective visualisation will be chosen without any additional arguments.
#' See "Details" for the list of available visualisations.
#' **vis() is not intended for publication-quality figures.**
#' For serious, highly customised, or publication-ready plots, I recommend
#' building your graphics directly with **ggplot2**.
#'
#' @param .data Pass the output from any immunarch analysis tool to `vis()`.
#' @param .data The output from any immunarch analysis function. The function automatically resolves to a correct visualisation.
#' @param ... Any other arguments, see the "Details" section for specific visualisation functions.
#'
#' @details
#' List of available visualisations for different kinds of data.
#'
#' Basic analysis:
#'
#' - Exploratory analysis results (from [repExplore]) - see [vis.immunr_exp_vol];
#'
#' - Clonality statistics (from [repClonality]) - see [vis.immunr_homeo].
#'
#' Overlaps and public clonotypes:
#'
#' - Overlaps (from [repOverlap]) using heatmaps, circos plots, polar area plots - see [vis.immunr_ov_matrix];
#'
#' - Overlap clustering (from [repOverlapAnalysis]) - see [vis.immunr_hclust];
#'
#' - Repertoire incremental overlaps (from [repOverlap]) - see [vis.immunr_inc_overlap];
#'
#' - Public repertoire abundance (from [pubRep]) - vis [vis.immunr_public_repertoire].
#'
#' Gene usage:
#'
#' - Gene usage statistics (from [geneUsage]) using bar plots, box plots - see [vis.immunr_gene_usage];
#'
#' - Gene usage distances (from [geneUsageAnalysis]) using heatmaps, circos plots, polar area plots - see [vis.immunr_ov_matrix];
#'
#' - Gene usage clustering (from [geneUsageAnalysis]) - see [vis.immunr_hclust].
#'
#' Diversity estimation:
#'
#' - Diversity estimations (from [repDiversity]) - see [vis.immunr_chao1].
#'
#' BCR analysis:
#'
#' - Clonal tree (from [repClonalFamily]) - see [vis.clonal_family] and [vis.clonal_family_tree].
#'
#' Advanced analysis:
#'
#' - Repertoire dynamics (from [trackClonotypes]) - see [vis.immunr_dynamics];
#'
#' - Sequence logo plots of amino acid distributions (from [kmer_profile]) - see [vis_seqlogo];
#'
#' - Kmers distributions (from [getKmers]) - see [vis.immunr_kmer_table];
#'
#' - Mutation networks (from mutationNetwork) - Work In Progress on vis.immunr_mutation_network;
#'
#' - CDR3 amino acid properties, e.g., biophysical (from cdrProp) - Work In Progress on vis.immunr_cdr_prop.
#'
#' Additionaly, we provide a wrapper functions for visualisations of common data types:
#'
#' - Any data frames or matrices using heatmaps - see [vis_heatmap] and [vis_heatmap2];
#'
#' - Any data frames or matrices using circos plots - see [vis_circos].
#' List of available visualisations for different kinds of data - will be available soon.
#'
#' @return
#' A ggplot2, pheatmap or circlize object.
#' A ggplot2 object.
#'
#' @seealso [fixVis] for precise manipulation of plots.
#'
#' @examples
#' \dontrun{
#' # Load the test data
#' data(immdata)
#'
#' # Compute and visualise:
#' ov <- repOverlap(immdata$data)
#' vis(ov)
#'
#' gu <- geneUsage(immdata$data)
#' vis(gu)
#'
#' dv <- repDiversity(immdata$data)
#' vis(dv)
#' immdata <- get_test_idata() |> agg_repertoires("Therapy")
#' airr_stats_genes(immdata, gene_col = "v_call") |> vis()
#' airr_public_jaccard(immdata) |> vis()
#' airr_diversity_pielou(immdata) |> vis()
#' airr_diversity_chao1(immdata) |> vis()
#' }
#' @export
vis <- function(.data, ...) {
Expand Down
21 changes: 0 additions & 21 deletions R/v1_aaa_commons_vis.R
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
#
# 1) Look at this for examples: https://chatgpt.com/c/68eacc4b-785c-832a-88f5-b94086ad7f26
#
# 2) Register in the registry. Registry should check if all visualisations are assigned to existing (!) classes.
# vis_airr_diversity_chao1 <- ...
# It is probably impossible to do...
# Should use https://stat.ethz.ch/R-manual/R-devel/RHOME/library/base/html/S3method.html
#
# 3) I need registry to control the class system in one place. One for assigning classes following a specific schema, the other one is for parsing classes.
# I probably need to write a short manual on the logic of this. And on the structure of the code. And on the phiolosophy / architectural design decisions. Same for immundata.
#
# 4) Key question: can I use different names? https://stackoverflow.com/questions/61482561/whats-the-preferred-means-for-defining-an-s3-method-in-an-r-package-without-int/61483612#61483612
# https://vctrs.r-lib.org/reference/s3_register.html
#
# 5) [!!!] I still need some name for Roxygen to @inheritParams. There is no way around that.
# opt.1 - dynamically register S3 stuff, one big vis() or some weird names for docs
# opt.2 - pre-defined classes, vis() is constructed via @inheritParams
# Or...
# - https://github.com/r-lib/roxygen2/issues/1159
# - https://github.com/rstudio/renv/blob/4a8bcb4605f085fbea5f29a76ad9a291ac2bd363/R/roxygen.R#L2-L26

#' @keywords internal
make_fixed_col_plot <- function(x_col, y_col, title, xlab, ylab) {
checkmate::assert_string(x_col)
Expand Down
2 changes: 1 addition & 1 deletion R/v1_migration_updates.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' @keywords internal
immunarch_v1_update_oct_2025 <- function() {
cli::cli_h1("{cli::col_green('immunarch')} {cli::col_yellow('0.10.0')} -- Critical Pre-release Notice")
cli::cli_h1("{cli::col_green('immunarch')} {cli::col_yellow('0.10.3')} -- Critical Pre-release Notice")

cli::cli_alert_warning("Update #1 [Oct 2025] -- Major changes are coming in {cli::col_green('immunarch')} {cli::col_yellow('1.0.0')}!")
cli::cli_text(cli::col_yellow(cli::spark_line(runif(110, 0, 1))))
Expand Down
2 changes: 2 additions & 0 deletions R/v1_public_airr.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
#' # Change this only if you know what you're doing (e.g., multi-user machines, shared CI/servers).
#' db_exec("SET threads TO 1")
#' # Load data
#' \dontrun{
#' immdata <- get_test_idata() |> agg_repertoires("Therapy")
#' }
#'
#' @name airr_public
#' @concept Public indices
Expand Down
2 changes: 2 additions & 0 deletions man/airr_public.Rd

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

87 changes: 19 additions & 68 deletions man/vis.Rd

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