Skip to content

Add support for faceting by both subject ID and antigen-isotype in plot_predicted_curve() #126

@Kwan-Jenny

Description

@Kwan-Jenny

Description
This issue proposes extending the plot_predicted_curve() function to support dual-axis faceting: by participant ID (rows) and by antigen-isotype (columns) using facet_grid() instead of facet_wrap(). This update is based on advisor feedback during the 07.30.2025 meeting and is intended to improve visualization of antibody response dynamics across both subjects and antigen-isotype combinations.

Motivation

  • Users need to compare IgG and IgA response patterns within the same individual.

  • This layout will make it easier to examine temporal correlation between isotypes and identify heterogeneity in immune response patterns.

  • Builds on recent support for multiple ID faceting and enhances interpretability of individual-level plots.

Planned Changes

  • Refactor internal faceting logic from facet_wrap() to facet_grid() when multiple antigen-isotype combinations are provided.

  • Add argument(s) (e.g. facet_by_isotype = TRUE) to toggle this behavior.

  • Maintain backward compatibility with current single-axis faceting.

  • Update visual examples and test cases for:

    • One subject with multiple antigen-isotypes

    • Multiple subjects with multiple antigen-isotypes

Related Tasks

  • Expand test-plot_predicted_curve.R to cover the new dual-axis faceting scenario.

  • Add new test example(s) for 2×2 and 3×2 facet grids.

  • Update examples-plot_predicted_curve.R to demonstrate the new functionality.

  • Revise plot_predicted_curve() documentation to include usage of dual faceting.

Background
This feature was discussed during the July 30th check-in meeting with Dr. Kristen Aiemjoy and Dr. Ezra Morrison. Kristen specifically suggested allowing side-by-side comparison of IgG and IgA curves for the same subject to assist with evaluating correlation in response timing across isotypes.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions