cerebis / meta-sweeper

Parametric sweep of simulated microbial communities and metagenomic sequencing.
GNU General Public License v3.0
10 stars 0 forks source link

Reconsider TruthTable serialized format #7

Closed cerebis closed 8 years ago

cerebis commented 8 years ago

The class TruthTable is serialized to disk using YAML. This mapping to text is possibly not ideal as it currently contains implementation details in the form of class references.

E.g.

scaffold_0: !Assignment {mapping: {A: 0.994, B: 0.991, C: 0.987, D: 0.985}, weight: 2226}
scaffold_1: !Assignment {mapping: {A: 0.993, B: 0.994, C: 0.990, D: 0.988}, weight: 2202}

The class Assignment is confounding to tools which may not wish to adopt our particular codebase.

A better version would be plain mapping, with the details for instantiation contained in our codebase.

E.g. without class type references

scaffold_0: {mapping: {A: 0.994, B: 0.991, C: 0.987, D: 0.985}, weight: 2226}
scaffold_1: {mapping: {A: 0.993, B: 0.994, C: 0.990, D: 0.988}, weight: 2202}

and further without member variable references.

scaffold_0: { {A: 0.994, B: 0.991, C: 0.987, D: 0.985}, 2226 } 
scaffold_1: { {A: 0.993, B: 0.994, C: 0.990, D: 0.988}, 2202 }

or lastly as a table

scaffold_0 2226 A:0.994 B:0.991 C:0.987 D:0.985
scaffold_1 2202 A:0.993 B:0.994 C:0.990 D:0.988
cerebis commented 8 years ago

With a little experimentation, I've decided to go with the first example.

scaffold_0: {mapping: {A: 0.994, B: 0.991, C: 0.987, D: 0.985}, weight: 2226}
scaffold_1: {mapping: {A: 0.993, B: 0.994, C: 0.990, D: 0.988}, weight: 2202}