# Developing-Heart-Local-Improved - Other

**Pages:** 2

---

## Notebook

**URL:** http://127.0.0.1:9020/notebooks_html/Fig2_Overview_of_cellular_niches_and_TissueTypist/tissuetypist_crossvalidation_no1_run.html

**Contents:**
- Import required modules¶
- Variables¶
- Read in pre-processed dataframe¶
- Cross validation¶

5 rows × 5221 columns

**Examples:**

Example 1 (python):
```python
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
warnings.filterwarnings('ignore')

import scanpy as sc
import anndata
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import seaborn as sns
import os
```

Example 2 (python):
```python
import tissuetypist as tt
```

Example 3 (python):
```python
import importlib
importlib.reload(tt)
```

Example 4 (python):
```python
<module 'tissuetypist' from '/nfs/team205/kk18/github/TissueTypist/tissuetypist/__init__.py'>
```

Example 5 (python):
```python
sc.settings.verbosity = 1          # verbosity: errors (0), warnings (1), info (2), hints (3)
sc.settings.set_figure_params(dpi=80)
```

Example 6 (unknown):
```unknown
dir_to_results = '/nfs/team205/kk18/notebooks/P48_Foetal-heart_Visium/notebooks/TissueTypist/tissuetypist_package/cross_validation_results/7Apr2025_without-CoronaryAdv'
# make the directory if not exist
if not os.path.exists(dir_to_results):
    os.makedirs(dir_to_results)
```

Example 7 (python):
```python
data = pd.read_pickle('/nfs/team205/kk18/notebooks/P48_Foetal-heart_Visium/notebooks/TissueTypist/tissuetypist_package/preprocessed_df/visiumsd_oct.pkl')
print(data.shape)
data.head()
```

Example 8 (unknown):
```unknown
(19590, 5221)
```

Example 9 (python):
```python
# remove coronary adventitia spots
data = data[data['tissue']!='Adventitia - Coronary']
print(data.shape)
```

Example 10 (unknown):
```unknown
(19179, 5221)
```

Example 11 (unknown):
```unknown
# Training data: weight to the seighbour spot data
weight2neighbour_list = [0,0.1,0.3,1,3]
weight2isedge_list = [0,1,5]
edge_feature_list = ['distance_to_edge','is_edge']
```

Example 12 (python):
```python
# prepare features
own_features = [x for x in data.columns if '_own' in x]
neighbour_features = [x for x in data.columns if '_neighbour-max' in x]
print(len(own_features))
print(own_features[:5])
print(len(neighbour_features))
print(neighbour_features[:5])
```

Example 13 (unknown):
```unknown
2607
['ITGA2_own', 'ZBTB42_own', 'MATN2_own', 'GLT8D2_own', 'CFH_own']
2607
['ITGA2_neighbour-max', 'ZBTB42_neighbour-max', 'MATN2_neighbour-max', 'GLT8D2_neighbour-max', 'CFH_neighbour-max']
```

Example 14 (python):
```python
for edge_feature in edge_feature_list:
    all_fold_results = []
    f1_score_class_results = []
    for neighbour_weight in weight2neighbour_list:
        for edge_weight in weight2isedge_list:
            print(f"Weight to neighbour spots: {neighbour_weight}, Weight to {edge_feature}: {edge_weight}")
            df_folds, f1_score_class_df = tt.cross_validation(data,
                                                              own_features,
                                                              neighbour_features,
                                                              edge_feature,
                                                              neighbour_weight,
                                                              edge_weight,
                                                              tissue_col='tissue',
                                                             )
            all_fold_results.append(df_folds)
            f1_score_class_results.append(f1_score_class_df)

    # Concatenate all factors into one tidy DataFrame
    results_per_fold = pd.concat(all_fold_results, ignore_index=True)
    f1_score_class_per_fold = pd.concat(f1_score_class_results, ignore_index=True)
    # save
    results_per_fold.to_csv(f'{dir_to_results}/{edge_feature}_results_per_fold.csv')
    f1_score_class_per_fold.to_csv(f'{dir_to_results}/{edge_feature}_f1_score_class_per_fold.csv')
```

Example 15 (unknown):
```unknown
Weight to neighbour spots: 0, Weight to distance_to_edge: 0
```

Example 16 (unknown):
```unknown
Weight to neighbour spots: 0, Weight to distance_to_edge: 1
```

Example 17 (unknown):
```unknown
Weight to neighbour spots: 0, Weight to distance_to_edge: 5
```

Example 18 (unknown):
```unknown
Weight to neighbour spots: 0.1, Weight to distance_to_edge: 0
```

Example 19 (unknown):
```unknown
Weight to neighbour spots: 0.1, Weight to distance_to_edge: 1
```

Example 20 (unknown):
```unknown
Weight to neighbour spots: 0.1, Weight to distance_to_edge: 5
```

Example 21 (unknown):
```unknown
Weight to neighbour spots: 0.3, Weight to distance_to_edge: 0
```

Example 22 (unknown):
```unknown
Weight to neighbour spots: 0.3, Weight to distance_to_edge: 1
```

Example 23 (unknown):
```unknown
Weight to neighbour spots: 0.3, Weight to distance_to_edge: 5
```

Example 24 (unknown):
```unknown
Weight to neighbour spots: 1, Weight to distance_to_edge: 0
```

Example 25 (unknown):
```unknown
Weight to neighbour spots: 1, Weight to distance_to_edge: 1
```

Example 26 (unknown):
```unknown
Weight to neighbour spots: 1, Weight to distance_to_edge: 5
```

Example 27 (unknown):
```unknown
Weight to neighbour spots: 3, Weight to distance_to_edge: 0
```

Example 28 (unknown):
```unknown
Weight to neighbour spots: 3, Weight to distance_to_edge: 1
```

Example 29 (unknown):
```unknown
Weight to neighbour spots: 3, Weight to distance_to_edge: 5
```

Example 30 (unknown):
```unknown
Weight to neighbour spots: 0, Weight to is_edge: 0
```

Example 31 (unknown):
```unknown
Weight to neighbour spots: 0, Weight to is_edge: 1
```

Example 32 (unknown):
```unknown
Weight to neighbour spots: 0, Weight to is_edge: 5
```

Example 33 (unknown):
```unknown
Weight to neighbour spots: 0.1, Weight to is_edge: 0
```

Example 34 (unknown):
```unknown
Weight to neighbour spots: 0.1, Weight to is_edge: 1
```

Example 35 (unknown):
```unknown
Weight to neighbour spots: 0.1, Weight to is_edge: 5
```

Example 36 (unknown):
```unknown
Weight to neighbour spots: 0.3, Weight to is_edge: 0
```

Example 37 (unknown):
```unknown
Weight to neighbour spots: 0.3, Weight to is_edge: 1
```

Example 38 (unknown):
```unknown
Weight to neighbour spots: 0.3, Weight to is_edge: 5
```

Example 39 (unknown):
```unknown
Weight to neighbour spots: 1, Weight to is_edge: 0
```

Example 40 (unknown):
```unknown
Weight to neighbour spots: 1, Weight to is_edge: 1
```

Example 41 (unknown):
```unknown
Weight to neighbour spots: 1, Weight to is_edge: 5
```

Example 42 (unknown):
```unknown
Weight to neighbour spots: 3, Weight to is_edge: 0
```

Example 43 (unknown):
```unknown
Weight to neighbour spots: 3, Weight to is_edge: 1
```

Example 44 (unknown):
```unknown
Weight to neighbour spots: 3, Weight to is_edge: 5
```

---

## Notebook

**URL:** http://127.0.0.1:9020/notebooks_html/Fig2_Overview_of_cellular_niches_and_TissueTypist/tissuetypist_crossvalidation_no2_summary.html

**Contents:**
- Read in result files¶
- Edge feature: distance to edge¶
  - Stats¶
  - Accuracy¶
  - F1 score¶

**Examples:**

Example 1 (python):
```python
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import os

import matplotlib as mpl
# enables correct plotting of text
mpl.rcParams['pdf.fonttype'] = 42
mpl.rcParams['ps.fonttype'] = 42
```

Example 2 (unknown):
```unknown
figdir = '/nfs/team205/heart/fetal_ms_figures/raw_plots_kk/Aug2024'
table_dir = '/nfs/team205/heart/fetal_ms_figures/tables/Aug2024'
```

Example 3 (unknown):
```unknown
dir_to_results = '/nfs/team205/kk18/notebooks/P48_Foetal-heart_Visium/notebooks/TissueTypist/tissuetypist_package/cross_validation_results/7Apr2025_without-CoronaryAdv'
```

Example 4 (unknown):
```unknown
os.listdir(dir_to_results)
```

Example 5 (unknown):
```unknown
['is_edge_f1_score_class_per_fold.csv',
 'distance_to_edge_f1_score_class_per_fold.csv',
 'distance_to_edge_results_per_fold.csv',
 'is_edge_results_per_fold.csv']
```

Example 6 (python):
```python
edge_feature = 'distance_to_edge'

accuracy_df = pd.read_csv(f'{dir_to_results}/{edge_feature}_results_per_fold.csv',index_col=0)
display(accuracy_df.head())
f1score_df = pd.read_csv(f'{dir_to_results}/{edge_feature}_f1_score_class_per_fold.csv',index_col=0)
display(f1score_df.head())
```

Example 7 (unknown):
```unknown
f1score_df[(f1score_df['weight_to_neighbours']==1)&(f1score_df['weight_to_edge']==0)]
```

Example 8 (python):
```python
import pandas as pd
import numpy as np
from scipy.stats import kruskal, mannwhitneyu
import statsmodels.stats.multitest as smm

def two_factor_test(df,
                    factor_A_col,
                    factor_B_col,
                    score
                   ):
    ### 0. prepare levels for the two factors
    levels_A = list(set(df[factor_A_col]))
    levels_A.sort()
    levels_B = list(set(df[factor_B_col]))
    levels_B.sort()
    
    ### 1. Test the main effect of A using a Kruskal–Wallis test
    # First, group the data by factor A (pooling across B)
    grouped_A = [group[score].values for name, group in df.groupby(factor_A_col)]
    kw_A, p_kw_A = kruskal(*grouped_A)
    print(f"Kruskal-Wallis test for the main effect of {factor_A_col}:")
    print(f"Statistic: {kw_A:.4f}, p-value: {p_kw_A:.4f}")
    
    ### 2. Test the effect of B within each level of A
    for a in levels_A:
        print(f"\nTesting the effect of {factor_B_col} within {factor_A_col} = {a}")
        subset = df[df[factor_A_col] == a]

        # Use Kruskal-Wallis test for factor B within this subset.
        grouped_B = [group[score].values for name, group in subset.groupby(factor_B_col)]
        kw_B, p_kw_B = kruskal(*grouped_B)
        print(f"Kruskal-Wallis test for '{factor_B_col}' within '{factor_A_col}' = {a}: Statistic: {kw_B:.4f}, p-value: {p_kw_B:.4f}")

        # Perform pairwise Mann–Whitney U tests between levels of B
        # (only if you wish to run post-hoc pairwise comparisons)
        condition_keys = sorted(subset[factor_B_col].unique())
        comparisons = []
        p_values = []

        for i in range(len(condition_keys)):
            for j in range(i + 1, len(condition_keys)):
                group1 = subset[subset[factor_B_col] == condition_keys[i]][score]
                group2 = subset[subset[factor_B_col] == condition_keys[j]][score]
                stat, p = mannwhitneyu(group1, group2, alternative='two-sided')
                comparisons.append(f"{condition_keys[i]} vs {condition_keys[j]}")
                p_values.append(p)

        # Apply fdr_bh correction for multiple comparisons
        reject, pvals_corrected, _, _ = smm.multipletests(p_values, method='fdr_bh')
        print(f"Post-hoc pairwise comparisons for '{factor_B_col}' within '{factor_A_col}' = {str(a)}:")
        for comp, p_val, rej in zip(comparisons, pvals_corrected, reject):
            print(f"Comparison {comp}: Corrected p = {p_val:.4f}, Significant = {rej}")
            
    ### 3. return the outputs
    return kw_A, p_kw_A
```

Example 9 (unknown):
```unknown
# accuracy_df
two_factor_test(accuracy_df,
                    factor_A_col='weight_to_neighbours',
                    factor_B_col='weight_to_edge',
                    score='accuracy'
                   )
```

Example 10 (unknown):
```unknown
Kruskal-Wallis test for the main effect of weight_to_neighbours:
Statistic: 46.6325, p-value: 0.0000

Testing the effect of weight_to_edge within weight_to_neighbours = 0.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.0: Statistic: 1.4626, p-value: 0.4813
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.0:
Comparison 0 vs 1: Corrected p = 0.5296, Significant = False
Comparison 0 vs 5: Corrected p = 0.5296, Significant = False
Comparison 1 vs 5: Corrected p = 0.5296, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.1
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.1: Statistic: 1.2600, p-value: 0.5326
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.1:
Comparison 0 vs 1: Corrected p = 0.8413, Significant = False
Comparison 0 vs 5: Corrected p = 0.6310, Significant = False
Comparison 1 vs 5: Corrected p = 0.6310, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.3
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.3: Statistic: 1.8200, p-value: 0.4025
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.3:
Comparison 0 vs 1: Corrected p = 0.5476, Significant = False
Comparison 0 vs 5: Corrected p = 0.5476, Significant = False
Comparison 1 vs 5: Corrected p = 0.5476, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 1.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 1.0: Statistic: 2.9706, p-value: 0.2264
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 1.0:
Comparison 0 vs 1: Corrected p = 0.8335, Significant = False
Comparison 0 vs 5: Corrected p = 0.3333, Significant = False
Comparison 1 vs 5: Corrected p = 0.3333, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 3.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 3.0: Statistic: 2.5800, p-value: 0.2753
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 3.0:
Comparison 0 vs 1: Corrected p = 0.8413, Significant = False
Comparison 0 vs 5: Corrected p = 0.3333, Significant = False
Comparison 1 vs 5: Corrected p = 0.3333, Significant = False
```

Example 11 (python):
```python
(np.float64(46.63245124819787), np.float64(1.8188129472739346e-09))
```

Example 12 (unknown):
```unknown
# accuracy_df
two_factor_test(accuracy_df,
                    factor_A_col='weight_to_neighbours',
                    factor_B_col='weight_to_edge',
                    score='balanced_accuracy'
                   )
```

Example 13 (unknown):
```unknown
Kruskal-Wallis test for the main effect of weight_to_neighbours:
Statistic: 20.0716, p-value: 0.0005

Testing the effect of weight_to_edge within weight_to_neighbours = 0.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.0: Statistic: 1.1400, p-value: 0.5655
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.0:
Comparison 0 vs 1: Corrected p = 0.5476, Significant = False
Comparison 0 vs 5: Corrected p = 0.5476, Significant = False
Comparison 1 vs 5: Corrected p = 0.5476, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.1
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.1: Statistic: 0.6200, p-value: 0.7334
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.1:
Comparison 0 vs 1: Corrected p = 0.8413, Significant = False
Comparison 0 vs 5: Corrected p = 0.8413, Significant = False
Comparison 1 vs 5: Corrected p = 0.8413, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.3
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.3: Statistic: 0.7400, p-value: 0.6907
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.3:
Comparison 0 vs 1: Corrected p = 0.8413, Significant = False
Comparison 0 vs 5: Corrected p = 0.8413, Significant = False
Comparison 1 vs 5: Corrected p = 0.8413, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 1.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 1.0: Statistic: 1.4600, p-value: 0.4819
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 1.0:
Comparison 0 vs 1: Corrected p = 0.6905, Significant = False
Comparison 0 vs 5: Corrected p = 0.6905, Significant = False
Comparison 1 vs 5: Corrected p = 0.6905, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 3.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 3.0: Statistic: 0.3800, p-value: 0.8270
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 3.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False
```

Example 14 (python):
```python
(np.float64(20.07157894736841), np.float64(0.000483409762777016))
```

Example 15 (python):
```python
# f1 score
y_value_list = [x for x in f1score_df.columns if ('f1_class_' in x)&('Adventitia - Coronary' not in x)]

tissues_significant = []
for tissue in y_value_list:
    print(f'########## {tissue} ##########')
    df = f1score_df[[tissue,'weight_to_neighbours','weight_to_edge']]
    df.columns = ['f1_score','weight_to_neighbours','weight_to_edge']
    kw_A, p_kw_A = two_factor_test(df,
                    factor_A_col='weight_to_neighbours',
                    factor_B_col='weight_to_edge',
                    score='f1_score'
                   )
    if p_kw_A<0.05:
        tissues_significant.append(tissue)
    print(f'')
    print(f'')
```

Example 16 (unknown):
```unknown
########## f1_class_Atrium ##########
Kruskal-Wallis test for the main effect of weight_to_neighbours:
Statistic: 20.5078, p-value: 0.0004

Testing the effect of weight_to_edge within weight_to_neighbours = 0.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.0: Statistic: 0.0050, p-value: 0.9975
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.1
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.1: Statistic: 0.0201, p-value: 0.9900
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.1:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.3
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.3: Statistic: 0.0050, p-value: 0.9975
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.3:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 1.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 1.0: Statistic: 0.0351, p-value: 0.9826
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 1.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 3.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 3.0: Statistic: 0.1425, p-value: 0.9312
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 3.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False


########## f1_class_Ventricle - Compact ##########
Kruskal-Wallis test for the main effect of weight_to_neighbours:
Statistic: 42.4393, p-value: 0.0000

Testing the effect of weight_to_edge within weight_to_neighbours = 0.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.0: Statistic: 2.2200, p-value: 0.3296
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.0:
Comparison 0 vs 1: Corrected p = 0.5476, Significant = False
Comparison 0 vs 5: Corrected p = 0.5476, Significant = False
Comparison 1 vs 5: Corrected p = 0.5476, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.1
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.1: Statistic: 1.5200, p-value: 0.4677
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.1:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 0.6310, Significant = False
Comparison 1 vs 5: Corrected p = 0.6310, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.3
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.3: Statistic: 2.4800, p-value: 0.2894
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.3:
Comparison 0 vs 1: Corrected p = 0.6905, Significant = False
Comparison 0 vs 5: Corrected p = 0.4524, Significant = False
Comparison 1 vs 5: Corrected p = 0.6310, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 1.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 1.0: Statistic: 4.0923, p-value: 0.1292
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 1.0:
Comparison 0 vs 1: Corrected p = 0.6004, Significant = False
Comparison 0 vs 5: Corrected p = 0.2262, Significant = False
Comparison 1 vs 5: Corrected p = 0.2262, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 3.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 3.0: Statistic: 3.4400, p-value: 0.1791
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 3.0:
Comparison 0 vs 1: Corrected p = 0.4206, Significant = False
Comparison 0 vs 5: Corrected p = 0.3333, Significant = False
Comparison 1 vs 5: Corrected p = 0.3333, Significant = False


########## f1_class_Ventricle - Trabeculated ##########
Kruskal-Wallis test for the main effect of weight_to_neighbours:
Statistic: 32.1279, p-value: 0.0000

Testing the effect of weight_to_edge within weight_to_neighbours = 0.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.0: Statistic: 0.1400, p-value: 0.9324
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.1
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.1: Statistic: 0.3757, p-value: 0.8288
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.1:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.3
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.3: Statistic: 0.0150, p-value: 0.9925
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.3:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 1.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 1.0: Statistic: 0.5000, p-value: 0.7788
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 1.0:
Comparison 0 vs 1: Corrected p = 0.6905, Significant = False
Comparison 0 vs 5: Corrected p = 0.6905, Significant = False
Comparison 1 vs 5: Corrected p = 0.6905, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 3.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 3.0: Statistic: 0.4200, p-value: 0.8106
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 3.0:
Comparison 0 vs 1: Corrected p = 0.8413, Significant = False
Comparison 0 vs 5: Corrected p = 0.8413, Significant = False
Comparison 1 vs 5: Corrected p = 0.8413, Significant = False


########## f1_class_SAnode ##########
Kruskal-Wallis test for the main effect of weight_to_neighbours:
Statistic: 4.7938, p-value: 0.3091

Testing the effect of weight_to_edge within weight_to_neighbours = 0.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.0: Statistic: 0.0713, p-value: 0.9650
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.1
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.1: Statistic: 0.0771, p-value: 0.9622
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.1:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.3
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.3: Statistic: 0.0000, p-value: 1.0000
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.3:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 1.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 1.0: Statistic: 0.1465, p-value: 0.9294
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 1.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 3.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 3.0: Statistic: 0.0000, p-value: 1.0000
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 3.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False


########## f1_class_AVnode ##########
Kruskal-Wallis test for the main effect of weight_to_neighbours:
Statistic: 9.8756, p-value: 0.0426

Testing the effect of weight_to_edge within weight_to_neighbours = 0.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.0: Statistic: 0.0615, p-value: 0.9697
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.1
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.1: Statistic: 0.0358, p-value: 0.9822
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.1:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.3
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.3: Statistic: 0.0615, p-value: 0.9697
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.3:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 1.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 1.0: Statistic: 0.2201, p-value: 0.8958
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 1.0:
Comparison 0 vs 1: Corrected p = 0.9161, Significant = False
Comparison 0 vs 5: Corrected p = 0.9161, Significant = False
Comparison 1 vs 5: Corrected p = 0.9161, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 3.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 3.0: Statistic: 0.7538, p-value: 0.6860
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 3.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 0.7887, Significant = False
Comparison 1 vs 5: Corrected p = 0.7887, Significant = False


########## f1_class_VCS - Proximal ##########
Kruskal-Wallis test for the main effect of weight_to_neighbours:
Statistic: 7.7439, p-value: 0.1014

Testing the effect of weight_to_edge within weight_to_neighbours = 0.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.0: Statistic: 0.3757, p-value: 0.8288
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.1
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.1: Statistic: 0.1553, p-value: 0.9253
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.1:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.3
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.3: Statistic: 0.1400, p-value: 0.9324
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.3:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 1.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 1.0: Statistic: 0.0202, p-value: 0.9899
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 1.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 3.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 3.0: Statistic: 1.9086, p-value: 0.3851
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 3.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 0.4274, Significant = False
Comparison 1 vs 5: Corrected p = 0.7925, Significant = False


########## f1_class_VCS - Distal ##########
Kruskal-Wallis test for the main effect of weight_to_neighbours:
Statistic: 22.5262, p-value: 0.0002

Testing the effect of weight_to_edge within weight_to_neighbours = 0.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.0: Statistic: 0.0351, p-value: 0.9826
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.1
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.1: Statistic: 0.3657, p-value: 0.8329
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.1:
Comparison 0 vs 1: Corrected p = 0.8413, Significant = False
Comparison 0 vs 5: Corrected p = 0.8413, Significant = False
Comparison 1 vs 5: Corrected p = 0.8413, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.3
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.3: Statistic: 0.3670, p-value: 0.8324
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.3:
Comparison 0 vs 1: Corrected p = 0.8335, Significant = False
Comparison 0 vs 5: Corrected p = 0.8335, Significant = False
Comparison 1 vs 5: Corrected p = 0.8335, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 1.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 1.0: Statistic: 0.0200, p-value: 0.9900
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 1.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 3.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 3.0: Statistic: 0.0353, p-value: 0.9825
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 3.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False


########## f1_class_Great vessel ##########
Kruskal-Wallis test for the main effect of weight_to_neighbours:
Statistic: 36.7687, p-value: 0.0000

Testing the effect of weight_to_edge within weight_to_neighbours = 0.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.0: Statistic: 1.2200, p-value: 0.5434
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 0.6310, Significant = False
Comparison 1 vs 5: Corrected p = 0.6310, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.1
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.1: Statistic: 0.4558, p-value: 0.7962
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.1:
Comparison 0 vs 1: Corrected p = 0.9166, Significant = False
Comparison 0 vs 5: Corrected p = 0.9166, Significant = False
Comparison 1 vs 5: Corrected p = 0.9166, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.3
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.3: Statistic: 0.5159, p-value: 0.7726
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.3:
Comparison 0 vs 1: Corrected p = 0.8413, Significant = False
Comparison 0 vs 5: Corrected p = 0.8413, Significant = False
Comparison 1 vs 5: Corrected p = 0.8413, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 1.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 1.0: Statistic: 0.0651, p-value: 0.9680
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 1.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 3.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 3.0: Statistic: 0.1352, p-value: 0.9346
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 3.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False


########## f1_class_Coronary vessel ##########
Kruskal-Wallis test for the main effect of weight_to_neighbours:
Statistic: 17.0662, p-value: 0.0019

Testing the effect of weight_to_edge within weight_to_neighbours = 0.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.0: Statistic: 0.0000, p-value: 1.0000
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.1
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.1: Statistic: 0.0636, p-value: 0.9687
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.1:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.3
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.3: Statistic: 0.0000, p-value: 1.0000
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.3:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 1.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 1.0: Statistic: 0.0193, p-value: 0.9904
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 1.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 3.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 3.0: Statistic: 0.1615, p-value: 0.9224
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 3.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False


########## f1_class_Ductus arteriosus ##########
Kruskal-Wallis test for the main effect of weight_to_neighbours:
Statistic: 1.1268, p-value: 0.8900

Testing the effect of weight_to_edge within weight_to_neighbours = 0.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.0: Statistic: 0.1083, p-value: 0.9473
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.1
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.1: Statistic: 0.0153, p-value: 0.9924
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.1:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.3
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.3: Statistic: 0.0155, p-value: 0.9923
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.3:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 1.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 1.0: Statistic: 0.5538, p-value: 0.7581
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 1.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 0.8972, Significant = False
Comparison 1 vs 5: Corrected p = 0.8972, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 3.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 3.0: Statistic: 0.2000, p-value: 0.9048
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 3.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False


########## f1_class_Adventitia - GV ##########
Kruskal-Wallis test for the main effect of weight_to_neighbours:
Statistic: 40.6570, p-value: 0.0000

Testing the effect of weight_to_edge within weight_to_neighbours = 0.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.0: Statistic: 0.0452, p-value: 0.9776
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.1
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.1: Statistic: 0.1261, p-value: 0.9389
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.1:
Comparison 0 vs 1: Corrected p = 0.9166, Significant = False
Comparison 0 vs 5: Corrected p = 0.9166, Significant = False
Comparison 1 vs 5: Corrected p = 0.9166, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.3
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.3: Statistic: 0.1065, p-value: 0.9481
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.3:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 1.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 1.0: Statistic: 0.0809, p-value: 0.9604
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 1.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 3.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 3.0: Statistic: 0.5458, p-value: 0.7612
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 3.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 0.9006, Significant = False
Comparison 1 vs 5: Corrected p = 0.9006, Significant = False


########## f1_class_Epicardium ##########
Kruskal-Wallis test for the main effect of weight_to_neighbours:
Statistic: 12.9879, p-value: 0.0113

Testing the effect of weight_to_edge within weight_to_neighbours = 0.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.0: Statistic: 10.8200, p-value: 0.0045
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.0:
Comparison 0 vs 1: Corrected p = 0.0952, Significant = False
Comparison 0 vs 5: Corrected p = 0.0119, Significant = True
Comparison 1 vs 5: Corrected p = 0.0119, Significant = True

Testing the effect of weight_to_edge within weight_to_neighbours = 0.1
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.1: Statistic: 11.1800, p-value: 0.0037
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.1:
Comparison 0 vs 1: Corrected p = 0.0556, Significant = False
Comparison 0 vs 5: Corrected p = 0.0119, Significant = True
Comparison 1 vs 5: Corrected p = 0.0119, Significant = True

Testing the effect of weight_to_edge within weight_to_neighbours = 0.3
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.3: Statistic: 9.2600, p-value: 0.0098
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.3:
Comparison 0 vs 1: Corrected p = 0.0833, Significant = False
Comparison 0 vs 5: Corrected p = 0.0238, Significant = True
Comparison 1 vs 5: Corrected p = 0.0952, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 1.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 1.0: Statistic: 8.0600, p-value: 0.0178
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 1.0:
Comparison 0 vs 1: Corrected p = 0.6905, Significant = False
Comparison 0 vs 5: Corrected p = 0.0238, Significant = True
Comparison 1 vs 5: Corrected p = 0.0238, Significant = True

Testing the effect of weight_to_edge within weight_to_neighbours = 3.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 3.0: Statistic: 7.8791, p-value: 0.0195
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 3.0:
Comparison 0 vs 1: Corrected p = 0.3457, Significant = False
Comparison 0 vs 5: Corrected p = 0.0476, Significant = True
Comparison 1 vs 5: Corrected p = 0.0476, Significant = True


########## f1_class_Endocardium - Atrial ##########
Kruskal-Wallis test for the main effect of weight_to_neighbours:
Statistic: 19.0450, p-value: 0.0008

Testing the effect of weight_to_edge within weight_to_neighbours = 0.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.0: Statistic: 0.0955, p-value: 0.9534
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.1
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.1: Statistic: 0.4230, p-value: 0.8094
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.1:
Comparison 0 vs 1: Corrected p = 0.8325, Significant = False
Comparison 0 vs 5: Corrected p = 0.8325, Significant = False
Comparison 1 vs 5: Corrected p = 0.8325, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.3
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.3: Statistic: 0.0151, p-value: 0.9925
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.3:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 1.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 1.0: Statistic: 1.0437, p-value: 0.5934
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 1.0:
Comparison 0 vs 1: Corrected p = 0.8335, Significant = False
Comparison 0 vs 5: Corrected p = 0.8214, Significant = False
Comparison 1 vs 5: Corrected p = 0.8214, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 3.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 3.0: Statistic: 0.0459, p-value: 0.9773
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 3.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False


########## f1_class_Endocardium - Ventricular ##########
Kruskal-Wallis test for the main effect of weight_to_neighbours:
Statistic: 34.8658, p-value: 0.0000

Testing the effect of weight_to_edge within weight_to_neighbours = 0.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.0: Statistic: 0.1252, p-value: 0.9393
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.1
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.1: Statistic: 0.1800, p-value: 0.9139
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.1:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.3
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.3: Statistic: 0.1800, p-value: 0.9139
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.3:
Comparison 0 vs 1: Corrected p = 0.8413, Significant = False
Comparison 0 vs 5: Corrected p = 0.8413, Significant = False
Comparison 1 vs 5: Corrected p = 0.8413, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 1.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 1.0: Statistic: 0.1553, p-value: 0.9253
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 1.0:
Comparison 0 vs 1: Corrected p = 0.9166, Significant = False
Comparison 0 vs 5: Corrected p = 0.9166, Significant = False
Comparison 1 vs 5: Corrected p = 0.9166, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 3.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 3.0: Statistic: 0.0200, p-value: 0.9900
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 3.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False


########## f1_class_Endocardial cusion ##########
Kruskal-Wallis test for the main effect of weight_to_neighbours:
Statistic: 18.1907, p-value: 0.0011

Testing the effect of weight_to_edge within weight_to_neighbours = 0.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.0: Statistic: 0.0356, p-value: 0.9823
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.1
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.1: Statistic: 0.1069, p-value: 0.9479
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.1:
Comparison 0 vs 1: Corrected p = 0.9161, Significant = False
Comparison 0 vs 5: Corrected p = 0.9161, Significant = False
Comparison 1 vs 5: Corrected p = 0.9161, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.3
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.3: Statistic: 1.0101, p-value: 0.6035
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.3:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 0.6781, Significant = False
Comparison 1 vs 5: Corrected p = 0.6781, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 1.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 1.0: Statistic: 0.1377, p-value: 0.9335
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 1.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 3.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 3.0: Statistic: 0.0619, p-value: 0.9695
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 3.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False


########## f1_class_AV ring ##########
Kruskal-Wallis test for the main effect of weight_to_neighbours:
Statistic: 13.0272, p-value: 0.0111

Testing the effect of weight_to_edge within weight_to_neighbours = 0.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.0: Statistic: 0.1806, p-value: 0.9136
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.1
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.1: Statistic: 0.2454, p-value: 0.8845
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.1:
Comparison 0 vs 1: Corrected p = 0.9166, Significant = False
Comparison 0 vs 5: Corrected p = 0.9166, Significant = False
Comparison 1 vs 5: Corrected p = 0.9166, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.3
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.3: Statistic: 0.5829, p-value: 0.7472
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.3:
Comparison 0 vs 1: Corrected p = 0.9966, Significant = False
Comparison 0 vs 5: Corrected p = 0.9966, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 1.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 1.0: Statistic: 0.1362, p-value: 0.9342
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 1.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 3.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 3.0: Statistic: 0.4079, p-value: 0.8155
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 3.0:
Comparison 0 vs 1: Corrected p = 0.7533, Significant = False
Comparison 0 vs 5: Corrected p = 0.7533, Significant = False
Comparison 1 vs 5: Corrected p = 0.7533, Significant = False


########## f1_class_Valves ##########
Kruskal-Wallis test for the main effect of weight_to_neighbours:
Statistic: 33.6727, p-value: 0.0000

Testing the effect of weight_to_edge within weight_to_neighbours = 0.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.0: Statistic: 1.4576, p-value: 0.4825
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.0:
Comparison 0 vs 1: Corrected p = 0.6950, Significant = False
Comparison 0 vs 5: Corrected p = 0.6950, Significant = False
Comparison 1 vs 5: Corrected p = 0.8413, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.1
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.1: Statistic: 0.2865, p-value: 0.8665
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.1:
Comparison 0 vs 1: Corrected p = 0.9166, Significant = False
Comparison 0 vs 5: Corrected p = 0.9166, Significant = False
Comparison 1 vs 5: Corrected p = 0.9166, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 0.3
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 0.3: Statistic: 0.0955, p-value: 0.9534
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 0.3:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 1.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 1.0: Statistic: 0.1069, p-value: 0.9479
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 1.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False

Testing the effect of weight_to_edge within weight_to_neighbours = 3.0
Kruskal-Wallis test for 'weight_to_edge' within 'weight_to_neighbours' = 3.0: Statistic: 0.2435, p-value: 0.8854
Post-hoc pairwise comparisons for 'weight_to_edge' within 'weight_to_neighbours' = 3.0:
Comparison 0 vs 1: Corrected p = 1.0000, Significant = False
Comparison 0 vs 5: Corrected p = 1.0000, Significant = False
Comparison 1 vs 5: Corrected p = 1.0000, Significant = False
```

Example 17 (unknown):
```unknown
tissues_significant
```

Example 18 (unknown):
```unknown
['f1_class_Atrium',
 'f1_class_Ventricle - Compact',
 'f1_class_Ventricle - Trabeculated',
 'f1_class_AVnode',
 'f1_class_VCS - Distal',
 'f1_class_Great vessel',
 'f1_class_Coronary vessel',
 'f1_class_Adventitia - GV',
 'f1_class_Epicardium',
 'f1_class_Endocardium - Atrial',
 'f1_class_Endocardium - Ventricular',
 'f1_class_Endocardial cusion',
 'f1_class_AV ring',
 'f1_class_Valves']
```

Example 19 (python):
```python
for y_value in ['accuracy','balanced_accuracy']:
    plt.figure(figsize=(3, 3))
    sns.boxplot(data=accuracy_df,x='weight_to_neighbours',y=y_value,hue='weight_to_edge',palette='Set2') # ''
    plt.xticks(rotation=90)
    plt.legend(loc='upper right',title='edge_weight',bbox_to_anchor=(1.6, 1))
    plt.title('')
    plt.savefig(f'{figdir}/TissueTypist_cross-validation_overall-{y_value}.pdf', bbox_inches="tight",dpi=300)
    plt.show()
```

Example 20 (unknown):
```unknown
y_value_list = [x for x in f1score_df.columns if ('f1_class_' in x)&('Adventitia - Coronary' not in x)]
len(y_value_list)
```

Example 21 (python):
```python
plt.rcParams['axes.grid'] = False
fig,axs=plt.subplots(nrows=3,ncols=6,figsize=(20,8))
# Turn the (3×6) array into a flat list of 18 Axes
axs = axs.flatten()
for i,y_value in enumerate(y_value_list):
    sns.boxplot(data=f1score_df,x='weight_to_neighbours',y=y_value,
                hue='weight_to_edge',palette='Set2',
                ax=axs[i])
    axs[i].set_title(y_value.replace('f1_class_',''))
    axs[i].set_xlabel('neighbour_weight')
    axs[i].set_ylabel('f1 score')
    axs[i].tick_params(axis='x', rotation=90)
    if i==(len(y_value_list)-1):
        axs[i].legend(loc='lower right',title='edge_weight',bbox_to_anchor=(0, -0.9))
    else:
        axs[i].get_legend().remove()
# fig.suptitle('Main Title for the Figure')
# fig.tight_layout(w_pad=1)
fig.subplots_adjust(
    left=0.1, right=0.9,      # margins from figure edge
    bottom=0.1, top=0.9,
    wspace=0.4,               # horizontal space between cols
    hspace=0.6                # vertical space between rows
)
plt.savefig(f'{figdir}/TissueTypist_cross-validation_each-label-f1score.pdf', bbox_inches="tight",dpi=300)
plt.show()
```

---
