A lightweight desktop application for rapid manual selection and annotation of Strand-seq cells from MosaiCatcher count plot PDFs.
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.
main: current two-stage selection and annotation workflowminimal: preserved v1 workflow with one classification per cell
- Open MosaiCatcher count plot PDFs directly
- Extract sample name, cell ID, total reads, and duplicate rate
- Record separate
selectedandannotationvalues 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
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-selectorWhenever 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.pdfAt startup the application scans the PDF, extracts metadata, detects all cell pages, and creates a sample-specific results directory.
| Key | selected value |
|---|---|
= |
yes |
- |
no |
The selection key does not advance to the next cell. It activates the annotation stage for the same cell.
| 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.
Press Escape to undo one recorded binding. Backspace is retained as an alias.
Undo is action-based:
- On a partially processed cell, it removes the selection decision.
- After a completed cell, it returns to that cell and removes its annotation while retaining its selection.
- Pressing it again removes that cell's selection.
- 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.
Results are written to results/SAMPLE/ and refreshed after every accepted keypress and undo:
results/
└── SAMPLE/
├── annotations.csv
├── autosave.json
└── SAMPLE.txt
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.76Contains cell IDs whose selected value is yes, regardless of their second-round annotation:
A6159_L2_1003
A6159_L2_1011
Stores the current position plus both sets of values after every accepted keypress and undo.
Run the regression suite from the repository root:
PYTHONPATH=src python -m unittest discover -s tests -vEach cell page should contain metadata similar to:
Sample: IBD-CD19-T
Cell: A6159_L2_1003
Total number of reads: 183,213
Duplicate rate: 82%
Current main version: v2.0
The original v1 interface remains available on the minimal branch.