NEXUS

Description

Reading

Schema-Specific Keyword Arguments

NexusReader.__init__(**kwargs)[source]
Keyword Arguments:
  • rooting (string, {['default-unrooted'], 'default-rooted', 'force-unrooted', 'force-rooted'}) –

    Specifies how trees in the data source should be intepreted with respect to their rooting:

    ’default-unrooted’ [default]:

    All trees are interpreted as unrooted unless a ‘[&R]’ comment token explicitly specifies them as rooted.

    ’default-rooted’

    All trees are interpreted as rooted unless a ‘[&U]’ comment token explicitly specifies them as unrooted.

    ’force-unrooted’

    All trees are unconditionally interpreted as unrooted.

    ’force-rooted’

    All trees are unconditionally interpreted as rooted.

  • edge_length_type (type, default: float) – Specifies the type of the edge lengths (int or float). Tokens interpreted as branch lengths will be cast to this type. Defaults to float.

  • suppress_edge_lengths (boolean, default: False) – If True, edge length values will not be processed. If False, edge length values will be processed.

  • extract_comment_metadata (boolean, default: True) – If True (default), any comments that begin with ‘&’ or ‘&&’ will be parsed and stored as part of the annotation set of the corresponding object (accessible through the annotations attribute of the object). This requires that the comment contents conform to a particular format (NHX or BEAST: ‘field = value’). If False, then the comments will not be parsed, but will be instead stored directly as elements of the comments list attribute of the associated object.

  • store_tree_weights (boolean, default: False) – If True, process the tree weight (e.g. “[&W 1/2]”) comment associated with each tree, if any. Defaults to False.

  • encode_splits (boolean, default: False) – If True, split hash bitmasks will be calculated and attached to the edges.

  • finish_node_fn (function object, default: None) – If specified, this function will be applied to each node after it has been constructed.

  • case_sensitive_taxon_labels (boolean, default: False) – If True, then taxon labels are case sensitive (e.g., “P.regius” and “P.REGIUS” wil be treated as different operation taxonomic unit concepts). Otherwise, taxon label intepretation will be made without regard for case.

  • preserve_underscores (boolean, default: False) – If True, unquoted underscores in labels will not converted to spaces. Defaults to False: all underscores not protected by quotes will be converted to spaces.

  • suppress_internal_node_taxa (boolean, default: True) – If False, internal node labels will be instantantiated into Taxon objects. If True, internal node labels will not be instantantiated as strings.

  • suppress_leaf_node_taxa (boolean, default: False) – If False, leaf (external) node labels will be instantantiated into Taxon objects. If True, leaff (external) node labels will not be instantantiated as strings.

  • terminating_semicolon_required (boolean, default: True) – If True [default], then a tree statement that does not end in a semi-colon is an error. If False, then no error will be raised.

  • unconstrained_taxa_accumulation_mode (bool) – If True, then no error is raised even if the number of taxon names defined exceeds the number of declared taxa (as specified by ‘NTAX’). Defaults to False.

  • automatically_substitute_missing_taxa_blocks (bool) – If True then, if a taxon namespace is linked to by title but is not given in the data file, then, if one and exactly one other taxon namespace has been given in the data file, this taxon namespace will be used; if there are multiple taxon namespaces, then if automatically_create_missing_taxa_blocks is True a new taxon namespace will be created, otherwise an error is raised. Default is False: if a taxon namespace is linked to by title but is not given in the data file, then an error is raised.

  • automatically_create_missing_taxa_blocks (bool) – If True then taxon namespaces linked to by title but not given in the data file will be automatically created. If False taxon namespaces linked to by title but not given in the data file will result in error.

  • exclude_chars (bool) – If False, then character data will not be read. Defaults to True: character data will be read.

  • exclude_trees (bool) – If False, then tree data will not be read. Defaults to True: tree data will be read.

  • store_ignored_blocks (bool) – If True, then ignored NEXUS blocks will be stored under the annotation (NOT attribute!) ignored_nexus_blocks''. To dereference, for e.g.: ``dataset.annotations["ignored_nexus_blocks"]. Defaults to False: non-character and tree blocks will not be read.

  • attached_taxon_namespace (TaxonNamespace) – Unify all operational taxonomic unit definitions in this namespace.

  • ignore_unrecognized_keyword_arguments (boolean, default: False) – If True, then unsupported or unrecognized keyword arguments will not result in an error. Default is False: unsupported keyword arguments will result in an error.

Supported Methods

Tree.get

(method reference)

tree = dendropy.Tree.get(
    path="tree.tre",
    schema="nexus",
    label=None,
    taxon_namespace=None,
    collection_offset=None,
    tree_offset=None,
    rooting="default-unrooted",
    edge_length_type=float,
    suppress_edge_lengths=False,
    extract_comment_metadata=True,
    store_tree_weights=False,
    encode_splits=False,
    finish_node_fn=None,
    case_sensitive_taxon_labels=False,
    preserve_underscores=False,
    suppress_internal_node_taxa=True,
    suppress_leaf_node_taxa=False,
    terminating_semicolon_required=True,
    ignore_unrecognized_keyword_arguments=False,
    )


TreeList.get

(method reference)

tree_list = dendropy.TreeList.get(
    path="path/to/file",
    schema="nexus",
    label=None,
    taxon_namespace=None,
    collection_offset=None,
    tree_offset=None,
    rooting="default-unrooted",
    edge_length_type=float,
    suppress_edge_lengths=False,
    extract_comment_metadata=True,
    store_tree_weights=False,
    encode_splits=False,
    finish_node_fn=None,
    case_sensitive_taxon_labels=False,
    preserve_underscores=False,
    suppress_internal_node_taxa=True,
    suppress_leaf_node_taxa=False,
    terminating_semicolon_required=True,
    ignore_unrecognized_keyword_arguments=False,
    )

TreeList.read

(method reference)

tree_list = dendropy.TreeList()
tree_list.read(
    path="path/to/file",
    schema="nexus",
    collection_offset=None,
    tree_offset=None,
    rooting="default-unrooted",
    edge_length_type=float,
    suppress_edge_lengths=False,
    extract_comment_metadata=True,
    store_tree_weights=False,
    encode_splits=False,
    finish_node_fn=None,
    case_sensitive_taxon_labels=False,
    preserve_underscores=False,
    suppress_internal_node_taxa=True,
    suppress_leaf_node_taxa=False,
    terminating_semicolon_required=True,
    ignore_unrecognized_keyword_arguments=False,
    )

TreeArray.read

(method reference)

tree_array = dendropy.TreeArray()
tree_array.read(
    path="path/to/file",
    schema="nexus",
    label=None,
    collection_offset=None,
    tree_offset=None,
    rooting="default-unrooted",
    edge_length_type=float,
    suppress_edge_lengths=False,
    extract_comment_metadata=True,
    store_tree_weights=False,
    encode_splits=False,
    finish_node_fn=None,
    case_sensitive_taxon_labels=False,
    preserve_underscores=False,
    suppress_internal_node_taxa=True,
    suppress_leaf_node_taxa=False,
    terminating_semicolon_required=True,
    ignore_unrecognized_keyword_arguments=False,
    )

DnaCharacterMatrix.get

(method reference)

d = dendropy.DnaCharacterMatrix.get(
        path="data.fas",
        schema="nexus",
        label=None,
        taxon_namespace=None,
        matrix_offset=None,
        ignore_unrecognized_keyword_arguments=False,
        )

RnaCharacterMatrix.get

(method reference)

d = dendropy.DnaCharacterMatrix.get(
        path="data.fas",
        schema="nexus",
        label=None,
        taxon_namespace=None,
        matrix_offset=None,
        ignore_unrecognized_keyword_arguments=False,
        )

ProteinCharacterMatrix.get

(method reference)

d = dendropy.ProteinCharacterMatrix.get(
        path="data.fas",
        schema="nexus",
        label=None,
        taxon_namespace=None,
        matrix_offset=None,
        ignore_unrecognized_keyword_arguments=False,
        )

RestrictionSitesCharacterMatrix.get

(method reference)

d = dendropy.RestrictionSitesCharacterMatrix.get(
        path="data.fas",
        schema="nexus",
        label=None,
        taxon_namespace=None,
        matrix_offset=None,
        ignore_unrecognized_keyword_arguments=False,
        )

InfiniteSitesCharacterMatrix.get

(method reference)

d = dendropy.InfiniteSitesCharacterMatrix.get(
        path="data.fas",
        schema="nexus",
        label=None,
        taxon_namespace=None,
        matrix_offset=None,
        ignore_unrecognized_keyword_arguments=False,
        )

StandardCharacterMatrix.get

(method reference)

d = dendropy.StandardCharacterMatrix.get(
        path="data.fas",
        schema="nexus",
        label=None,
        taxon_namespace=None,
        matrix_offset=None,
        ignore_unrecognized_keyword_arguments=False,
        default_state_alphabet=None,
        )

d = dendropy.StandardCharacterMatrix.get(
        path="data.fas",
        schema="nexus",
        label=None,
        taxon_namespace=None,
        matrix_offset=None,
        ignore_unrecognized_keyword_arguments=False,
        default_state_alphabet=dendropy.new_standard_state_alphabet("0123456789"),
        )

DataSet.get

(method reference)

data_set = dendropy.DataSet.get(
    path="path/to/file",
    schema="nexus",
    label=None,
    taxon_namespace=None,
    exclude_chars=False,
    exclude_trees=False,
    rooting="default-unrooted",
    edge_length_type=float,
    suppress_edge_lengths=False,
    extract_comment_metadata=True,
    store_tree_weights=False,
    encode_splits=False,
    finish_node_fn=None,
    case_sensitive_taxon_labels=False,
    preserve_underscores=False,
    suppress_internal_node_taxa=True,
    suppress_leaf_node_taxa=False,
    terminating_semicolon_required=True,
    ignore_unrecognized_keyword_arguments=False,
    )



DataSet.read

(method reference)

data_set = dendropy.DataSet()
data_set.read(
    path="path/to/file",
    schema="nexus",
    exclude_chars=False,
    exclude_trees=False,
    rooting="default-unrooted",
    edge_length_type=float,
    suppress_edge_lengths=False,
    extract_comment_metadata=True,
    store_tree_weights=False,
    encode_splits=False,
    finish_node_fn=None,
    case_sensitive_taxon_labels=False,
    preserve_underscores=False,
    suppress_internal_node_taxa=True,
    suppress_leaf_node_taxa=False,
    terminating_semicolon_required=True,
    ignore_unrecognized_keyword_arguments=False,
    )



Writing

Schema-Specific Keyword Arguments

NexusWriter.__init__(**kwargs)[source]
Keyword Arguments:
  • simple (boolean, default: False) – If True, write in simple NEXUS format, i.e. in a single “DATA” block, instead of separate “TAXA” and “CHARACTER” blocks.

  • suppress_taxa_blocks (boolean, default: False) – If True, do not write a “TAXA” block. Note that this may make the file impossible to parse if there are multiple taxon namespaces in the data.

  • suppress_unreferenced_taxon_namespaces (boolean, default: False) – If True, then when writing DataSet objects, any TaxonNamespace object in the DataSet’s taxon_namespaces collection will not be written as a “TAXA” block if it is not referenced by any character matrix (char_matrices) or tree list (tree_lists).

  • suppress_block_titles (bool or None) – If True then ‘TITLE’ element to blocks will not be written. Note that this may make the file impossible to parse if there are multiple taxon namespaces in the data. If False, then the ‘TITLE’ element will always be written. Default is None: the ‘TITLE’ element will only be written if needed because there is more than on taxon namespace in the data.

  • file_comments (iterable [str]) – List of lines of text to be added as comments to the file.

  • preamble_blocks (iterable [str]) – List of strings to be written before data (e.g., PAUP blocks suppressing warnings etc.).

  • supplemental_blocks (iterable [str]) – List of strings to be written after data (e.g., PAUP blocks, MrBayes blocks etc.).

  • allow_multiline_comments (bool) – If False then comments will be merged into a single string before being written. Default is True: each comment element will be written on its own line.

  • continuous_character_state_value_format_fn (function object) – When writing ContinuousCharacterMatrix data: a function that takes a continuous character value and returns the string representation of it.

  • discrete_character_state_value_format_fn (function object) – When writing discrete character data (e.g., a StandardCharacterMatrix): a function that takes a standard character state value (i.e., a StateIdentity instance) and returns the string representation of it.

  • suppress_leaf_taxon_labels (boolean, default: False) – If True, then taxon labels will not be rendered for leaves. Default is False: render leaf taxon labels. See notes below for details.

  • suppress_leaf_node_labels (boolean, default: True) – If False, then node labels (if available) will be printed for leaves. Defaults to True: do not render leaf node labels. See notes below for details.

  • suppress_internal_taxon_labels (boolean, default: False) – If True, then taxon labels will not be printed for internal nodes. Default is False: print taxon labels for internal nodes. See notes below for details.

  • suppress_internal_node_labels (boolean, default: False) – If True, then node labels will not be printed for internal nodes. Default is False: print node labels for internal nodes. See notes below for details.

  • suppress_rooting (boolean, default: False) – If True, will not write rooting token (‘[&R]’ or ‘[&U]’). Default is False: rooting token will be written.

  • suppress_edge_lengths (boolean, default: False) – If True, will not write edge lengths. Default is False: edge lengths will be written.

  • unquoted_underscores (boolean, default: False) – If True, labels with underscores will not be quoted, which will mean that they will be interpreted as spaces if read again (“soft” underscores). If False, then labels with underscores will be quoted, resulting in “hard” underscores. Default is False.

  • preserve_spaces (boolean, default: False) – If True, spaces will not be replaced with underscores in labels (which means any labels containing spaces will have to be quoted). Default is False: spaces will be converted to underscores. False.

  • store_tree_weights (boolean, default: False) – If True, tree weights are written. Default is False: tree weights will not be written.

  • translate_tree_taxa (boolean or dict or None, default: None.) – If False or None, then a “TRANSLATE” statement will not be used, and tree statements will contain the full taxon labels. If not False or None, a “TRANSLATE” statement will be written and referenced in tree statements (instead of using the taxon labels). If True, then a default translate statement will be used, with tokens given by the taxon indexes. If a dictionary is given, then the keys should be Taxon objects and the values should be the token (strings).

  • suppress_annotations (boolean, default: False) – If True, metadata annotations will be ignored. Defaults to False: metadata annotations will be written.

  • annotations_as_nhx (boolean, default: False) – If True, and if suppress_annotations is False, will write annotations as NHX statements. Default is False: annotations will not be written as NHX statements.

  • suppress_item_comments (boolean, default: False) – If True: comments will be ignored. Default is False: any additional comments associated with trees, nodes, edges, etc. will be written.

  • node_label_element_separator (string, default: ' ') – If both suppress_leaf_taxon_labels and suppress_leaf_node_labels are False, then this will be the string used to join them. Defaults to ‘ ‘ (space).

  • node_label_compose_fn (function object or None, default: None) – If not None, should be a function that takes a Node object as an argument and returns the string to be used to represent the node in the tree statement. The return value from this function is used unconditionally to print a node representation in a tree statement, by-passing the default labelling function, ignoring suppress_leaf_taxon_labels, suppress_leaf_node_labels=True, suppress_internal_taxon_labels, suppress_internal_node_labels, etc. Defaults to None.

  • edge_label_compose_fn (function object or None, default: None) – If not None, should be a function that takes an Edge object as an argument, and returns the string to be used to represent the edge length in the tree statement.

  • real_value_format_specifier (string, default: '') – Format specification for real/float values. Will be applied to edge lengths (if edge_label_compose_fn is not given) as well as annotations. The format specifier should be given in Python’s string format specification mini-language. E.g. “.8f”, “.4E”, “8.4f”.

  • exclude_from_taxa_blocks (set (or other iterable) of Taxon instances) – If specified, any Taxon object in this set will be excluded from all TAXA blocks, even if they are referenced in the data.

  • ignore_unrecognized_keyword_arguments (boolean, default: False) – If True, then unsupported or unrecognized keyword arguments will not result in an error. Default is False: unsupported keyword arguments will result in an error.

Supported Methods

Tree.write

(method reference)

d.write(
        path='trees.nex',
        schema='nexus',
        suppress_taxa_blocks=None,
        suppress_block_titles=None,
        file_comments=[],
        preamble_blocks=[],
        supplemental_blocks=[],
        allow_multiline_comments=True,
        suppress_leaf_taxon_labels=False,
        suppress_leaf_node_labels=True,
        suppress_internal_taxon_labels=False,
        suppress_internal_node_labels=False,
        suppress_rooting=False,
        suppress_edge_lengths=False,
        unquoted_underscores=False,
        preserve_spaces=False,
        store_tree_weights=False,
        translate_tree_taxa=None,
        suppress_annotations=False,
        annotations_as_nhx=False,
        suppress_item_comments=False,
        node_label_element_separator=' ',
        node_label_compose_fn=None,
        edge_label_compose_fn=None,
        real_value_format_specifier='',
        ignore_unrecognized_keyword_arguments=False,
        )

Tree.as_string

(method reference)

s = d.as_string(
        schema='nexus',
        suppress_taxa_blocks=None,
        suppress_block_titles=None,
        file_comments=[],
        preamble_blocks=[],
        supplemental_blocks=[],
        allow_multiline_comments=True,
        suppress_leaf_taxon_labels=False,
        suppress_leaf_node_labels=True,
        suppress_internal_taxon_labels=False,
        suppress_internal_node_labels=False,
        suppress_rooting=False,
        suppress_edge_lengths=False,
        unquoted_underscores=False,
        preserve_spaces=False,
        store_tree_weights=False,
        translate_tree_taxa=None,
        suppress_annotations=False,
        annotations_as_nhx=False,
        suppress_item_comments=False,
        node_label_element_separator=' ',
        node_label_compose_fn=None,
        edge_label_compose_fn=None,
        real_value_format_specifier='',
        ignore_unrecognized_keyword_arguments=False,
        )

TreeList.write

(method reference)

d.write(
        path='trees.nex',
        schema='nexus',
        suppress_taxa_blocks=None,
        suppress_block_titles=None,
        file_comments=[],
        preamble_blocks=[],
        supplemental_blocks=[],
        allow_multiline_comments=True,
        suppress_leaf_taxon_labels=False,
        suppress_leaf_node_labels=True,
        suppress_internal_taxon_labels=False,
        suppress_internal_node_labels=False,
        suppress_rooting=False,
        suppress_edge_lengths=False,
        unquoted_underscores=False,
        preserve_spaces=False,
        store_tree_weights=False,
        translate_tree_taxa=None,
        suppress_annotations=False,
        annotations_as_nhx=False,
        suppress_item_comments=False,
        node_label_element_separator=' ',
        node_label_compose_fn=None,
        edge_label_compose_fn=None,
        real_value_format_specifier='',
        ignore_unrecognized_keyword_arguments=False,
        )

TreeList.as_string

(method reference)

s = d.as_string(
        schema='nexus',
        suppress_taxa_blocks=None,
        suppress_block_titles=None,
        file_comments=[],
        preamble_blocks=[],
        supplemental_blocks=[],
        allow_multiline_comments=True,
        suppress_leaf_taxon_labels=False,
        suppress_leaf_node_labels=True,
        suppress_internal_taxon_labels=False,
        suppress_internal_node_labels=False,
        suppress_rooting=False,
        suppress_edge_lengths=False,
        unquoted_underscores=False,
        preserve_spaces=False,
        store_tree_weights=False,
        translate_tree_taxa=None,
        suppress_annotations=False,
        annotations_as_nhx=False,
        suppress_item_comments=False,
        node_label_element_separator=' ',
        node_label_compose_fn=None,
        edge_label_compose_fn=None,
        real_value_format_specifier='',
        ignore_unrecognized_keyword_arguments=False,
        )

DnaCharacterMatrix.write

(method reference)

d.write(
        path='chars.nex',
        schema='nexus',
        simple=False,
        suppress_taxa_blocks=None,
        suppress_block_titles=None,
        file_comments=[],
        preamble_blocks=[],
        supplemental_blocks=[],
        allow_multiline_comments=True,
        continuous_character_state_value_format_fn=None,
        discrete_character_state_value_format_fn=None,
        unquoted_underscores=False,
        preserve_spaces=False,
        suppress_annotations=False,
        annotations_as_nhx=False,
        suppress_item_comments=False,
        real_value_format_specifier='',
        ignore_unrecognized_keyword_arguments=False,
        )

DnaCharacterMatrix.as_string

(method reference)

s = d.as_string(
        schema='nexus',
        simple=False,
        suppress_taxa_blocks=None,
        suppress_block_titles=None,
        file_comments=[],
        preamble_blocks=[],
        supplemental_blocks=[],
        allow_multiline_comments=True,
        continuous_character_state_value_format_fn=None,
        discrete_character_state_value_format_fn=None,
        unquoted_underscores=False,
        preserve_spaces=False,
        suppress_annotations=False,
        annotations_as_nhx=False,
        suppress_item_comments=False,
        real_value_format_specifier='',
        ignore_unrecognized_keyword_arguments=False,
        )

RnaCharacterMatrix.write

(method reference)

d.write(
        path='chars.nex',
        schema='nexus',
        simple=False,
        suppress_taxa_blocks=None,
        suppress_block_titles=None,
        file_comments=[],
        preamble_blocks=[],
        supplemental_blocks=[],
        allow_multiline_comments=True,
        continuous_character_state_value_format_fn=None,
        discrete_character_state_value_format_fn=None,
        unquoted_underscores=False,
        preserve_spaces=False,
        suppress_annotations=False,
        annotations_as_nhx=False,
        suppress_item_comments=False,
        real_value_format_specifier='',
        ignore_unrecognized_keyword_arguments=False,
        )

RnaCharacterMatrix.as_string

(method reference)

s = d.as_string(
        schema='nexus',
        simple=False,
        suppress_taxa_blocks=None,
        suppress_block_titles=None,
        file_comments=[],
        preamble_blocks=[],
        supplemental_blocks=[],
        allow_multiline_comments=True,
        continuous_character_state_value_format_fn=None,
        discrete_character_state_value_format_fn=None,
        unquoted_underscores=False,
        preserve_spaces=False,
        suppress_annotations=False,
        annotations_as_nhx=False,
        suppress_item_comments=False,
        real_value_format_specifier='',
        ignore_unrecognized_keyword_arguments=False,
        )

ProteinCharacterMatrix.write

(method reference)

d.write(
        path='chars.nex',
        schema='nexus',
        simple=False,
        suppress_taxa_blocks=None,
        suppress_block_titles=None,
        file_comments=[],
        preamble_blocks=[],
        supplemental_blocks=[],
        allow_multiline_comments=True,
        continuous_character_state_value_format_fn=None,
        discrete_character_state_value_format_fn=None,
        unquoted_underscores=False,
        preserve_spaces=False,
        suppress_annotations=False,
        annotations_as_nhx=False,
        suppress_item_comments=False,
        real_value_format_specifier='',
        ignore_unrecognized_keyword_arguments=False,
        )

ProteinCharacterMatrix.as_string

(method reference)

s = d.as_string(
        schema='nexus',
        simple=False,
        suppress_taxa_blocks=None,
        suppress_block_titles=None,
        file_comments=[],
        preamble_blocks=[],
        supplemental_blocks=[],
        allow_multiline_comments=True,
        continuous_character_state_value_format_fn=None,
        discrete_character_state_value_format_fn=None,
        unquoted_underscores=False,
        preserve_spaces=False,
        suppress_annotations=False,
        annotations_as_nhx=False,
        suppress_item_comments=False,
        real_value_format_specifier='',
        ignore_unrecognized_keyword_arguments=False,
        )

RestrictionSitesCharacterMatrix.write

(method reference)

d.write(
        path='chars.nex',
        schema='nexus',
        simple=False,
        suppress_taxa_blocks=None,
        suppress_block_titles=None,
        file_comments=[],
        preamble_blocks=[],
        supplemental_blocks=[],
        allow_multiline_comments=True,
        continuous_character_state_value_format_fn=None,
        discrete_character_state_value_format_fn=None,
        unquoted_underscores=False,
        preserve_spaces=False,
        suppress_annotations=False,
        annotations_as_nhx=False,
        suppress_item_comments=False,
        real_value_format_specifier='',
        ignore_unrecognized_keyword_arguments=False,
        )

RestrictionSitesCharacterMatrix.as_string

(method reference)

s = d.as_string(
        schema='nexus',
        simple=False,
        suppress_taxa_blocks=None,
        suppress_block_titles=None,
        file_comments=[],
        preamble_blocks=[],
        supplemental_blocks=[],
        allow_multiline_comments=True,
        continuous_character_state_value_format_fn=None,
        discrete_character_state_value_format_fn=None,
        unquoted_underscores=False,
        preserve_spaces=False,
        suppress_annotations=False,
        annotations_as_nhx=False,
        suppress_item_comments=False,
        real_value_format_specifier='',
        ignore_unrecognized_keyword_arguments=False,
        )

InfiniteSitesCharacterMatrix.write

(method reference)

d.write(
        path='chars.nex',
        schema='nexus',
        simple=False,
        suppress_taxa_blocks=None,
        suppress_block_titles=None,
        file_comments=[],
        preamble_blocks=[],
        supplemental_blocks=[],
        allow_multiline_comments=True,
        continuous_character_state_value_format_fn=None,
        discrete_character_state_value_format_fn=None,
        unquoted_underscores=False,
        preserve_spaces=False,
        suppress_annotations=False,
        annotations_as_nhx=False,
        suppress_item_comments=False,
        real_value_format_specifier='',
        ignore_unrecognized_keyword_arguments=False,
        )

InfiniteSitesCharacterMatrix.as_string

(method reference)

s = d.as_string(
        schema='nexus',
        simple=False,
        suppress_taxa_blocks=None,
        suppress_block_titles=None,
        file_comments=[],
        preamble_blocks=[],
        supplemental_blocks=[],
        allow_multiline_comments=True,
        continuous_character_state_value_format_fn=None,
        discrete_character_state_value_format_fn=None,
        unquoted_underscores=False,
        preserve_spaces=False,
        suppress_annotations=False,
        annotations_as_nhx=False,
        suppress_item_comments=False,
        real_value_format_specifier='',
        ignore_unrecognized_keyword_arguments=False,
        )

StandardCharacterMatrix.write

(method reference)

d.write(
        path='chars.nex',
        schema='nexus',
        simple=False,
        suppress_taxa_blocks=None,
        suppress_block_titles=None,
        file_comments=[],
        preamble_blocks=[],
        supplemental_blocks=[],
        allow_multiline_comments=True,
        continuous_character_state_value_format_fn=None,
        discrete_character_state_value_format_fn=None,
        unquoted_underscores=False,
        preserve_spaces=False,
        suppress_annotations=False,
        annotations_as_nhx=False,
        suppress_item_comments=False,
        real_value_format_specifier='',
        ignore_unrecognized_keyword_arguments=False,
        )

StandardCharacterMatrix.as_string

(method reference)

s = d.as_string(
        schema='nexus',
        simple=False,
        suppress_taxa_blocks=None,
        suppress_block_titles=None,
        file_comments=[],
        preamble_blocks=[],
        supplemental_blocks=[],
        allow_multiline_comments=True,
        continuous_character_state_value_format_fn=None,
        discrete_character_state_value_format_fn=None,
        unquoted_underscores=False,
        preserve_spaces=False,
        suppress_annotations=False,
        annotations_as_nhx=False,
        suppress_item_comments=False,
        real_value_format_specifier='',
        ignore_unrecognized_keyword_arguments=False,
        )

DataSet.write

(method reference)

d.write(
        path='dataset.nex',
        schema='nexus',
        simple=False,
        suppress_taxa_blocks=None,
        suppress_unreferenced_taxon_namespaces=False,
        suppress_block_titles=None,
        file_comments=[],
        preamble_blocks=[],
        supplemental_blocks=[],
        allow_multiline_comments=True,
        continuous_character_state_value_format_fn=None,
        discrete_character_state_value_format_fn=None,
        suppress_leaf_taxon_labels=False,
        suppress_leaf_node_labels=True,
        suppress_internal_taxon_labels=False,
        suppress_internal_node_labels=False,
        suppress_rooting=False,
        suppress_edge_lengths=False,
        unquoted_underscores=False,
        preserve_spaces=False,
        store_tree_weights=False,
        translate_tree_taxa=None,
        suppress_annotations=False,
        annotations_as_nhx=False,
        suppress_item_comments=False,
        node_label_element_separator=' ',
        node_label_compose_fn=None,
        edge_label_compose_fn=None,
        real_value_format_specifier='',
        ignore_unrecognized_keyword_arguments=False,
        )

DataSet.as_string

(method reference)

s = d.as_string(
        schema='nexus',
        simple=False,
        suppress_taxa_blocks=None,
        suppress_unreferenced_taxon_namespaces=False,
        suppress_block_titles=None,
        file_comments=[],
        preamble_blocks=[],
        supplemental_blocks=[],
        allow_multiline_comments=True,
        continuous_character_state_value_format_fn=None,
        discrete_character_state_value_format_fn=None,
        suppress_leaf_taxon_labels=False,
        suppress_leaf_node_labels=True,
        suppress_internal_taxon_labels=False,
        suppress_internal_node_labels=False,
        suppress_rooting=False,
        suppress_edge_lengths=False,
        unquoted_underscores=False,
        preserve_spaces=False,
        store_tree_weights=False,
        translate_tree_taxa=None,
        suppress_annotations=False,
        annotations_as_nhx=False,
        suppress_item_comments=False,
        node_label_element_separator=' ',
        node_label_compose_fn=None,
        edge_label_compose_fn=None,
        real_value_format_specifier='',
        ignore_unrecognized_keyword_arguments=False,
        )