create_basic_knowledgegraph

[1]:
%load_ext autoreload

import os, sys
import networkx as nx

sys.path.insert(0, "../")
sys.path.insert(0, "/home/j/joppich/.local/lib/python3.11/site-packages/")

%autoreload 2
from PICASO.kgraph import *
import pandas as pd
import numpy as np

import matplotlib
import matplotlib.pyplot as plt

from collections import defaultdict, Counter

import random
random.seed(42)

import pickle
[2]:
kg = KGraph()
[3]:
kg.load_kgraph_base("../data/", TFs=True, go=True, omnipath=True, opentargets=True, reactome=True, STRING=True, kegg=True, uniprot_loc=True, NPINTER=False)
/mnt/raidbio/extproj/projekte/regulatory_networks/scripts/../mikg/load_utils.py:492: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  subdf["score"] = subdf[use_evidences].max(axis=1)/1000
HMS:0:00:10.660940 626,136 annotations READ: ../data/goa_human.gaf
../data/go-basic.obo: fmt(1.2) rel(2023-01-01) 46,739 Terms
/mnt/raidbio/extproj/projekte/regulatory_networks/scripts/../mikg/load_utils.py:357: DtypeWarning: Columns (18) have mixed types. Specify dtype option on import or set low_memory=False.
  opd  = pd.read_csv(omnipathDB, sep="\t")
../data/uniprot_cellular_location.obo: fmt(1.2) rel(None) 563 Terms; optional_attrs(relationship xref)
Removing 14483 singletons
[4]:
for x in kg.kg.nodes:
    if len(kg.kg.nodes[x].get("type", [])) == 0:
        print(x, kg.kg.nodes[x])
[5]:
kg.get_edge_between_type()
[5]:
Counter({('gene', 'geneset'): 841157,
         ('gene', 'gene'): 344408,
         ('TF;gene', 'gene'): 95771,
         ('geneset', 'geneset'): 74634,
         ('TF;gene', 'geneset'): 74544,
         ('gene', 'disease'): 43297,
         ('gene', 'geneset;subcellular_location'): 40554,
         ('disease', 'drug'): 35017,
         ('gene', 'TF;gene'): 19994,
         ('TF;gene', 'TF;gene'): 16120,
         ('gene', 'drug'): 7899,
         ('miRNA;ncRNA', 'gene'): 7848,
         ('TF;gene', 'disease'): 5105,
         ('TF;gene', 'miRNA;ncRNA'): 2099,
         ('TF;gene', 'geneset;subcellular_location'): 2043,
         ('miRNA;ncRNA', 'TF;gene'): 1808,
         ('gene', 'disease;geneset'): 1714,
         ('geneset;subcellular_location', 'geneset;subcellular_location'): 721,
         ('gene', 'miRNA;ncRNA'): 651,
         ('geneset;subcellular_location', 'geneset'): 460,
         ('gene;lncRNA;ncRNA', 'geneset'): 444,
         ('TF;gene', 'drug'): 341,
         ('geneset', 'disease;geneset'): 200,
         ('TF;gene', 'disease;geneset'): 147,
         ('gene;lncRNA;ncRNA', 'gene'): 120,
         ('disease;geneset', 'geneset'): 95,
         ('lncRNA;ncRNA', 'gene'): 49,
         ('gene', 'gene;lncRNA;ncRNA'): 36,
         ('disease;geneset', 'drug'): 34,
         ('gene;lncRNA;ncRNA', 'TF;gene'): 33,
         ('TF;gene', 'gene;lncRNA;ncRNA'): 20,
         ('lncRNA;ncRNA', 'TF;gene'): 12,
         ('gene;lncRNA;ncRNA', 'geneset;subcellular_location'): 6,
         ('disease;geneset', 'disease;geneset'): 5,
         ('lncRNA;ncRNA', 'lncRNA;ncRNA'): 2,
         ('gene;lncRNA;ncRNA', 'disease'): 1})
[6]:
kg.get_node_types()
[6]:
Counter({'geneset': 55163,
         'gene': 41990,
         'disease': 7781,
         'drug': 3195,
         'TF;gene': 1630,
         'miRNA;ncRNA': 593,
         'geneset;subcellular_location': 557,
         'disease;geneset': 61,
         'lncRNA;ncRNA': 36,
         'gene;lncRNA;ncRNA': 26})
[7]:
kg.get_edge_types()
[7]:
Counter({'part_of': 748950,
         'interacts': 434239,
         'relevant_in': 205461,
         'activates': 158390,
         'affected_by': 35051,
         'represses': 27058,
         'target_of': 8240})
[8]:
kg.get_edge_types(field="source")
[8]:
Counter({'kegg': 501176,
         'GeneOntology': 361812,
         'STRING': 293213,
         'omnipath': 195758,
         'reactome': 129820,
         'opentargets': 91826,
         'uniprot_celloc': 43784})
[51]:
kg.plot_edge_types(field="type")
_images/create_basic_knowledgegraph_8_0.png
[52]:
kg.plot_edge_types(field="source")
_images/create_basic_knowledgegraph_9_0.png
[9]:
kg.get_edge_edge_types()
[9]:
Counter({('gene', 'geneset', 'part_of'): 584177,
         ('gene', 'gene', 'interacts'): 299011,
         ('gene', 'geneset', 'relevant_in'): 184343,
         ('geneset', 'geneset', 'part_of'): 74634,
         ('gene', 'geneset', 'activates'): 72637,
         ('TF;gene', 'gene', 'interacts'): 61341,
         ('TF;gene', 'geneset', 'part_of'): 46417,
         ('gene', 'disease', 'interacts'): 43297,
         ('gene', 'geneset;subcellular_location', 'part_of'): 40554,
         ('gene', 'gene', 'activates'): 35829,
         ('disease', 'drug', 'affected_by'): 35017,
         ('TF;gene', 'gene', 'activates'): 30050,
         ('TF;gene', 'geneset', 'relevant_in'): 18589,
         ('gene', 'TF;gene', 'interacts'): 14452,
         ('TF;gene', 'TF;gene', 'interacts'): 9704,
         ('gene', 'gene', 'represses'): 9568,
         ('TF;gene', 'geneset', 'activates'): 9538,
         ('gene', 'drug', 'target_of'): 7899,
         ('miRNA;ncRNA', 'gene', 'represses'): 7848,
         ('TF;gene', 'disease', 'interacts'): 5105,
         ('TF;gene', 'TF;gene', 'activates'): 5097,
         ('TF;gene', 'gene', 'represses'): 4380,
         ('gene', 'TF;gene', 'activates'): 4085,
         ('TF;gene', 'geneset;subcellular_location', 'part_of'): 2043,
         ('miRNA;ncRNA', 'TF;gene', 'represses'): 1808,
         ('gene', 'disease;geneset', 'relevant_in'): 1587,
         ('gene', 'TF;gene', 'represses'): 1457,
         ('TF;gene', 'TF;gene', 'represses'): 1319,
         ('TF;gene', 'miRNA;ncRNA', 'activates'): 936,
         ('TF;gene', 'miRNA;ncRNA', 'interacts'): 661,
         ('TF;gene', 'miRNA;ncRNA', 'represses'): 502,
         ('geneset;subcellular_location', 'geneset', 'relevant_in'): 460,
         ('geneset;subcellular_location',
          'geneset;subcellular_location',
          'part_of'): 417,
         ('gene;lncRNA;ncRNA', 'geneset', 'part_of'): 402,
         ('TF;gene', 'drug', 'target_of'): 341,
         ('geneset;subcellular_location',
          'geneset;subcellular_location',
          'relevant_in'): 304,
         ('gene', 'miRNA;ncRNA', 'interacts'): 297,
         ('geneset', 'disease;geneset', 'part_of'): 200,
         ('gene', 'miRNA;ncRNA', 'activates'): 179,
         ('gene', 'miRNA;ncRNA', 'represses'): 175,
         ('TF;gene', 'disease;geneset', 'relevant_in'): 142,
         ('gene', 'disease;geneset', 'interacts'): 127,
         ('gene;lncRNA;ncRNA', 'gene', 'interacts'): 110,
         ('disease;geneset', 'geneset', 'part_of'): 95,
         ('lncRNA;ncRNA', 'gene', 'interacts'): 49,
         ('gene;lncRNA;ncRNA', 'geneset', 'relevant_in'): 36,
         ('disease;geneset', 'drug', 'affected_by'): 34,
         ('gene;lncRNA;ncRNA', 'TF;gene', 'interacts'): 30,
         ('gene', 'gene;lncRNA;ncRNA', 'interacts'): 26,
         ('lncRNA;ncRNA', 'TF;gene', 'interacts'): 12,
         ('gene', 'gene;lncRNA;ncRNA', 'activates'): 10,
         ('TF;gene', 'gene;lncRNA;ncRNA', 'activates'): 10,
         ('gene;lncRNA;ncRNA', 'gene', 'activates'): 10,
         ('TF;gene', 'gene;lncRNA;ncRNA', 'interacts'): 9,
         ('gene;lncRNA;ncRNA', 'geneset', 'activates'): 6,
         ('gene;lncRNA;ncRNA', 'geneset;subcellular_location', 'part_of'): 6,
         ('disease;geneset', 'disease;geneset', 'part_of'): 5,
         ('TF;gene', 'disease;geneset', 'interacts'): 5,
         ('gene;lncRNA;ncRNA', 'TF;gene', 'activates'): 3,
         ('lncRNA;ncRNA', 'lncRNA;ncRNA', 'interacts'): 2,
         ('TF;gene', 'gene;lncRNA;ncRNA', 'represses'): 1,
         ('gene;lncRNA;ncRNA', 'disease', 'interacts'): 1})
[10]:
kg.plot_node_types()
_images/create_basic_knowledgegraph_11_0.png
[48]:
kg.plot_node_types(show_threshold=0.001)
_images/create_basic_knowledgegraph_12_0.png
[11]:
kg.plot_edge_between_types()
_images/create_basic_knowledgegraph_13_0.png
[12]:
print(kg.kg)
DiGraph with 111032 nodes and 1617389 edges
[13]:
for x in kg.kg.nodes:
    if "gene" in kg.kg.nodes[x]["type"] and "miRNA" in kg.kg.nodes[x]["type"]:
        print(x, kg.kg.nodes[x])
[14]:
kg.save_kgraph("../data/initial_base_graph.out")
[72]:
okg = KGraph()
okg.load_kgraph("../data/initial_base_graph.out")
[73]:
okg.plot_child_distribution(plot=False)
plt.title("Cumulative Histogram of Node in-Degrees")
plt.xlim(0, 2000)
plt.show()
_images/create_basic_knowledgegraph_18_0.png
[81]:
okg.plot_node_types(show_threshold=None)
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[81], line 1
----> 1 okg.plot_node_types(show_threshold=None)

File /mnt/raidbio/extproj/projekte/regulatory_networks/scripts/../mikg/kgraph.py:308, in KGraph.plot_node_types(self, show_threshold)
    304 ntCounter = self.get_node_types()
    306 counteritems = [("{}\nn={}".format(x, ntCounter[x]), ntCounter[x]) for x in ntCounter]
--> 308 self._plot_pie(filtereditems, show_threshold=show_threshold)

NameError: name 'filtereditems' is not defined
[15]:
#
## Do some stats
#
[16]:
kg = KGraph()
kg.load_kgraph("../data/initial_base_graph.out")
[17]:
exprDF = pd.read_csv("../seq_data/expression_mean_df.tsv", sep="\t")
cmDF = exprDF[exprDF.group == "Cardiomyocyte"]
cmDF
[17]:
group gene min percentile_25 median percentile_75 max mean num sd group_cells perc_expr
22891 Cardiomyocyte A1BG 0.218642 0.439190 0.607427 0.831411 2.456248 0.709995 351 0.395967 64510 0.005441
22892 Cardiomyocyte A1BG-AS1 0.214143 0.456117 0.643483 0.936906 3.038826 0.806031 461 0.518502 64510 0.007146
22893 Cardiomyocyte A1CF 0.208636 0.422485 0.557386 0.773439 3.025672 0.637636 706 0.321588 64510 0.010944
22894 Cardiomyocyte A2M 0.181245 0.651118 0.944811 1.398837 3.792171 1.075190 32973 0.547520 64510 0.511130
22895 Cardiomyocyte A2M-AS1 0.185317 0.412732 0.539294 0.709554 2.699968 0.602207 3160 0.286947 64510 0.048985
... ... ... ... ... ... ... ... ... ... ... ... ...
50958 Cardiomyocyte ZXDC 0.185317 0.610198 0.829333 1.097115 3.521134 0.891553 35191 0.378761 64510 0.545512
50959 Cardiomyocyte ZYG11A 0.224826 0.414667 0.540848 0.712375 2.653949 0.637458 303 0.367307 64510 0.004697
50960 Cardiomyocyte ZYG11B 0.187795 0.600248 0.812252 1.080384 3.494183 0.880513 33025 0.386580 64510 0.511936
50961 Cardiomyocyte ZYX 0.193169 0.445595 0.595571 0.835346 3.001737 0.705213 5338 0.395080 64510 0.082747
50962 Cardiomyocyte ZZEF1 0.187407 0.610938 0.826084 1.094331 3.502734 0.895771 35267 0.390543 64510 0.546690

28072 rows × 12 columns

[18]:
exprDFs = {}

for group in exprDF.group.unique():
    exprDFs[group] = exprDF[exprDF.group == group].copy()

print([x for x in exprDFs])
['Adipocyte', 'Cardiomyocyte', 'Cycling cells', 'Endothelial', 'Fibroblast', 'Lymphoid', 'Mast', 'Myeloid', 'Neuronal', 'Pericyte', 'vSMCs']
[19]:
kg.add_gene_expression(cmDF)
Measured Genes 28072
Found Genes 19730
[20]:
mNS = MeanNetworkScorer()
mNS.score_nodes_from_properties(kg)
mNS.score(kg)
/mnt/raidbio/extproj/projekte/regulatory_networks/scripts/../mikg/kgraph.py:1575: RuntimeWarning: invalid value encountered in scalar divide
  edge_zscore = (edge_score-etype2mean[etype])/etype2std[etype]
[21]:
def get_score(x):
    if "gene" in x.get("type", []):
        return x.get("score", 0)
    else:
        return x.get("score", 0)
[22]:
kg.get_node_types()
[22]:
Counter({'geneset': 55163,
         'gene': 23682,
         'gene;measured_expression': 18308,
         'disease': 7781,
         'drug': 3195,
         'TF;gene;measured_expression': 1405,
         'miRNA;ncRNA': 593,
         'geneset;subcellular_location': 557,
         'TF;gene': 225,
         'disease;geneset': 61,
         'lncRNA;ncRNA': 36,
         'gene;lncRNA;measured_expression;ncRNA': 17,
         'gene;lncRNA;ncRNA': 9})
[23]:
kg.plot_node_attribute_distribution(get_score)
No artists with labels found to put in legend.  Note that artists whose label start with an underscore are ignored when legend() is called with no argument.
_images/create_basic_knowledgegraph_28_1.png
[24]:
kg.plot_node_attribute_distribution(get_score, node_types=["drug"])
No artists with labels found to put in legend.  Note that artists whose label start with an underscore are ignored when legend() is called with no argument.
_images/create_basic_knowledgegraph_29_1.png
[25]:
kg.plot_edge_attribute_distribution(edge_types=[("gene", "gene")], score_accessor=lambda x: x.get("score", 0))
No artists with labels found to put in legend.  Note that artists whose label start with an underscore are ignored when legend() is called with no argument.
_images/create_basic_knowledgegraph_30_1.png
[26]:
kg.plot_score_histogram(edge_types=[("gene", "gene")], score_accessor=lambda x: x.get("score", 0))
_images/create_basic_knowledgegraph_31_0.png
[27]:
kg.plot_score_histogram(edge_types=[("gene", "gene")], score_accessor=lambda x: x.get("score_zscore", 0))
_images/create_basic_knowledgegraph_32_0.png
[28]:
kg.plot_score_histogram(edge_types=[("gene", "geneset")], score_accessor=lambda x: x.get("score_zscore", 0))
_images/create_basic_knowledgegraph_33_0.png
[29]:
kg
[29]:
KGraph KGraph with 111032 nodes and 1617389 edges
[30]:
kg.plot_score_histogram(score_accessor=lambda x: x.get("score_zscore", 0))
_images/create_basic_knowledgegraph_35_0.png
[31]:
kg.plot_score_histogram(edge_types=[("gene", "gene")], score_accessor=lambda x: x.get("score_zscore", 0))
_images/create_basic_knowledgegraph_36_0.png
[32]:
kg.plot_score_histogram(edge_types=[("gene", "disease")], score_accessor=lambda x: x.get("score_zscore", 0))
_images/create_basic_knowledgegraph_37_0.png
[33]:
kg.plot_score_histogram(edge_types=[("gene", "geneset")], score_accessor=lambda x: x.get("score_zscore", 0))
_images/create_basic_knowledgegraph_38_0.png
[56]:
kg.plot_score_violin(per_edge_type=True, single_edge_types=True, score_accessor=lambda x: x.get("score", 0), figsize=(16, 3))
Caution: if an edge's nodes have multiple node types, its score is attributed to the product of all node-types.
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/mnt/raidbio/extproj/projekte/regulatory_networks/scripts/../mikg/kgraph.py:821: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.

_images/create_basic_knowledgegraph_39_1.png
[57]:
kg.plot_score_violin(per_edge_type=True, single_edge_types=True, score_accessor=lambda x: x.get("score_zscore", 0), figsize=(16, 3))
Caution: if an edge's nodes have multiple node types, its score is attributed to the product of all node-types.
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/home/j/joppich/.local/lib/python3.11/site-packages/seaborn/_base.py:948: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)
/mnt/raidbio/extproj/projekte/regulatory_networks/scripts/../mikg/kgraph.py:821: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.

_images/create_basic_knowledgegraph_40_1.png
[36]:
kg.plot_score_histogram(edge_types=[("gene", "drug")], score_accessor=lambda x: x.get("score_zscore", 0))
_images/create_basic_knowledgegraph_41_0.png
[37]:
kg.plot_edge_sources()
_images/create_basic_knowledgegraph_42_0.png
[46]:
kg.plot_node_types()
_images/create_basic_knowledgegraph_43_0.png
[39]:
kg.plot_edge_types()
_images/create_basic_knowledgegraph_44_0.png
[40]:
kg.plot_edge_between_types()
_images/create_basic_knowledgegraph_45_0.png
[59]:
kg.plot_node_children()
_images/create_basic_knowledgegraph_46_0.png
[ ]:

[41]:
kg.plot_node_children("drug")
_images/create_basic_knowledgegraph_48_0.png
[42]:
kg.plot_node_children("disease")
_images/create_basic_knowledgegraph_49_0.png
[43]:
kg.plot_node_children("gene")
_images/create_basic_knowledgegraph_50_0.png