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

INFO field header key order #19

Closed
JakeHagen opened this issue Apr 11, 2022 · 3 comments
Closed

INFO field header key order #19

JakeHagen opened this issue Apr 11, 2022 · 3 comments

Comments

@JakeHagen
Copy link
Contributor

Hi Brent

echtvar annotates the header with this line

"##INFO=<ID={},Type={},Number=1,Description=\"{}\">",

I think this is fine, as I could not find anything in the VCF spec about key ordering, but in your vcfgo, the regex that checks the header doesn't match the ordering from ecthvar, which causes an error when using vcfgo to parse echtvar vcfs.

var typeRe = `String|Integer|Float|Flag|Character|Unknown`
var infoRegexp = regexp.MustCompile(fmt.Sprintf(`##INFO=<ID=(.+),Number=([\dAGR\.]*),Type=(%s),Description="(.*)">`, typeRe))

Can we make a change to one of these codebases? If so, which one? I am happy to submit a pull request, unless its easier for you to make these small changes yourself.

@brentp
Copy link
Owner

brentp commented Apr 11, 2022

wow. I am surprised that no one has hit this before in vcfgo. I'd definitely accept a PR to fix it there. Thanks for diagnosing!

@brentp
Copy link
Owner

brentp commented Apr 11, 2022

I can also simply change the order in echtvar if it ends up being a PITA to get the correct regex stuff in vcfgo.

@JakeHagen
Copy link
Contributor Author

I think I almost have the correct regex but I would appreciate also changing the ordering in echtvar. Thank you!

@brentp brentp closed this as completed in 750486c Apr 11, 2022
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