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
orfloat
). Tokens interpreted as branch lengths will be cast to this type. Defaults tofloat
.suppress_edge_lengths (boolean, default:
False
) – IfTrue
, edge length values will not be processed. IfFalse
, edge length values will be processed.extract_comment_metadata (boolean, default:
True
) – IfTrue
(default), any comments that begin with ‘&’ or ‘&&’ will be parsed and stored as part of the annotation set of the corresponding object (accessible through theannotations
attribute of the object). This requires that the comment contents conform to a particular format (NHX or BEAST: ‘field = value’). IfFalse
, then the comments will not be parsed, but will be instead stored directly as elements of thecomments
list attribute of the associated object.store_tree_weights (boolean, default:
False
) – IfTrue
, process the tree weight (e.g. “[&W 1/2]”) comment associated with each tree, if any. Defaults toFalse
.encode_splits (boolean, default:
False
) – IfTrue
, 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
) – IfTrue
, 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
) – IfTrue
, unquoted underscores in labels will not converted to spaces. Defaults toFalse
: all underscores not protected by quotes will be converted to spaces.suppress_internal_node_taxa (boolean, default:
True
) – IfFalse
, internal node labels will be instantantiated intoTaxon
objects. IfTrue
, internal node labels will not be instantantiated as strings.suppress_leaf_node_taxa (boolean, default:
False
) – IfFalse
, leaf (external) node labels will be instantantiated intoTaxon
objects. IfTrue
, leaff (external) node labels will not be instantantiated as strings.terminating_semicolon_required (boolean, default:
True
) – IfTrue
[default], then a tree statement that does not end in a semi-colon is an error. IfFalse
, 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 toFalse
.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 ifautomatically_create_missing_taxa_blocks
isTrue
a new taxon namespace will be created, otherwise an error is raised. Default isFalse
: 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. IfFalse
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 toTrue
: character data will be read.exclude_trees (bool) – If
False
, then tree data will not be read. Defaults toTrue
: 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 toFalse
: 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
) – IfTrue
, then unsupported or unrecognized keyword arguments will not result in an error. Default isFalse
: unsupported keyword arguments will result in an error.
Supported Methods¶
Tree.get
¶
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
¶
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
¶
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
¶
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
¶
d = dendropy.DnaCharacterMatrix.get(
path="data.fas",
schema="nexus",
label=None,
taxon_namespace=None,
matrix_offset=None,
ignore_unrecognized_keyword_arguments=False,
)
RnaCharacterMatrix.get
¶
d = dendropy.DnaCharacterMatrix.get(
path="data.fas",
schema="nexus",
label=None,
taxon_namespace=None,
matrix_offset=None,
ignore_unrecognized_keyword_arguments=False,
)
ProteinCharacterMatrix.get
¶
d = dendropy.ProteinCharacterMatrix.get(
path="data.fas",
schema="nexus",
label=None,
taxon_namespace=None,
matrix_offset=None,
ignore_unrecognized_keyword_arguments=False,
)
RestrictionSitesCharacterMatrix.get
¶
d = dendropy.RestrictionSitesCharacterMatrix.get(
path="data.fas",
schema="nexus",
label=None,
taxon_namespace=None,
matrix_offset=None,
ignore_unrecognized_keyword_arguments=False,
)
InfiniteSitesCharacterMatrix.get
¶
d = dendropy.InfiniteSitesCharacterMatrix.get(
path="data.fas",
schema="nexus",
label=None,
taxon_namespace=None,
matrix_offset=None,
ignore_unrecognized_keyword_arguments=False,
)
StandardCharacterMatrix.get
¶
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
¶
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
¶
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
) – IfTrue
, 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
) – IfTrue
, 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
) – IfTrue
, then when writingDataSet
objects, anyTaxonNamespace
object in the DataSet’staxon_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
) – IfTrue
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. IfFalse
, then the ‘TITLE’ element will always be written. Default isNone
: 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 isTrue
: 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., aStateIdentity
instance) and returns the string representation of it.suppress_leaf_taxon_labels (boolean, default:
False
) – IfTrue
, then taxon labels will not be rendered for leaves. Default isFalse
: render leaf taxon labels. See notes below for details.suppress_leaf_node_labels (boolean, default:
True
) – IfFalse
, then node labels (if available) will be printed for leaves. Defaults toTrue
: do not render leaf node labels. See notes below for details.suppress_internal_taxon_labels (boolean, default:
False
) – IfTrue
, then taxon labels will not be printed for internal nodes. Default isFalse
: print taxon labels for internal nodes. See notes below for details.suppress_internal_node_labels (boolean, default:
False
) – IfTrue
, then node labels will not be printed for internal nodes. Default isFalse
: print node labels for internal nodes. See notes below for details.suppress_rooting (boolean, default:
False
) – IfTrue
, will not write rooting token (‘[&R]’ or ‘[&U]’). Default isFalse
: rooting token will be written.suppress_edge_lengths (boolean, default:
False
) – IfTrue
, will not write edge lengths. Default isFalse
: edge lengths will be written.unquoted_underscores (boolean, default:
False
) – IfTrue
, labels with underscores will not be quoted, which will mean that they will be interpreted as spaces if read again (“soft” underscores). IfFalse
, then labels with underscores will be quoted, resulting in “hard” underscores. Default isFalse
.preserve_spaces (boolean, default:
False
) – IfTrue
, spaces will not be replaced with underscores in labels (which means any labels containing spaces will have to be quoted). Default isFalse
: spaces will be converted to underscores. False.store_tree_weights (boolean, default:
False
) – IfTrue
, tree weights are written. Default isFalse
: tree weights will not be written.translate_tree_taxa (boolean or dict or
None
, default:None
.) – IfFalse
orNone
, then a “TRANSLATE” statement will not be used, and tree statements will contain the full taxon labels. If notFalse
orNone
, a “TRANSLATE” statement will be written and referenced in tree statements (instead of using the taxon labels). IfTrue
, then a default translate statement will be used, with tokens given by the taxon indexes. If a dictionary is given, then the keys should beTaxon
objects and the values should be the token (strings).suppress_annotations (boolean, default:
False
) – IfTrue
, metadata annotations will be ignored. Defaults toFalse
: metadata annotations will be written.annotations_as_nhx (boolean, default:
False
) – IfTrue
, and ifsuppress_annotations
isFalse
, will write annotations as NHX statements. Default isFalse
: annotations will not be written as NHX statements.suppress_item_comments (boolean, default:
False
) – IfTrue
: comments will be ignored. Default isFalse
: any additional comments associated with trees, nodes, edges, etc. will be written.node_label_element_separator (string, default: ' ') – If both
suppress_leaf_taxon_labels
andsuppress_leaf_node_labels
areFalse
, then this will be the string used to join them. Defaults to ‘ ‘ (space).node_label_compose_fn (function object or
None
, default:None
) – If notNone
, should be a function that takes aNode
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, ignoringsuppress_leaf_taxon_labels
,suppress_leaf_node_labels=True
,suppress_internal_taxon_labels
,suppress_internal_node_labels
, etc. Defaults toNone
.edge_label_compose_fn (function object or
None
, default:None
) – If notNone
, 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, anyTaxon
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
) – IfTrue
, then unsupported or unrecognized keyword arguments will not result in an error. Default isFalse
: unsupported keyword arguments will result in an error.
Supported Methods¶
Tree.write
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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,
)