Pysam is a Python package for reading, manipulating, and writing genomics data such as SAM/BAM/CRAM and VCF/BCF files. It's a lightweight wrapper of the HTSlib API, the same one that powers samtools, bcftools, and tabix.
I need to create an AlignmentFile obj from a SAM file that I have stored in a string. This is part of a workflow where I run several steps using subprocess.run() and catch their stdout. I am looking for ways of working without making temporary files.
I see that AlignmentFile does not support StringIO, but allows for stdin. I think I can to patch into stdin using standard python tools, but a way to directly feed a string would be great.
I need to create an AlignmentFile obj from a SAM file that I have stored in a string. This is part of a workflow where I run several steps using subprocess.run() and catch their stdout. I am looking for ways of working without making temporary files.
I see that AlignmentFile does not support StringIO, but allows for stdin. I think I can to patch into stdin using standard python tools, but a way to directly feed a string would be great.