Intro Event Count

Hello,
I need to get the number of introductory events, I see that this is usually done with custom scripts and I don’t know this field, could someone who has done this give me an idea on how to do it?

David

Have you found a script that does this? I’m sure there are some out there. Anything in particular you don’t understand?

Roughly speaking, I’d using Augur tools, I’d run Augur traits, then count the number of transitions in the Auspice.json, after parsing the json into a dict (in a Python script)

I found this on the forum but I don’t know python so I had no idea how to use it

Although I already solved it with chatgpt, I will also do it for augur traits and I will compare if the results are the same

Thank you so much
Greetings from Colombia

You should check out this R-package: GitHub - magnusnosnes/LineageHomology: LineageHomology uses phylogenies with reconstructed ancestral states to define groups of phylogenetic tips that have gained their states through homologous inheritance or de novo acquisition. LineageHomology can be applied to pathogen phylogeography to define transmission lineages and singletons and derive simple estimates of importation and local transmission (without regard to missing data).

If you can recode your country states to only two - e.g. all other countries to “Other” or something like that, you can input your time dated phylogeny from NextStrain.