Export transmission lines

Hi,

I performed an analysis of Armenian sequences along with ~ 9000 background sequences. In auspice I have transmission lines visualization, however, I would like to export them for every clade and lineage. For example, I see B.1.1.163 transmission from Russia to Armenia around September 2020.
Is there a way to obtain a spreadsheet where I will have “from country” “to country” “lineage”, “clade”, “date” columns?

Any help is greatly appreciated.

Sincerely,

Arsen

To get this information you’ll have to parse this out of the dataset JSON or the node-data JSON produced from augur traits. Something like the following should work

# pseudocode
def recurse(node, parentState=None):
    state = node.get("node_attrs", {}).get("country", {}).get("value", None)
    if state and parentState and state != parentState:
        print(f"Transition from {parentState} to {state}")
    for child in node.get("children", []):
        recurse(child, state)

recurse(jsonContents["tree"])

Dear james,

Thank you very much.

Sincerely,

Arsen

Hi James,
I am trying to export similar data as in the above query (to and from data etc.) something similar to how the old mesquite and MacClade programs give out a migration matrix. Could you please help with how I can extract that information from the traits json/traits.mugration_model.txt.
Thanks,
LC

I’m not familiar with the format of mesquite / MacClade, but the *.mugration_model.txt has the migration matrix you’re after. For instance, here’s the output from the zika tutorial:

Map from character to field name
A:	North America
B:	Oceania
C:	South America
D:	Southeast Asia
E:	?


Substitution rate (mu): 97.422118

Equilibrium frequencies (pi_i):
  A: 0.3149
  B: 0.2451
  C: 0.2159
  D: 0.2241

Symmetrized rates from j->i (W_ij):
	A	B	C	D
  A	0	0.8828	2.7937	0.8633
  B	0.8828	0	1.2785	1.3023
  C	2.7937	1.2785	0	0.8635
  D	0.8633	1.3023	0.8635	0

Actual rates from j->i (Q_ij):
	A	B	C	D
  A	0	0.278	0.8798	0.2719
  B	0.2164	0	0.3133	0.3192
  C	0.6033	0.2761	0	0.1865
  D	0.1934	0.2918	0.1935	0