Combining phylonetworks/SNaQ runs

35 views
Skip to first unread message

Rowan Schley

unread,
May 23, 2024, 11:45:56 AMMay 23
to PhyloNetworks users
Hi there

I was wondering, how can I combine phylonetworks/SNaQ networks - is there a tool in the PhyloNetworks Julia package? I cant seem to find one.

I ask because I have one large 'backbone network' (27 taxa) and 8 'subclade networks' each consisting of between 10-15 taxa. 

For each subclade network, I used one of the 27 backbone taxa (from the same subclade as each subclade network) to 'anchor' the analysis.

Thanks
Rowan

Cécile Ané

unread,
May 23, 2024, 11:56:57 AMMay 23
to PhyloNetworks users
Hi Rowan,
Do you mean "grafting" small networks onto a larger "backbone" network? Do I understand correctly that you want to replace 1 taxon in the backbone network by 1 "subclade" network? If that's what you need, then:
1. I don't recall any dedicated function to do this in PhyloNetworks, unfortunately. But I would be happy to write one and share it as a "gist" on github to share it quickly.
2. For this, each small network needs to be correctly rooted. Can you do this confidently?
3. If you had edge lengths, then some external information is needed for the final network to also have lengths on all branches. The grafting function would need to know how long the "stem" edge should be, between the node in the backbone network and the root of the small network.

Rowan

unread,
May 23, 2024, 12:06:17 PMMay 23
to PhyloNetworks users
Hi Cecile

Thanks so much for the reply!

Yes - that's right. I would like to replace 1 taxon in the backbone with a 1 subclade network. Each subclade network is rooted with the same outgroup as the backbone network. Thanks for the offer to write a function - that would be really helpful.


Cécile Ané

unread,
Jun 4, 2024, 4:28:10 PMJun 4
to PhyloNetworks users
Hi Rowan,
I finally took the time to write a function that takes 2 networks, to add the second onto the first.
It's at this gist. Starting on line 180, it has an example with networks sharing 2 tips (one tip considered as an outgroup).
These functions require the latest version of PhyloNetworks (v0.16.4), which was released today, so make sure to run "update" in package mode first.

Over half of this file explains what the functions do and gives examples. If these explanations and examples are insufficient, please ask!
Comments via github would be the best place to ask questions or to ask for other features.
Cécile.

Rowan

unread,
Jun 5, 2024, 4:52:04 AMJun 5
to PhyloNetworks users
Wow! Thank you very much Cécile 
Best
Rowan

Reply all
Reply to author
Forward
0 new messages