flotilla.visualize package

Module contents

plotting tools

class flotilla.visualize.Interactive(*args, **kwargs)

Bases: object

static get_feature_subsets(study, data_types)

Given a study and list of data types, get the relevant feature subsets

Parameters:

study : flotilla.Study

A study object which

static interactive_choose_outliers(data_types=('expression', 'splicing'), sample_subsets=None, feature_subsets=None, featurewise=False, x_pc=(1, 3), y_pc=(1, 3), show_point_labels=False, kernel=('rbf', 'linear', 'poly', 'sigmoid'), gamma=(0, 25), nu=(0.1, 9.9))
static interactive_classifier(data_types=('expression', 'splicing'), sample_subsets=None, feature_subsets=None, categorical_variables=None, predictor_types=None, score_coefficient=(0.1, 20), draw_labels=False)
static interactive_clustermap()
static interactive_correlations()
static interactive_graph(data_types=('expression', 'splicing'), sample_subsets=None, feature_subsets=None, featurewise=False, cov_std_cut=(0.1, 3), degree_cut=(0, 10), n_pcs=(2, 100), draw_labels=False, feature_of_interest='RBFOX2', weight_fun=None, use_pc_1=True, use_pc_2=True, use_pc_3=True, use_pc_4=True, savefile='figures/last.graph.pdf')
static interactive_lavalamp_pooled_inconsistent(sample_subsets=None, feature_subsets=None, difference_threshold=(0.001, 1.0), colors=['red', 'green', 'blue', 'purple', 'yellow'], savefile='')
static interactive_localZ()
static interactive_pca(data_types=('expression', 'splicing'), sample_subsets=None, feature_subsets=None, color_samples_by=None, featurewise=False, x_pc=(1, 10), y_pc=(1, 10), show_point_labels=False, list_link='', plot_violins=False, scale_by_variance=True, savefile='figures/last.pca.pdf')
static interactive_plot_modalities_lavalamps(sample_subsets=None, feature_subsets=None, color=u'#e41a1c', x_offset=0, use_these_modalities=True, bootstrapped=False, bootstrapped_kws=None, savefile='')
static interactive_reset_outliers()

User selects from columns that start with ‘outlier_‘ to merge multiple outlier classifications

class flotilla.visualize.PredictorBaseViz(predictor_name, data_name, trait_name, X_data=None, trait=None, predictor_obj=None, predictor_scoring_fun=None, score_cutoff_fun=None, n_features_dependent_kwargs=None, constant_kwargs=None, is_categorical_trait=None, predictor_dataset_manager=None, predictor_config_manager=None, feature_renamer=None, groupby=None, color=None, pooled=None, order=None, violinplot_kws=None, data_type=None, label_to_color=None, label_to_marker=None, singles=None, outliers=None)

Bases: flotilla.compute.predict.PredictorBase

A dataset-predictor pair from PredictorDatasetManager

One datset, one predictor, from dataset manager.

Parameters:

predictor_name : str

Name for predictor

data_name : str

Name for this (subset of the) data

trait_name : str

Name for this trait

X_data : pandas.DataFrame, optional

Samples-by-features (row x col) dataset to train the predictor on

trait : pandas.Series, optional

A variable you want to predict using X_data. Indexed like X_data.

predictor_obj : sklearn predictor, optional

A scikit-learn predictor that implements fit and score on (X_data,trait) Default ExtraTreesClassifier

predictor_scoring_fun : function, optional

Function to get the feature scores for a scikit-learn classifier. This can be different for different classifiers, e.g. for a classifier named “x” it could be x.scores_, for other it’s x.feature_importances_. Default: lambda x: x.feature_importances_

score_cutoff_fun : function, optional

Function to cut off insignificant scores Default: lambda scores: np.mean(x) + 2 * np.std(x)

n_features_dependent_kwargs : dict, optional

kwargs to the predictor that depend on n_features Default: {}

constant_kwargs : dict, optional

kwargs to the predictor that are constant, i.e.: {‘n_estimators’: 100, ‘bootstrap’: True, ‘max_features’: ‘auto’, ‘random_state’: 0, ‘oob_score’: True, ‘n_jobs’: 2, ‘verbose’: True}

do_pca(**plotting_kwargs)
plot(**pca_plotting_kwargs)
plot_scores(ax=None)

plot kernel density of predictor scores and draw a vertical line where the cutoff was selected ax - ax to plot on. if None: plt.gca()

set_reducer_plotting_args(rpa)
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.