Skip to content

Commit 8e86f81

Browse files
committed
Update misc.jl
Argument reindex added to make_edge_label
1 parent 6428965 commit 8e86f81

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/misc.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,13 +278,17 @@ This function is only used for pretty plotting of the network with PhyloPlots.
278278
- `false`: Excludes terminal edges, hybrid edges with one leaf descendant,
279279
and terminal edges with parent the root.
280280
- `true`: Includes all edges.
281+
- `reindex` : A boolean flag (default = `true`) that reindexes the edge numbers consecutively.
281282
282283
## Returns
283284
- A `DataFrame` with columns:
284285
- `number`: Edge numbers.
285286
- `label`: Corresponding symbolic labels (`"t1, γ = g1"`).
286287
"""
287-
function make_edge_label(net::PhyloNetworks.HybridNetwork; showAllEdgeLabels::Bool=false)
288+
function make_edge_label(network::PhyloNetworks.HybridNetwork; showAllEdgeLabels::Bool=false, reindex::Bool=true)
289+
290+
net=deepcopy(network)
291+
if(reindex) reindex_edges(net) end
288292

289293
# get internal edge numbers unless want all edges labeled
290294
edge_numbers_to_include = [e.number for e in net.edge if !PhyloNetworks.getchild(e).leaf || showAllEdgeLabels]

0 commit comments

Comments
 (0)