Metadata-Version: 2.4
Name: molamola
Version: 0.3.0
Summary: Plot Oxford Nanopore variation as self-contained HTML reports.
Author-email: Martin Haagmans <martinhaagmans84@gmail.com>
License: MIT License
        
        Copyright (c) 2026 Martin Haagmans
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/martinandclaude/molamola
Project-URL: Source, https://github.com/martinandclaude/molamola
Project-URL: Issues, https://github.com/martinandclaude/molamola/issues
Project-URL: Changelog, https://github.com/martinandclaude/molamola/blob/main/CHANGELOG.md
Keywords: bioinformatics,ont,oxford-nanopore,long-read,structural-variants,compound-het,phasing,vcf,plotting,cytogenetics
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: matplotlib>=3.6
Requires-Dist: numpy>=1.23
Requires-Dist: pycirclize>=1.10
Requires-Dist: pandas>=1.5
Requires-Dist: biopython>=1.80
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Requires-Dist: ruff>=0.4; extra == "dev"
Provides-Extra: derive
Requires-Dist: pyliftover>=0.4; extra == "derive"
Dynamic: license-file

```
                 _                       _              .--.
 _ __ ___   ___ | | __ _ _ __ ___   ___ | | __ _      _/    \___
| '_ ` _ \ / _ \| |/ _` | '_ ` _ \ / _ \| |/ _` |    ( o        )
| | | | | | (_) | | (_| | | | | | | (_) | | (_| |     \___..___/
|_| |_| |_|\___/|_|\__,_|_| |_| |_|\___/|_|\__,_|         ||
```

A Python plotting tool for Oxford Nanopore variation data. **One input in, one self-contained HTML report out.** molamola picks between three plot types based on its input:

- a VCF with `##INFO=<ID=SVTYPE,...>` → SV / cytogenetics report (long-read SV VCFs from Sniffles2 / cuteSV / SVIM / pbsv / NanoVar);
- a VCF with `##INFO=<ID=CSQ,...>` + `##FORMAT=<ID=PS,...>` → per-gene phased-haplotype panels (phased + VEP-annotated small-variant VCFs from WhatsHap / HiPhase);
- a mosdepth `regions.bed.gz` (via `--mosdepth`) → karyotype coverage report (genome-wide CN scatter + rolling-median smooth, with an optional BAF panel beneath when paired with a small-variant VCF).

Figures embedded as base64 PNGs — no external assets, opens offline.

**Full documentation:** <https://martinandclaude.github.io/molamola/>

## Install

```sh
pip install molamola
```

Or via conda — note that both bioconda and conda-forge channels are needed (pycirclize lives on conda-forge):

```sh
conda create -n molamola -c bioconda -c conda-forge molamola
```

Or for development from a clone:

```sh
git clone https://github.com/martinandclaude/molamola.git
cd molamola
pip install -e .[dev]
pytest -v
```

## Quick start

```sh
# Long-read SV VCF (Sniffles2 etc.) → cytogenetics report
molamola --vcf sample.sniffles.vcf --out reports/
open reports/sample.report.html

# Phased + VEP-annotated VCF → compound-het workup, all candidate genes
molamola --vcf sample.phased.vep.vcf.gz --out reports/
open reports/sample.compound_het.report.html

# Just one gene from a phased + VEP VCF
molamola --vcf sample.phased.vep.vcf.gz --gene NEB --out reports/

# Mosdepth output → karyotype coverage report (genome-wide CN)
molamola --mosdepth sample.regions.bed.gz --reference hg38 --out reports/
open reports/sample.karyotype.report.html

# Add a BAF panel beneath the genome-wide CN scatter
molamola --mosdepth sample.regions.bed.gz --vcf sample.phased.vcf.gz \
         --reference hg38 --out reports/
```

Either `--vcf` or `--mosdepth` is required; `--out <directory>` is required too (molamola refuses rather than silently writing the report next to the input file). With `--vcf`, the plot mode is auto-detected from the VCF header (`##INFO=<ID=SVTYPE>` → SV; `##INFO=<ID=CSQ>` + `##FORMAT=<ID=PS>` → compound-het; otherwise refused). With `--mosdepth`, karyotype coverage mode runs and any accompanying `--vcf` is used as the BAF source. Karyotype mode expects uniform-bin mosdepth runs (`mosdepth --by <int>`).

See the [docs](https://martinandclaude.github.io/molamola/) for example output, VEP annotation prep, the full CLI reference, filter explanations, and worked examples.

## Acknowledgements

- [Sniffles2](https://github.com/fritzsedlazeck/Sniffles), [cuteSV](https://github.com/tjiangHIT/cuteSV), [SVIM](https://github.com/eldariont/svim), [pbsv](https://github.com/PacificBiosciences/pbsv), [NanoVar](https://github.com/cytham/nanovar) — long-read SV callers.
- [WhatsHap](https://github.com/whatshap/whatshap), [HiPhase](https://github.com/PacificBiosciences/HiPhase) — long-read phasing.
- [VEP](https://github.com/Ensembl/ensembl-vep), [MANE Select](https://www.ncbi.nlm.nih.gov/refseq/MANE/), [ClinVar](https://www.ncbi.nlm.nih.gov/clinvar/) — variant annotation and significance.
- [pyCirclize](https://github.com/moshi4/pyCirclize) — circos plot.
- [matplotlib](https://github.com/matplotlib/matplotlib), [numpy](https://github.com/numpy/numpy).
- [bcftools / samtools / htslib](https://github.com/samtools/bcftools) — VCF pre-processing helpers.
- [mosdepth](https://github.com/brentp/mosdepth) — per-bin coverage input to karyotype mode.
- [UCSC Genome Browser](https://hgdownload.soe.ucsc.edu/) — hg38 and T2T-CHM13v2.0 cytobands.
- [iconsdb.com](https://www.iconsdb.com/) — header fish icon (deep-pink, mirrored).

## License

[MIT](LICENSE).
