Bases: object
Estimate the modality of a splicing event
This is based off of the “percent spliced-in” (PSI) score of a splicing event, for example in a cassette exon event, how many transcripts use the cassette exon gives the “PSI” (\(\Psi\)) score of that splicing event
Possible modalities include: - Excluded (most cells have excluded the exon) - Middle (most cells have both the included and excluded isoforms) - Included (most cells have included the exon) - Bimodal (approximately a 50:50 distribution of inclusoion:exclusion) - Uniform (uniform distribution of exon usage)
The way that these modalities are calculated is by binning each splicing event across all cells from (0, excluded_max, included_min, 1), and finding the Jensen-Shannon Divergence that event, and each of the five modalities
| Parameters: | excluded_max : float, optional (default=0.2)
included_min : float, optional (default=0.8)
|
|---|
Return the modality with the smallest square root JSD to each event
| Parameters: | sqrt_jsd_modalities : pandas.DataFrame
|
|---|---|
| Returns: | assignments : pandas.Series
|
Return the number of events in each modality category
| Parameters: | psi : pandas.DataFrame
|
|---|---|
| Returns: | counts : pandas.Series
|
Given psi scores, estimate the modality of each
| Parameters: | data : pandas.DataFrame
bootstrapped : bool
bootstrappped_kws : dict
|
|---|---|
| Returns: | assignments : pandas.Series
|
Calculate JSD between all binned splicing events and true modalities
Use square root of JSD because it’s a metric.
| Parameters: | binned : pandas.DataFrame
|
|---|---|
| Returns: | sqrt_jsd : pandas.DataFrame
|
Apply switchy scores to a 2D array of data scores
| Parameters: | x : numpy.array
|
|---|---|
| Returns: | numpy.array
|
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
|
|---|---|
| Returns: | float
|