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

VCF Filtration doesn't work with uncompressed, or UTF-8 #317

Open
OgnjenMilicevic opened this issue Aug 8, 2019 · 1 comment
Open

VCF Filtration doesn't work with uncompressed, or UTF-8 #317

OgnjenMilicevic opened this issue Aug 8, 2019 · 1 comment

Comments

@OgnjenMilicevic
Copy link

Hi!

I tried applying your filtering script on an uncompressed VCF, and it returns an error:
TypeError: startswith first arg must be bytes or a tuple of bytes, not str

It works when I gzip the file, but it fails on an UTF-8 character.

I see some fixed but the vcf_filter has not been changed for 6 years, any chance we can get an update on it to handle these two issues?

@OgnjenMilicevic
Copy link
Author

The core of the first problem seems to be that you are parsing the input with the binary opener long before you pass it to reader and assign it a reader:

parser.add_argument('input', metavar='input', type=argparse.FileType('rb'), nargs='?', default=None,
        help='File to process (use - for STDIN)')

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

1 participant