@molgenis/vip-report-api

5.0.3 • Public • Published

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(); 

Readme

Keywords

none

Package Sidebar

Install

npm i @molgenis/vip-report-api

Weekly Downloads

67

Version

5.0.3

License

LGPL-3.0

Unpacked Size

77.8 kB

Total Files

28

Last publish

Collaborators

  • molgenis-npm
  • dennis.hendriksen
  • fdlk
  • coonnor
  • sidohaakma