Objectoriented API
This is a more indepth interface to SCA, allowing the user to define and construct arbitrary embedding strategies. There are three components to SCA’s workflow, each represented by a Python class:
Connectors accept data in some representation, and calculate the nearest neighbors of each observation. For example, the
MetricConnector
withmetric=euclidean
computes neighbors using Euclidean distance.Scorers accept a representation of the data and a list of neighbors for each observation, and compute scores indicating, for each observation and each feature in the input representation, the degree of over or underexpression locally. For example, the
WilcoxonScorer
performs a Wilcoxon ranksum test for each feature’s over or underexpression in the neighborhood of each observation, and takes the negative log pvalue as the score.Correctors transform probabilities to account for multiple testing. For example, the
FWERCorrector
performs familywise error rate correction.Embedders compute lowdimensional embeddings of the input data, possibly using the above tools. For example, the
SVDEmbedder
projects the data onto the top right singular vectors. TheSCAEmbedder
first uses anSVDEmbedder
to make the initial embedding, computes neighborhoods using aConnector
on this representation, computes scores using aScorer
on the neighborhoods, and performs SVD on the resulting score matrix to obtain axes for projection.
This objectoriented framework allows the user to easily swap out different strategies for base embedding generation, neighborhood construction, and score computation. The toplevel API uses this framework under the hood.
Embedders
An Embedder
produces lowdimensional representations of data via the method embed
. They include SVDEmbedders
and SCAEmbedders
.
Base class for Embedders. 


Embedder that performs SCA on the input. 

Embedder that projects data to its top right singular vectors. 
Scorers
A Scorer
takes a representation of data and a list of neighborhoods for each observation, and computes significance scores for each feature in the neighborhood of each observation. These can be used to compute embeddings, as the SCAEmbedder
does, or simply as an alternate featurization.









Connectors
A Connector
takes a representation of data and computes neighborhoods of each observation.
Base class for Connectors. 


Make neighborhoods of observations using a metric on the input data. 
Correctors
Correctors
accept matrices or arrays of probabilities, and correct them according to some multiple testing correction scheme.

Performs familywise error rate correction on input pvalues 