PandasΒΆ

[1]:
import pandas as pd
[2]:
df = pd.read_csv("https://raw.githubusercontent.com/nextstrain/ncov/fe5a7ed1f92af63d6d1d43d0307e4b2620108aaa/data/metadata.tsv", sep = '\t')
[3]:
from ipycytoscape import *
[4]:
df.columns
[4]:
Index(['strain', 'virus', 'gisaid_epi_isl', 'genbank_accession', 'date',
       'region', 'country', 'division', 'location', 'region_exposure',
       'country_exposure', 'division_exposure', 'segment', 'length', 'host',
       'age', 'sex', 'originating_lab', 'submitting_lab', 'authors', 'url',
       'title', 'date_submitted'],
      dtype='object')
[5]:
cytoscapeobj = CytoscapeWidget()
cytoscapeobj.set_tooltip_source('name')
[6]:
cytoscapeobj.graph.add_graph_from_df(df[:30], ['country'], ['age', 'virus'])
[7]:
cytoscapeobj
[ ]: