-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create methods and type stubs on pysam htslib C extension calls #22
Comments
Why not solve it in pysam so everyone can benefit? pysam-developers/pysam#1153 |
Well, @nh13 part of the goal of this would be to provide a better interface that has the commonly used parameters to each of def sort(in_bam: Path, out_bam: Path, compress: int = 5, by_name: bool = False, threads: int = 1) |
That makes sense. My only hesitancy is that the interface is tied to a specific samtools version, so we’d have to pin the version and revisit the available options each time we update the samtools dependency. And then why not have it in pysam? |
It is often helpful to use
pysam
bindings to htslib functions a laetc.
mypy
will complain when attempting to use these functions (presumably because they originate from a C extension module) with an error "AttributeError: module pysam has no attribute 'sort'"I think it would behoove us to make wrapper functions around the pysam htslib calls with named parameters and type checking etc.
This will require generating stubs for the functions, e.g.
The text was updated successfully, but these errors were encountered: