Edit on GitHub

starplast.strategy_graph

Strategies 33 and 34: one integrated neighbour space, and the edges the networks are missing.

Two additions to the catalogue, both built on graphspace, both in the eighth family ("Combine strategies") because that is their mechanism: every other network strategy reads ONE layer, and these two put every permitted layer and the measurement table into a single graph.

33  Read a gene's neighbourhood in the integrated space
34  Train on the networks and rank the edges they are missing

They share a self-test, and it is not the one strategy 16 uses. Strategy 16 scores held-out crosslinks against RANDOM non-pairs and reports AUROC 0.97; most of that number is the discovery that well-connected genes are well connected, since a random pair of genes is a pair of obscure genes. Here the hidden edges are scored against DEGREE-MATCHED non-pairs -- a non-pair with a gene of similar connectivity at both ends -- and the null re-run for the bar is a configuration model: the hidden edges' own degree sequence, rewired. A model that has learned fame scores the rewired pairs as highly as the real ones and fails. Both easy numbers are still computed and reported beside the hard one, in numbers, because the gap between them is a quantity a reader deserves rather than a detail.

Edges are hidden by orthogroup, never at random, so a hidden edge cannot be recovered through a paralog that stayed visible; and the layer being predicted is removed from its own features, which is the rule graphspace enforces in one place and these two strategies inherit.

COMBINE = 'Combine strategies'
EXCLUDE = Param(name='exclude', kind='category', label='Label being held out', tip='A label this space must stay blind to, if the neighbourhoods are going to be used while scoring that label. Its whole closure is applied: the column, anything restating it, the experiment that produced it, and any edge layer built from it.', default=None, lo=0, hi=0, step=1, choices=(), optional=True, space='this')
KNN = Param(name='knn', kind='int', label='Nearest genes per gene', tip='How many nearest genes in measurement space become candidate neighbours for each gene, on top of its partners in every layer. This is what lets the space speak about a pair no network touches at all; zero restricts it to pairs some layer already links.', default=15, lo=0, hi=100, step=1, choices=(), optional=False, space='this')
PER_LAYER = Param(name='per_layer', kind='int', label='Neighbours kept per layer', tip='How many partners per gene are kept from each layer, strongest weight first. A dense layer such as the shared-compartment one would otherwise supply more than a hundred thousand pairs that all make the same claim.', default=25, lo=5, hi=200, step=5, choices=(), optional=False, space='this')
LAYER = Param(name='layer', kind='layer', label='Layer to hide in the self-test', tip="Which layer's edges are hidden and asked back when the strategy tests itself. It is removed from its own features, so the question is whether the OTHER evidence finds its edges; a dense layer gives a stricter test than a sparse one.", default=<function _layer_default>, lo=0, hi=0, step=1, choices=(), optional=False, space='this')