pysam-developers / pysam

Pysam is a Python package for reading, manipulating, and writing genomics data such as SAM/BAM/CRAM and VCF/BCF files. It's a lightweight wrapper of the HTSlib API, the same one that powers samtools, bcftools, and tabix.
https://pysam.readthedocs.io/en/latest/
MIT License
774 stars 274 forks source link

Export samtools wrappers #1306

Open msto opened 1 week ago

msto commented 1 week ago

pysam does not currently export the various wrapper functions in the samtools module, resulting in type-checking errors.

e.g.

45: error: Module has no attribute "faidx"  [attr-defined]

I've followed the pattern implemented in the other modules, exporting attributes in a module-specific __all__ declaration and then adding this list to the package's __all__.

I believe this PR addresses the problem, but I'm unable to verify - when I install the updated package locally with pip install -e, mypy cannot find the type stubs for pysam. (As an aside - is there a CONTRIBUTING or other documentation for local install/testing?)

Thanks!