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

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

Open
aryarm opened this issue Apr 22, 2022 · 0 comments
Open

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

aryarm opened this issue Apr 22, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@aryarm
Copy link
Member

aryarm commented Apr 22, 2022

...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...

@aryarm aryarm added the enhancement New feature or request label Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant