Open pnrobinson opened 6 years ago
This doesn't help you much right now, but I'm thinking we should use seaborn rather than plotly. Seems to be the most popular choice for data science in python - and doesn't require use of a server. Thoughts @kltm @kshefchek?
@cmungall @kltm @kshefchek Here is an alternative that works with Seaborn thanks to my colleague @adeslatt https://github.com/TheJacksonLaboratory/robinson-lab-notebooks/blob/master/Linked_Data_Biolink.ipynb
from ontobio.assoc_factory import AssociationSetFactory
afactory = AssociationSetFactory()
HUMAN='NCBITaxon:9606'
aset=afactory.create(ontology=ont, subject_category='disease',object_category='phenotype',taxon=HUMAN)
[t]=ont.search('Nephroblastoma')
diseases=aset.query([t])
dlabels = ["{} '{}'".format(d, aset.label(d)) for d in diseases]
z, xlabels, ylabels = aset.similarity_matrix(diseases, diseases)
import seaborn as sns
import numpy as np
import pandas as pd
sns.set(color_codes=True)
zarray = np.array(z)
zarray_df = pd.DataFrame(zarray, columns=dlabels, index=dlabels)
cm = sns.clustermap(zarray_df, method="average",metric="Euclid")
When I run this code in my own notebook, http://nbviewer.jupyter.org/github/biolink/ontobio/blob/master/notebooks/Mouse_Gene_Phenotypes.ipynb
leads to the following error message
The notebook should explain how to set this up correctly