disbi.views module

DISBi views that need to subclassed and configured with the appropriate experiment models by a concrete app.

class disbi.views.DisbiCalculateFoldChangeView(**kwargs)[source]

Bases: django.views.generic.base.View

View for calculating the fold change between two experiments.

experiment_meta_model = None
experiment_model = None
post(request, exp_id_str)[source]

Return new data for the datatable with new columns for calculated fold changes.

Parameters:
  • request – The WSGI request.
  • exp_id_str – The ids of all requested experiments from the table view joined on “_”.
Returns:

JSONResponse – The new data for the datatable or the error message.

class disbi.views.DisbiComparePlotView(**kwargs)[source]

Bases: django.views.generic.base.View

View for generating a scatter plot that compares two experiments.

experiment_meta_model = None
experiment_model = None
post(request, exp_id_str)[source]

Get the scatter plot comparing two experiments.

If the data model of the two experiments matches, a plot is generated, else an error message is raised.

Parameters:
  • request – The WSGI request.
  • exp_id_str – The ids of all requested experiments from the table view joined on “_”.
Returns:

JSONResponse – The plot image SVG or the error message.

class disbi.views.DisbiDataView(**kwargs)[source]

Bases: django.views.generic.base.View

View for creating the the basic data view without the data table.

experiment_meta_model = None
get(request, exp_id_str)[source]

View for creating and displaying the result table.

Parameters:
  • request – The WSGI request.
  • exp_id_str – The ids of all requested experiments from the table view joined on “_”.
Returns:

TemplateResponse – The template for the data view with the appropriate form and the result table with information about the experiments.

class disbi.views.DisbiDistributionPlotView(**kwargs)[source]

Bases: django.views.generic.base.View

View for generating a histogram of the distribution of a column in the data table.

experiment_meta_model = None
experiment_model = None
post(request, exp_id_str)[source]

Get the distribution of a column as a histogram.

If a non fold change column is plotted the matching data is fetched from the DB with the ORM. If a fold change column is selected, a new DataResult object is instantiated and only the fold change column is retrieved from the result table cached in the DB.

Parameters:
  • request – The WSGI request.
  • exp_id_str – The ids of all requested experiments from the table view joined on “_”.
Returns:

JSONResponse – The plot image SVG or the error message.

class disbi.views.DisbiExpInfoView(**kwargs)[source]

Bases: django.views.generic.base.View

View for getting information about the experiments in the preview table.

experiment_model = None
post(request)[source]

Get information about matched experiments.

Parameters:request – The WSGI request.
Returns:JSONResponse – JSON object with number of matched experiments and a HTML table with information about those experiments.
class disbi.views.DisbiExperimentFilterView(**kwargs)[source]

Bases: django.views.generic.base.View

View for showing dynamic formsets, allowing to choose all combinations.

experiment_model = None
get(request)[source]
Returns:TemplateResponse – The rendered forms without initial data.
post(request)[source]

HttpResponseRedirect: For valid POST requests the client will be redirected to the appropriate data view.

class disbi.views.DisbiGetTableData(**kwargs)[source]

Bases: django.views.generic.base.View

View for initially getting the data for the datatable.

experiment_meta_model = None
get(request, exp_id_str)[source]

Return new data for the datatable with new columns for calculated fold changes.

Parameters:
  • request – The WSGI request.
  • exp_id_str – The ids of all requested experiments from the table view joined on “_”.
Returns:

JSONResponse – The data for the datatable.