Skip to content

allow writing Haplotype objects one by one instead of all at once #44

@aryarm

Description

@aryarm

...using a Haplotypes.write_line() method sorta like this

with open('file.hap') as file:
    haps = Haplotypes(file)
    for hap in haplotypes:
        haps.write_line(hap)

The main challenge to this is that the Haplotypes class would need to accept a TextIO object instead of a Path or str representing a file. I haven't figured out a good way of doing this yet. One idea is to just use the existing fname param of Haplotypes.__init__() but then we would probably need to do something to check the type of the class and raise error messages if they try to read from it or use it with TabixFile? I'm not sure yet...

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions