Skip to content

Latest commit

 

History

History
37 lines (33 loc) · 1.46 KB

README.md

File metadata and controls

37 lines (33 loc) · 1.46 KB

Build Status

vip-report-api

Report data API for Variant Call Format (VCF) Report templates (see https://github.com/molgenis/vip-report-template).

Usage

This repository provides an API to query report data:

export interface Api {
  getRecordsMeta(): Promise<RecordMetadata>;
  getRecords(params: Params): Promise<PagedItems<Record>>;
  getRecordById(id: number): Promise<Item<Record>>;
  getSamples(params: Params): Promise<PagedItems<Sample>>;
  getSampleById(id: number): Promise<Item<Sample>>;
  getPhenotypes(params: Params): Promise<PagedItems<Phenotype>>;
  getFastaGz(contig: string, pos: number): Promise<Uint8Array | null>;
  getGenesGz(): Promise<Uint8Array | null>;
  getCram(sampleId: string): Promise<Cram | null>;
  getHtsFileMetadata(): Promise<HtsFileMetadata>;
  getAppMetadata(): Promise<AppMetadata>;
  getDecisionTree(): Promise<DecisionTree | null>;
}

The API can be used through either the ApiClient class or the WindowApiClient class. The ApiClient is backed by an object containing all report data whereas the WindowApiClient is backed by window.api.

import { ApiClient } from './ApiClient';
import { Api } from './Api';

const reportData = { ... };
const apiClient: Api = new ApiClient();
import { WindowApiClient } from './WindowApiClient';
import { Api } from './Api';

const apiClient: Api = WindowApiClient();