Correctly write meta lines with dictionary value #84

Merged
merged 2 commits into from Jan 14, 2013

Projects

None yet

2 participants

@martijnvermaat
Collaborator

Write meta lines with a dictionary-like value as

##meta=<field=value,field=value,...>

instead of as the Python dictionary string representation. This is a
fix for jamescasbon#83 and a generalization of jamescasbon#81. A
regression compared to jamescasbon#81 is that the order of fields in
a contig line is no longer defined.

The implementation still feels a bit hackish and there are probably other unknown cases not handled properly, but this should fix a bunch.

martijnvermaat added some commits Jan 10, 2013
@martijnvermaat martijnvermaat Correctly write meta lines with dictionary value
Write meta lines with a dictionary-like value as

    ##meta=<field=value,field=value,...>

instead of as the Python dictionary string representation. This is a
fix for jamescasbon#83 and a generalization of jamescasbon#81. A
regression compared to jamescasbon#81 is that the order of fields in
a `contig` line is no longer defined.
9d43fa9
@martijnvermaat martijnvermaat Preserve order in meta lines with dictionary value 1225561
@martijnvermaat
Collaborator

I think parsing values surrounded by quotes in these kind of dictionaries (e.g. "Tumor" in the unit test) would ideally make it just a Python string, without the quotes, and numerical values should also be typed as such. But that's probably opening a whole other can of worms.

It is however only by this missing functionality that we now get 100% match between input and output (quotes are only written if they were originally present).

@jamescasbon jamescasbon merged commit 9bb2a04 into jamescasbon:master Jan 14, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment