Networks, learning and agreement, from Python

Networks, learning and agreement

Different strategies read different evidence: measured contacts, co-expression, a trained model. Where they agree, a call is far more likely to be right -- and the self-tests say how much more.

In [1]:
from starplast import strategies as Svote = S.run('layer_vote', target='compartment')vote.tables['source weights']
Out[1]:
source weight
measurements (kNN) 0.275
xlms 0.122
coexpression 0.116
struct 0.0745
domain 0.0519
cotranslation 0.0268
cofitness 0.0174
ip_ms 0.00331
orthogroup 0
In [2]:
clf = S.run('supervised_classifier', target='compartment')clf.tables['what drives each class'].groupby('class').head(2).head(12)
Out[2]:
class measurement weight
19S proteasome n_crosslink_partners 1.39
19S proteasome n_xlink_partners 1.29
40S ribosome mrna_log2_remaining_4h_actinomycin 1.16
40S ribosome ees_vs_tachyzoite_log2 0.82
60S ribosome fit_glucose_dependence 1.16
60S ribosome codon_gc3 1.14
ER is_tm 2.2
ER n_tm 2.1
ER 2 iron_depletion_protein_log2fc 1.76
ER 2 has_signal_peptide 1.68
Golgi is_tm 1.85
Golgi n_tm 1.8
In [3]:
tri = S.test('triangulation', target='compartment')tri
Out[3]:

PASS -- precision of calls on hidden genes 0.539 against 0.157 ± 0.011 under 5 runs on shuffled labels (bar 0.171, p 0.167); effect +0.382, needed +0.100; 622 hidden

Hidden: 25% of the compartment labels, whole orthogroups at a time; 622 calls made on 951 hidden genes. Null: 5 runs on shuffled labels.

Scorecard (label calls)

Accuracy0.352
Coverage0.654
Precision of calls0.539
Macro precision0.533
Macro recall (balanced accuracy)0.331
Macro F10.369
Weighted F10.405
Cohen's kappa0.300
Matthews correlation (MCC)0.323
Macro AUROC0.920
Macro AUPRC0.503
In [4]:
{k: round(v, 3) for k, v in tri.numbers.items() if 'precision' in k}
Out[4]:
{'measurements (kNN) precision': 0.406, 'classifier (logistic) precision': 0.461, 'networks (vote) precision': 0.286}
In [5]:
under = S.run('understudied_first', target='compartment')under.tables['candidates'].head(10)
Out[5]:
gene_id product prediction support sources_agreeing
TGME49_225745 hypothetical protein nucleus - chromatin 0.546 3
TGME49_266010 phosphatidylinositol 3- and 4-kinase nucleus - chromatin 0.546 3
TGME49_286270 hypothetical protein nucleus - chromatin 0.546 3
TGME49_271145 hypothetical protein nucleus - chromatin 0.546 3
TGME49_253870 hypothetical protein apicoplast 0.546 3
TGME49_311625 bromodomain-containing protein BDP6, putative nucleus - chromatin 0.546 3
TGME49_270720 hypothetical protein nucleus - chromatin 0.546 3
TGME49_225960 STE kinase nucleus - chromatin 0.546 3
TGME49_314875 RIC1 protein nucleus - chromatin 0.546 3
TGME49_273780 SWI2/SNF2-containing protein nucleus - chromatin 0.546 3