Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Changed the default line ending in vcf.Writer() to '\n'. #139

Merged
merged 1 commit into from Feb 6, 2014

Conversation

Projects
None yet
2 participants

azalea commented Feb 5, 2014

Currently, the default is '\r\n'. Most vcf files in public repositories use '\n' line endings. And vcf.Writer() writes the meta data directly with the original line ending '\n', but changes the record line ending to '\r\n' by default, which is quite confusing (and may cause compatibility issues).

This is just a quick fix. A better way to approach this is to check the line ending in the orignal vcf file served as the template, and use it as default. I am not sure whether this is worth it though.

Owner

jamescasbon commented Feb 6, 2014

What does the spec say?

@jamescasbon jamescasbon added a commit that referenced this pull request Feb 6, 2014

@jamescasbon jamescasbon Merge pull request #139 from azalea/master
Changed the default line ending in vcf.Writer() to '\n'.
ab941e0

@jamescasbon jamescasbon merged commit ab941e0 into jamescasbon:master Feb 6, 2014

azalea commented Feb 6, 2014

The VCF specification does not specify a line ending style, as far as I know. So I think the ideal solution is to maintain the line ending used in the VCF file that serves as the template to vcf.Writer().

@gotgenes gotgenes pushed a commit to gotgenes/PyVCF that referenced this pull request May 13, 2014

@jamescasbon jamescasbon Merge pull request #139 from azalea/master
Changed the default line ending in vcf.Writer() to '\n'.
2ad06b6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment