Skip to content

Commit

Permalink
Lower memory
Browse files Browse the repository at this point in the history
letting the dispatch do the writing skips the pulling in of the sorted result
Fixed #229 and #245
  • Loading branch information
ACEnglish committed Nov 28, 2024
1 parent 04d5feb commit 205617e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions truvari/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,10 +430,7 @@ def compress_index_vcf(fn, fout=None, remove=True):
if fout is None:
fout = fn + '.gz'
with tempfile.TemporaryDirectory() as tmpdirname:
m_tmp = make_temp_filename(tmpdir=tmpdirname, suffix='.vcf')
with open(m_tmp, 'w') as out_hdlr:
out_hdlr.write(bcftools.sort(fn, "--temp-dir", tmpdirname))
pysam.tabix_compress(m_tmp, fout, force=True)
bcftools.sort(fn, "-o", fout, "-O", "z", "--temp-dir", tmpdirname, catch_stdout=False)
pysam.tabix_index(fout, force=True, preset="vcf")
if remove:
os.remove(fn)
Expand Down

0 comments on commit 205617e

Please sign in to comment.