pheno_tool_api package

Subpackages

Submodules

pheno_tool_api.adapter module

class pheno_tool_api.adapter.PhenoToolAdapter(study: WDAEStudy)[source]

Bases: PhenoToolAdapterBase

Adapter for PhenoTool class.

static align_na_results(results: list[dict[str, Any]]) None[source]

Align NA results.

build_report_description(measure_id: str, normalize_by: Any) str[source]

Build a description for a report.

calc_by_effect(measure_id: str, effect: str, people_variants: Counter, *, person_ids: list[str] | None = None, family_ids: list[str] | None = None, normalize_by: list[dict[str, str]] | None = None) dict[str, Any][source]

Run the base pheno tool calc on given variant counts.

calc_variants(query_data: dict[str, Any]) dict[str, Any][source]

Run pheno tool on given data.

get_result_by_sex(result: dict[str, PhenoResult], sex: str) dict[str, Any][source]
static make_tool(study: WDAEAbstractStudy) GPFTool | None[source]
produce_download_df(query_data: dict[str, Any]) DataFrame[source]

Produce dataframe for pheno tool download.

class pheno_tool_api.adapter.PhenoToolAdapterBase[source]

Bases: GPFTool

Base class for pheno tool adapters.

abstract calc_variants(query_data: dict[str, Any]) dict[str, Any][source]

Return pheno tool result for given variants.

abstract produce_download_df(query_data: dict[str, Any]) DataFrame[source]

Produce dataframe for pheno tool download.

pheno_tool_api.urls module

pheno_tool_api.views module

class pheno_tool_api.views.PhenoToolDownload[source]

Bases: PhenoToolView, DatasetAccessRightsView

Pheno tool download view.

generate_columns(query_data: dict[str, Any], adapter: PhenoToolAdapter) Generator[str, None, None][source]

Pheno tool download generator function.

post(request: Request) Response | StreamingHttpResponse[source]

Pheno tool download.

class pheno_tool_api.views.PhenoToolInstruments[source]

Bases: QueryBaseView, DatasetAccessRightsView

get(request: Request) Response[source]
measure_to_json(measure: Measure) dict[source]
class pheno_tool_api.views.PhenoToolMeasure[source]

Bases: QueryBaseView, DatasetAccessRightsView

get(request: Request) Response[source]
class pheno_tool_api.views.PhenoToolMeasures[source]

Bases: QueryBaseView, DatasetAccessRightsView

get(request: Request) Response[source]
class pheno_tool_api.views.PhenoToolPeopleValues[source]

Bases: QueryBaseView, DatasetAccessRightsView

View for returning person phenotype data.

post(request: Request) Response[source]
class pheno_tool_api.views.PhenoToolView[source]

Bases: QueryBaseView

View for returning pheno tool results.

static get_result_by_sex(result: dict[str, PhenoResult], sex: str) dict[str, Any][source]
post(request: Request) Response | StreamingHttpResponse[source]

Return pheno tool results based on POST request.

Module contents