-
Notifications
You must be signed in to change notification settings - Fork 4
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
fix: 1) improve error in transform
when providing an empty hap file and a --region
and 2) allow for calling write()
on Genotypes objects without variants
#264
Conversation
transform
when it is given an empty hap filetransform
when it is given an empty hap file and a --region
transform
when it is given an empty hap file and a --region
pysam
errors in transform
when providing an empty hap file and a --region
pysam
errors in transform
when providing an empty hap file and a --region
pysam
errors in transform
when providing an empty hap file and a --region
and allow for writing genotypes files without variants
@mlamkin7, what do you think about this? Is the correct behavior to write an empty file or should we error out instead? It gets a little weird for the PGEN files. For those, I think the |
pysam
errors in transform
when providing an empty hap file and a --region
and allow for writing genotypes files without variantspysam
errors in transform
when providing an empty hap file and a --region
and 2) allow for writing genotypes files without variants
Right now I can't think of any reason why transform would happen with an empty hap file and we would want an empty output. I'd say its better just to error out and let them know .hap is empty. |
ok, that sounds reasonable I'll add some code to raise those errors |
pysam
errors in transform
when providing an empty hap file and a --region
and 2) allow for writing genotypes files without variantstransform
when providing an empty hap file and a --region
and 2) allow for calling write()
on Genotypes objects without variants
ok, done! See 525fd44 for the new Value Error in Note that I also made some minor changes in 9889833 to unrelated things: If you want to view the changes in this PR without the minor changes in 9889833, click here |
This PR fixes two issues.
1. An issue with the
transform
commandWhen the input
.hap
file is empty and the--region
parameter is provided, thetransform
command will fail with crypticpsyam
errors instead of outputting an empty genotypes file. This PR resolves those.The first error occurs with a regular hap file (that isn't indexed):
https://github.com/CAST-genomics/haptools/actions/runs/12058438776/job/33625133365#step:9:380
And the second occurs when the hap file is indexed:
https://github.com/CAST-genomics/haptools/actions/runs/12058465901/job/33625213549#step:9:400
2. An issue with the Genotypes classes
As an extra bonus, this PR also resolves an error in the
GenotypesVCF
andGenotypesPLINK
classes when attempting to write files without any variants:and
https://github.com/CAST-genomics/haptools/actions/runs/12059160422/job/33627254672#step:9:378