Skip to content

Framework Architecture

At a high level, In-Sight separates the stack into reusable layers.

Layer 1: Command Orchestration

Examples:

  • in_sight/commands/bayesmonstr2insights.py
  • in_sight/commands/plot2insights.py
  • in_sight/commands/cf2insights.py
  • in_sight/commands/scrna2insights.py

Responsibilities:

  • parse user intent
  • validate input combinations
  • choose a backend workflow
  • choose an R layout
  • define output paths

Layer 2: Visualization Workflows

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

Responsibilities:

  • parse regions
  • set processors
  • build dataframe intermediates
  • call the plotting backend

Layer 3: Read Processing Core

Examples:

  • in_sight/reads_manager.py
  • in_sight/reads_import.py
  • in_sight/samplers.py

Responsibilities:

  • iterate aligned reads
  • apply filters and sampling
  • organize layout and y-level placement
  • emit standardized dataframes

Layer 4: R Plotting Backend

Examples:

  • in_sight/r_plot.py
  • in_sight/r_script/plot_base.R
  • in_sight/r_script/plot_plain_with_full_features.R
  • in_sight/r_script/plot_size_helpers.R

Responsibilities:

  • map layouts to R scripts
  • validate CSV inputs
  • execute Rscript
  • render specialized layouts

Why This Matters

If you want to build a new application, you usually should not start by writing a new BAM parser or a new dataframe builder. Most of the time you only need:

  1. a new command
  2. maybe a new workflow wrapper
  3. maybe a new R layout

That is why the existing commands are valuable reference material.