You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Much as with ordinary Python I/O streams, you should call myvariantfile.close() when you have finished writing to it to ensure the output is flushed and the file closed in a timely fashion.
Alternatively VariantFile, AlignmentFile, etc can be used as context managers, so that the following would ensure the file is closed at the end of the with statement:
Pysam could do more for flushing these files while writing them: there is an underlying HTSlib hts_flush() function that VariantFile, AlignmentFile, etc could expose as a flush() method. However I suspect most code would not really benefit from being able to do this.
Output is not written until the program completes. Is this something that could be added? Many thanks for your work.
The text was updated successfully, but these errors were encountered: