Skip to content

Build Scenario Apps

The existing commands are already examples of how to turn the framework into concrete applications.

Start From The Smallest Useful Abstraction

Before you write a new command, decide whether you really need:

  • a new command
  • a new workflow wrapper
  • a new R layout

Often, a new scenario only needs a new command that reuses existing workflow code.

Suggested Build Recipe

1. Define The User Input Model

Examples:

  • mutation table
  • single-cell TSV
  • BAM + region

Keep user input parsing in the command layer.

2. Normalize Into Framework Inputs

Examples:

  • convert rows to STRRegion
  • derive mutation intervals
  • define filter_tags
  • select a plotting layout

3. Reuse An Existing Workflow

Examples:

  • in_sight/vis_flow.py
  • in_sight/str_vis_flow.py
  • in_sight/str_vis_flow_simple.py
  • in_sight/bulkmonster_vis_flow.py

4. Reuse Or Replace The R Layout

If the standard layout is close enough, use it.

If not, either:

  • add a new R script under in_sight/r_script/
  • or pass a custom script through --r-script

5. Add Reporting Or Batch Logic

This is what turns a generic plotting framework into a scenario app.

Examples:

  • HTML summaries in cf2insights
  • row-wise iteration in scrna2insights
  • direct plotting bridge in plot2insights

A Good Mental Model

Think of the project like this:

  • plot2insights is the generic frontend
  • cf2insights and scrna2insights are productized applications
  • the flow modules and R scripts are the reusable backend building blocks