pylogeny.JSONWriter module
Serialize a phylogenetic landscape into a JSON object.
-
class pylogeny.JSONWriter.JSONWriter(ls, name)[source]
Bases: pylogeny.landscapeWriter.landscapeWriter
Writes a landscape and associated node information to a JSON
object.
-
__init__(ls, name)[source]
Instantiates this writer.
| Parameters: |
- ls (a landscape.landscape object) – a landscape object
- name (a string) – the name of this landscape
|
-
getCompleteLandscape()[source]
Returns the landscape as a JSON string.
-
getJSON()[source]
Returns the landscape as a JSON string.
-
getOnlyImprovements(groups=None)[source]
-
nodeToJSON(node)[source]
Returns a JSON formatted node, given a node ID.
| Parameters: | node (a string) – a name of a tree/node in the graph |