Skip to content

syncing with master branch - #1

Merged
AyushSemwal merged 6 commits into
AyushSemwal:annot_demux_refactorfrom
huishenlab:main
Apr 17, 2026
Merged

syncing with master branch#1
AyushSemwal merged 6 commits into
AyushSemwal:annot_demux_refactorfrom
huishenlab:main

Conversation

@AyushSemwal

Copy link
Copy Markdown
Owner

syncing with master branch

* Barcode correction and demuxing don't necessarily need to be ran concurrently with annotation. Separate commands for both with options to also be performed concurrently.
* Barcode correction can be ran without a need for a whitelist generated by corresponding short-read library. This makes barcode correction step to be ran once annotation is finished on the whole dataset. Concurrent annotation, barcode correction and demuxing can still be ran with a readily available whitelist.
* Improved dynamic batching taking into consideration all the layers of the model being used. This prevents users from under or over utilizing the GPU memory
* QC metrics automated and can be generated and visualized using qc-metrics.
New modules / commands                                                                           
                                                                                                   
  - evaluate_model / assess-model (scripts/evaluate_model.py, wrappers/evaluate_model_wrap.py, docs/webpages/model_training/assess_model.qmd): new model-assessment module with report generation and per-segment accuracy metrics.                                                     
  - featurecounts (scripts/featurecounts_matrix.py, wrappers/featurecounts_wrap.py, docs/webpages/pipeline/featurecounts.qmd): new count-matrix generation step.                     
  - container_runtime.py: container detection/runtime helpers.
                                                                                                   
  Build / packaging                                     
                                                                                                   
  - Migrated setup.py → pyproject.toml (removed setup.py, MANIFEST.in).                                                                                                             
  - Added version stamping via __init__.py + utils/__init__.py, with new unit test tests/unit/test_init_version.py.                                                                 
  - environment.yml updates; conftest.py added.         
                                                                                                   
  Training / artifacts                                  
                                                                                                   
  - train_model: artifact versioning, cleaner training folder naming, new CLI help grouping, updated training_params.yaml, expanded docs (train_model.qmd, train_model_cli.qmd, read_simulation.qmd, simulate_data_cli.qmd, model_training.qmd).                                  
  - Added generic guidance that Conv+CRF (no BiLSTM) is often sufficient.
  - Removed intro_errors.qmd.                                                                      
                                                                                                   
  Pipeline improvements                                                                            
                                                                                                   
  - Deduplication speed-up: the "duplicate marking speed up"  
  commit.
  - QC metrics: boxplot corrections, MultiQC-compatible outputs, no-PyArrow refactor; wrapper updates.                                
  - Preprocessing (scripts/preprocess_reads.py, wrappers/preprocess_wrap.py): reworked + documented.                                                                                      
  - Barcode correction / demux: refactors in barcode_correction_wrap.py, correct_barcodes.py, demux_wrap.py; scripts/export_demux.py removed.                                   
  - Annotation: updates to annotate_new_data.py, annotate_reads.py, extract_annotated_seqs.py, annotate_reads_wrap.py.                                                                          
  - Barcode discovery updates (scripts/discover_barcodes.py, generate_whitelist_wrap.py).
                                                                                                   
  Configuration                                         
                                                                                                   
  - utils/seq_orders.yaml: added segment/library definitions used by refactor.        
  - utils/training_params.yaml updated.
                                                                                                   
  Tests                                                 
                                                                                                   
  - New tests/unit/test_init_version.py.                
  - Major rewrite of tests/10x3p/test_pipeline.py for new features.
  - Minor updates to other unit tests.                                                             
   
  CI / docs                                                                                        
                                                        
  - .github/workflows/test.yml (model download + coverage adjustments), lint.yml tweak.            
  - Documentation restructured under docs/webpages/pipeline/ (new pages: preprocessing, annotation, barcode_demux, align_dedup, qc_metrics, split_bam, visualization, featurecounts) +  pipeline_guide.qmd, quick_start.qmd, resource_requirements.qmd, usage.qmd, _quarto.yml, index.qmd.
pytest on push and PR to dev and annot_demux_refactor
non-PEP440 tage stripped to clean version
New commands

barcode_correct — standalone Levenshtein correction against a whitelist; resumable, optional inline demux via
--run-demux.
demux_reads — standalone FASTA/FASTQ export from annotations (demuxed or bulk).
generate_whitelist — whitelist-free cell-barcode discovery via knee detection + deletion-neighborhood near-dup merging.
qc_metrics — annotation + BAM-level QC, knee plots, boxplots, MultiQC TSVs, HTML report. ~3.9k lines, no PyArrow.
assess_model — per-segment accuracy assessment for trained models with a generated report.
featurecounts — gene-level count matrix from per-cell BAMs.
Pipeline restructure

You can run barcode_correct and demux_reads against existing annotations — useful for resuming, re-running with different thresholds, or the whitelist-free flow.
annotate_reads and visualize accept preprocessed directories directly.
User-configurable bin width in preprocessing
Option to split concatenated reads during annotation.
Checkpoint/resume across annotate, BC correct, and demux. Optional chunk cleanup. annotations_valid.parquet
auto-removed once the corrected file exists.
Barcode correction handles UMI-less protocols and arbitrary barcode-type combos. All FASTA/FASTQ outputs gzipped.
Model / training

REG and HYB paths dropped. CRF-only. 10x3p_sc_ont_013 is the new default.
seq_orders and training_params moved from TSV → YAML with a cleaner schema.
Dynamic batch sizing now accounts for all layers, not just conv.
Training artifacts versioned and folder naming cleaned up.
QC

qc_metrics.py computes and visualizes multiple QC plots at various levels
Dedup / BAM

UMI dedup significantly faster.
Minor tweaks to split_bam.
Packaging & CI

setup.py → pyproject.toml. Moved to setuptools-scm for versioning.
Fixed the upstream CI breakage: tag_regex + git_describe_command so legacy non-PEP440 tags like v0.2.1_tf2.15.0 are
stripped to 0.2.1.
Added a Docker publish workflow.
pytest now runs on push/PR to dev and annot_demux_refactor.
New unit tests for checkpoint chunk size, _version, and the seq_orders YAML refactor. Integration tests expanded.
Added container_runtime.py helper.
Docs

Quarto site reorganized into per-stage pages: preprocessing, annotation, barcode/demux, align/dedup, QC, split BAM,
visualization, featurecounts.
New model-assessment guide; model-training and read-simulation docs rewritten.
Quick start, usage, install, resource-requirements pages refreshed.
@AyushSemwal
AyushSemwal merged commit b7c4c11 into AyushSemwal:annot_demux_refactor Apr 17, 2026
4 of 5 checks passed
@codecov

codecov Bot commented Apr 17, 2026

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant