API Documentation¶
Backend¶
This module is a flask backend providing a REST api to add interactivity to the report.
The backend needs to be able to restore the phenotype database functionality and be able to generate plots.
These methods will return json to the report. Alternatively, they will return the native python objects. This way, the functionality will all be here and everything that’s related to the report’s content and formatting will be in the report module.
-
class
forward.backend.
Backend
(experiment_name)[source]¶ Class that provides all api functionality to be used for both report creation and the rest api.
-
get_outcome_vector
(variable, transformation=None, nan=True)[source]¶ Get an outcome vector (y).
Parameters: Note
This is parsed from the hdf5 file that is automatically created.
Get information on the exclusions based on phenotype correlation.
-
get_results
(task, filters=[], order_by=None, ascending=True)[source]¶ Get the results for a specific analysis.
-
get_variable_histogram
(variable, transformation=None, **kwargs)[source]¶ Get the bin counts for a given variable.
This returns the numpy histogram’s function values.
-
get_variable_normal_qqplot
(variable, transformation=None)[source]¶ Get scatter values for a normal QQ plot associated with a variable.
-
get_variables
(var_type=None, order_by=None, ascending=True)[source]¶ Get the variables that were analysed in the experiment.
Parameters:
-
p_value_qq_plot
(task)[source]¶ Return the scatter data and confidence bands.
This is assuming we’re expecting a uniform distribution. We also take a log transform to accentuate small differences.
out = { "ci": [(ci_low, ci_high)], "outcomes": ["phen1", "phen2", ...], "expected": [exp1, exp2, ...], "lines": { "phen1": [obs1, obs2, ...], "phen2": [obs1, obs2, ...], ... } }
-