Eigen

A method for MDS via Singular Value Decomposition on phip-seq datasets.

phippery.eigen.eigenassay_projections(ds, data_table='counts', compute_correlations=False, return_raw_decomposition=False, n_eigenvectors=None)[source]

Compute the Singular Value Decomposition of the enrichment data before projecting each sample into the first n eigenvectors (“eigenassays”) in the dataset.

Concretely, given a Matrix of, \(X\) enrichments in the phippery dataset with shape (peptides, samples). We compute the decomposition \(X = USV^{T}\)

The principal axes in feature space are then represented by the columns of \(V\) and represent the direction of maximum variance in the data. The sample projections into this space are then computed and tied to the sample annotation in the returned dictionary.

Parameters:
  • ds (xarray.DataSet) – The dataset you would like to perform eigen-decomposition on.

  • data_table (str) – The name of the enrichment layer in the phippery dataset to perform the operation on.

  • compute_correlations (bool) – If true, compute the correlation of a sample’s true binding enrichments to the n’th principal axes. These will be added in the same fashion as the sample scores that are appended to the sample table.

  • return_raw_decomposition (bool) – If true, include the raw \(USV^{T}\) decomposition of the enrichment matrix specified

  • n_eigenvectors (int) – the number of projections “eigenassay dimensions” to include.

Returns:

  1. The eigenassay projects tied with the appended to sample annotations

    included in ds.

  2. (optional) The raw “economy” SVD decomposition matrices.

Return type:

dict