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

Index error if file is empty #157

Open
mlarjim opened this issue Jul 26, 2024 · 1 comment
Open

Index error if file is empty #157

mlarjim opened this issue Jul 26, 2024 · 1 comment

Comments

@mlarjim
Copy link

mlarjim commented Jul 26, 2024

Hi!
I am a big fan of parsnp. I was using v1.7.4 so I decided to update parsnp to v2.0.5. However, I get this error:

File "miniconda3/envs/parsnp2/bin/parsnp", line 969, in parse_input_files
    if hdr[0] != ">":
       ~~~^^^
IndexError: string index out of range

It is due to an empty file in my genomes directory, but older versions overcome this problem.
Thank you in advance

@bkille
Copy link
Contributor

bkille commented Aug 9, 2024

Hi @mlarjim

So sorry for the late reply. I'll make sure the next update of Parsnp (which I'll release within the next week or so) will automatically check for this.

In the meantime, if you should be able to get around this by running parsnp with --validate-input. That flag will throw out any input file which is empty or has invalid formatting. (It isn't turned on by default as it can lead to longer runtimes for very large inputs).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants