Skip to content

About

Lightweight desktop application for rapid manual selection of Strand-seq cells!

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

20 Commits

Folders and files

Repository files navigation

Strand Selector

A lightweight desktop application for rapid manual selection and annotation of Strand-seq cells from MosaiCatcher count plot PDFs.

Strand Selector GUI

Strand Selector provides a two-stage, keyboard-only QC workflow. Every cell first receives a binary selection decision and then a more detailed annotation. Results are continuously saved for downstream cluster workflows.

Versions

  • main: current two-stage selection and annotation workflow
  • minimal: preserved v1 workflow with one classification per cell

Features

  • Open MosaiCatcher count plot PDFs directly
  • Extract sample name, cell ID, total reads, and duplicate rate
  • Record separate selected and annotation values for every cell
  • Undo individual keypresses across partially or fully annotated cells
  • Continuously update autosave, full annotation table, and selected cell list
  • Scale the window and count plot to the available display size

Installation

Clone the repository and install it in a virtual environment (only do this the first time!!):

git clone https://github.com/pweidner/strand-selector.git
cd strand-selector
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install -e .

Verify the installation:

strand-selector

Usage

Whenever you want to launch Strand Selector on a MosaiCatcher count plot PDF:

cd path/to/strand-selector

source .venv/bin/activate
strand-selector /path/to/sample_count_plots.pdf

At startup the application scans the PDF, extracts metadata, detects all cell pages, and creates a sample-specific results directory.

Round 1: selection

Key selected value
= yes
- no

The selection key does not advance to the next cell. It activates the annotation stage for the same cell.

Round 2: annotation

Key annotation value
1 brdu-over
2 brdu-under
3 wavey
4 spikey
Q low-reads
W wgs
E empty
R background
- control
= good

The annotation key completes the current cell and advances to the next one. The meaning of = and - therefore depends on the active stage shown above the plot.

Undo

Press Escape to undo one recorded binding. Backspace is retained as an alias.

Undo is action-based:

  1. On a partially processed cell, it removes the selection decision.
  2. After a completed cell, it returns to that cell and removes its annotation while retaining its selection.
  3. Pressing it again removes that cell's selection.
  4. Further presses continue backward through earlier cells.

After the final cell receives its annotation, the application writes the final autosave, annotation table, and selected-cell list, then closes. This finalization depends only on completing round 2; every combination of yes/no and annotation is supported.

Outputs

Results are written to results/SAMPLE/ and refreshed after every accepted keypress and undo:

results/
└── SAMPLE/
    ├── annotations.csv
    ├── autosave.json
    └── SAMPLE.txt

annotations.csv

Contains one row per cell with separate decision and annotation columns:

cell_id,selected,annotation,reads,duplicate_rate
A6159_L2_1003,yes,good,183213,0.82
A6159_L2_1007,no,low-reads,64210,0.76

SAMPLE.txt

Contains cell IDs whose selected value is yes, regardless of their second-round annotation:

A6159_L2_1003
A6159_L2_1011

autosave.json

Stores the current position plus both sets of values after every accepted keypress and undo.

Testing

Run the regression suite from the repository root:

PYTHONPATH=src python -m unittest discover -s tests -v

Expected PDF Format

Each cell page should contain metadata similar to:

Sample: IBD-CD19-T
Cell: A6159_L2_1003
Total number of reads: 183,213
Duplicate rate: 82%

Status

Current main version: v2.0

The original v1 interface remains available on the minimal branch.

About

Lightweight desktop application for rapid manual selection of Strand-seq cells!

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages