Start from a gene list, from Python

Start from a gene list

Four strategies take a list: 02 looks for the cluster that holds it, 20 learns what makes it special from positives alone, 24 describes what it has in common, and 25 grows it along the networks. Here the list is the 135 genes of PM - integral; hold out the compartment column so no strategy can read the list back from the label that defined it.

In [1]:
from starplast import strategies as Sctx = S.shipped('Tg')cat, members = S.example_set(ctx, 'compartment')genes = list(ctx.gene_ids[members])print(cat, len(genes), genes[:5])
Out[1]:
PM - integral 135 ['TGME49_254370', 'TGME49_216620', 'TGME49_247195', 'TGME49_211640', 'TGME49_316730']
In [2]:
hunt = S.run('geneset_hunt', genes=genes, exclude='compartment',             n_neighbors='15, 50', min_dist='0.0', min_cluster_size='20, 50',             selection='eom, leaf', sample=2000)print(hunt.summary)
Out[2]:
135 genes found (0 not found). Best of 8 configurations: all permitted, n_neighbors 15, min_dist 0.0, min cluster 20 (leaf) -- cluster 5 holds 22 of your 135 placed genes among 96 (precision 0.23, recall 0.16, F1 0.19). Random sets of the same size reach F1 0.13 ± 0.00 at their best over the same walk (search-corrected p = 0.0099). 74 genes in that cluster are not on your list.
In [3]:
hunt.tables['candidates'].head(10)
Out[3]:
gene_id product in_list distance_to_centre
TGME49_318660 protein phosphatase PPM5B False 0.402
TGME49_271610 pyrroline-5-carboxylate reductase False 1.62
TGME49_267070 aquaporin 2 False 1.66
TGME49_306190 hypothetical protein False 1.72
TGME49_226740 zinc finger, C3HC4 type (RING finger) domain-containing protein False 1.82
TGME49_208550 hypothetical protein False 2.07
TGME49_214950 hypothetical protein False 2.35
TGME49_240570 hypothetical protein False 2.38
TGME49_249200 Ctr copper transporter family protein False 2.42
TGME49_265520 hypothetical protein False 2.46

Three more ways to use a list

In [4]:
pu = S.run('positive_unlabeled', genes=genes, exclude='compartment')pu.tables['candidates'].head(8)
Out[4]:
gene_id product score
TGME49_253880 GNS1/SUR4 family protein 5.11
TGME49_278850 palmitoyltransferase DHHC2 4.56
TGME49_299060 sodium/hydrogen exchanger NHE2 4.46
TGME49_276910 endoplasmic reticulum lumen protein retaining receptor (ERD2) family protein 4.45
TGME49_309560 nmda receptor glutamate-binding chain 4.43
TGME49_321530 cathepsin CPL 4.32
TGME49_250740 Yip1 domain-containing protein 4.16
TGME49_301210 NAD(P) transhydrogenase subunit beta, putative 4.06
In [5]:
profile = S.run('set_enrichment', genes=genes, exclude='compartment')profile.tables['profile'].head(12)
Out[5]:
kind feature value n effect p q
number n_tm higher 135 0.355 1.17e-102 4.3e-100
number is_tm higher 135 0.33 1.05e-89 1.93e-87
layer struct denser inside 78 4.41 7.54e-78 9.28e-76
category dtm_class TM 103 2.44 2.97e-61 2.74e-59
layer domain denser inside 46 3.81 4.69e-39 3.46e-37
number rna245775_eif12ko_tachy_r1 higher 134 0.236 5.18e-21 3.19e-19
number rna245775_eif12ko_tachy_r2 higher 134 0.235 7.36e-21 3.88e-19
number stress_7-1_unstress_red_24 higher 134 0.235 8.53e-21 3.94e-19
number stress_6-1_unstress_red_24 higher 134 0.234 1.63e-20 6.67e-19
number rna245775_eif12ko_tachy_r3 higher 134 0.232 1.94e-20 7.17e-19
number rna245775_eif12ko_prebrady_r1 higher 134 0.225 2.72e-19 9.13e-18
number rna245775_eif12ko_prebrady_r3 higher 134 0.222 1.05e-18 3.24e-17
In [6]:
grown = S.run('seed_expansion', genes=genes, exclude='compartment')grown.tables['candidates'].head(8)
Out[6]:
gene_id product score direct_links_to_list
TGME49_257120 sugar transporter ST1 0.000515 domain 1, orthogroup 1, struct 13
TGME49_288920 ATP-binding cassette G family transporter ABCG96 0.000462 coexpression 1, domain 2, orthogroup 2, struct 2
TGME49_315560 ATP-binding cassette G family transporter ABCG77 0.000422 domain 1, orthogroup 2, struct 2
TGME49_229170 formate/nitrite transporter FNT3 0.000415 cofitness 1, orthogroup 2, struct 2
TGME49_305180 Na+/H+ exchanger NHE3 0.000401 domain 1, orthogroup 1
TGME49_238160 hypothetical protein 0.000388 orthogroup 1, struct 2
TGME49_299060 sodium/hydrogen exchanger NHE2 0.000387 cofitness 2, domain 1, orthogroup 1
TGME49_216710 apicomplexan amino acid transporter ApiAT5-4 0.000382 cofitness 1, domain 7, orthogroup 1, struct 8

Is my list coherent enough?

With twenty or more genes, the self-test of a list strategy hides 30% of YOUR list and asks whether the rest recovers it.

In [7]:
S.test('seed_expansion', genes=genes, exclude='compartment')
Out[7]:

PASS -- AUROC of hidden members against every other gene 0.824 against 0.495 ± 0.033 under 10 random sets of the same size (bar 0.532, p 0.0909); effect +0.329, needed +0.100; 40 hidden

Hidden: 30% of your list of 135 genes (135 genes). Null: 10 random sets of the same size.

Scorecard (ranking)

AUROC0.824
AUPRC0.071
AUPRC lift14.180
Prevalence0.005
Partial AUROC (FPR <= 10%)0.695
R-precision0.100
Precision @ top 1%0.148
Enrichment @ top 1%29.796
Recall @ top 10%0.525
Best F10.211
nDCG0.477