flotilla.compute.splicing module

Calculate modalities of splicing events.

class flotilla.compute.splicing.ModalityEstimator(step, vmax, logbf_thresh=3)[source]

Bases: object

Use Bayesian methods to estimate modalities of splicing events

Initialize an object with models to estimate splicing modality

Parameters:

step : float

Distance between parameter values

vmax : float

Maximum parameter value

logbf_thresh : float

Minimum threshold at which the bayes factor difference is defined to be significant

fit_transform(data)[source]

Get the modality assignments of each splicing event in the data

Parameters:

data : pandas.DataFrame

A (n_samples, n_events) dataframe of splicing events’ PSI scores. Must be psi scores which range from 0 to 1

Returns:

modality_assignments : pandas.Series

A (n_events,) series of the estimated modality for each splicing event

Raises:

AssertionError

If data does not fall only between 0 and 1.

class flotilla.compute.splicing.ModalityModel(alphas, betas)[source]

Bases: object

Object to model modalities from beta distributions

logliks(x)[source]
logsumexp_logliks(x)[source]
flotilla.compute.splicing.get_switchy_score_order(x)[source]

Apply switchy scores to a 2D array of data scores

Parameters:

x : numpy.array

A 2-D numpy array in the shape [n_events, n_samples]

Returns:

score_order : numpy.array

A 1-D array of the ordered indices, in switchy score order

flotilla.compute.splicing.switchy_score(array)[source]

Transform a 1D array of data scores to a vector of “switchy scores”

Calculates std deviation and mean of sine- and cosine-transformed versions of the array. Better than sorting by just the mean which doesn’t push the really lowly variant events to the ends.

Parameters:

array : numpy.array

A 1-D numpy array or something that could be cast as such (like a list)

Returns:

switchy_score : float

The “switchy score” of the study_data which can then be compared to other splicing event study_data

Olga B. Botvinnik is funded by the NDSEG fellowship and is a NumFOCUS John Hunter Technology Fellow.
Michael T. Lovci was partially funded by a fellowship from Genentech.
Partially funded by NIH grants NS075449 and HG004659 and CIRM grants RB4-06045 and TR3-05676 to Gene Yeo.