Skip to content
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

VcfWriter does not write VCF index files anymore #812

Closed
mjhipp opened this issue Mar 10, 2022 · 2 comments · Fixed by #816
Closed

VcfWriter does not write VCF index files anymore #812

mjhipp opened this issue Mar 10, 2022 · 2 comments · Fixed by #816
Labels

Comments

@mjhipp
Copy link
Contributor

mjhipp commented Mar 10, 2022

...unless overwriting an existing path (after #753)

When deciding whether to write an index, VcfWriter uses isRegularFile() on the output path. This will almost always return false, because the output path is usually a new, non-existing path (there is not already a regular file there).

Example (using FilterSomaticVcf), if I have this dir:

.
├── existing-file.vcf.gz
├── input.bai
├── input.bam
├── input.vcf.gz
└── input.vcf.gz.tbi

And run the tool using a new output path:

❯ java -jar fgbio-1.5.1.jar FilterSomaticVcf -i input.vcf.gz -o new-output.vcf.gz -b input.bam
...
[2022/03/10 14:39:31 | FgBioMain | Info] FilterSomaticVcf completed. Elapsed time: 0.04 minutes.

I get the following output:

.
├── existing-file.vcf.gz
├── input.bai
├── input.bam
├── input.vcf.gz
├── input.vcf.gz.tbi
└── new-output.vcf.gz

If I instead write to the existing-file.vcf.gz, I get an index:

❯ java -jar fgbio-1.5.1.jar FilterSomaticVcf -i input.vcf.gz -o existing-file.vcf.gz -b input.bam
...
[2022/03/10 14:40:19 | FgBioMain | Info] FilterSomaticVcf completed. Elapsed time: 0.04 minutes.

I now get an index written:

.
├── existing-file.vcf.gz
├── existing-file.vcf.gz.tbi
├── input.bai
├── input.bam
├── input.vcf.gz
└── input.vcf.gz.tbi

Indexes are written using 1.4.0:

❯ java -jar fgbio-1.4.0.jar FilterSomaticVcf -i input.vcf.gz -o new-output.vcf.gz -b input.bam
...
[2022/03/10 14:48:15 | FgBioMain | Info] FilterSomaticVcf completed. Elapsed time: 0.04 minutes.

❯ tree
.
├── input.bai
├── input.bam
├── input.vcf.gz
├── input.vcf.gz.tbi
├── new-output.vcf.gz
└── new-output.vcf.gz.tbi
@clintval clintval added the bug label Mar 10, 2022
@clintval
Copy link
Member

That's my fault :/ I can take a stab at a fix soon. Would be nice to have this patched before 2.0

@clintval clintval self-assigned this Mar 10, 2022
@tfenne
Copy link
Member

tfenne commented Mar 10, 2022

I think we're still a week or more away from a 2.0 release, but I do want to cut a beta/milestone either tomorrow or Monday for folks to start testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants