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

Should writing Strings to INFO be escaped #300

Closed
holtgrewe opened this issue Sep 6, 2024 · 2 comments
Closed

Should writing Strings to INFO be escaped #300

holtgrewe opened this issue Sep 6, 2024 · 2 comments
Assignees
Labels
bug Something isn't working vcf

Comments

@holtgrewe
Copy link
Contributor

Hi, when writing a STRING value to an INFO field that contains a semicolon ; then this file cannot be imported any more.

Should I escape this in my code using noodles-vcf or should noodles do it?

@zaeleus zaeleus added vcf bug Something isn't working labels Sep 6, 2024
@zaeleus zaeleus self-assigned this Sep 6, 2024
@zaeleus
Copy link
Owner

zaeleus commented Sep 6, 2024

Thanks for the report.

The output is correct. Semicolons (;) in info string values are being percent-encoded to %3B (e.g., "a;b" => "a%3Bb"). However, vcf::Record is not decoding them, which in turn makes the writer, essentially, double encode.

The buffered record reader (Reader::read_record_buf and Reader::record_bufs) can be used as a workaround for now.

zaeleus added a commit that referenced this issue Sep 6, 2024
…ng values

This changes the values iterator item from `&str` to `Cow<'_, str>`.

See #300.
@zaeleus zaeleus closed this as completed in 6a91b5a Sep 6, 2024
@zaeleus
Copy link
Owner

zaeleus commented Sep 9, 2024

This is now fixed in noodles 0.81.0 / noodles-vcf 0.64.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working vcf
Projects
None yet
Development

No branches or pull requests

2 participants