Newick¶
Description¶
Reading¶
Schema-Specific Keyword Arguments¶
Supported Methods¶
Tree.get
¶
tree = dendropy.Tree.get(
path="tree.tre",
schema="newick",
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="newick",
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="newick",
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="newick",
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,
)
DataSet.get
¶
data_set = dendropy.DataSet.get(
path="path/to/file",
schema="newick",
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="newick",
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¶
Supported Methods¶
Tree.write
¶
d.write(
path='outputfile.tre',
schema='newick',
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,
taxon_token_map=None,
suppress_annotations=True,
annotations_as_nhx=False,
suppress_item_comments=True,
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='newick',
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,
taxon_token_map=None,
suppress_annotations=True,
annotations_as_nhx=False,
suppress_item_comments=True,
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='outputfile.tre',
schema='newick',
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,
taxon_token_map=None,
suppress_annotations=True,
annotations_as_nhx=False,
suppress_item_comments=True,
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='newick',
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,
taxon_token_map=None,
suppress_annotations=True,
annotations_as_nhx=False,
suppress_item_comments=True,
node_label_element_separator=' ',
node_label_compose_fn=None,
edge_label_compose_fn=None,
real_value_format_specifier='',
ignore_unrecognized_keyword_arguments=False,
)
DataSet.write
¶
d.write(
path='outputfile.tre',
schema='newick',
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,
taxon_token_map=None,
suppress_annotations=True,
annotations_as_nhx=False,
suppress_item_comments=True,
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='newick',
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,
taxon_token_map=None,
suppress_annotations=True,
annotations_as_nhx=False,
suppress_item_comments=True,
node_label_element_separator=' ',
node_label_compose_fn=None,
edge_label_compose_fn=None,
real_value_format_specifier='',
ignore_unrecognized_keyword_arguments=False,
)