@jax-data-science/api-clients 0.0.1-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,27 @@
1
+ export interface OntologyConfig {
2
+ name: string;
3
+ prefix: string;
4
+ github: {
5
+ api: string;
6
+ home: string;
7
+ };
8
+ home: string;
9
+ api: {
10
+ docs: string;
11
+ base: string;
12
+ };
13
+ base_file: string;
14
+ international: boolean;
15
+ description: string;
16
+ }
17
+ export declare enum Ontology {
18
+ HP = "HP",
19
+ MONDO = "MONDO",
20
+ MP = "MP",
21
+ CL = "CL",
22
+ MAXO = "MAXO"
23
+ }
24
+ export interface OntologyTerm {
25
+ id: string;
26
+ name: string;
27
+ }
@@ -0,0 +1,56 @@
1
+ import { HttpClient } from '@angular/common/http';
2
+ import { Observable } from 'rxjs';
3
+ import { Ontology, OntologyTerm } from './ontology.model';
4
+ import { CollectionResponse, Response } from '../models/response';
5
+ import * as i0 from "@angular/core";
6
+ export declare class OntologyService {
7
+ private httpClient;
8
+ config_location: string;
9
+ private config;
10
+ /**
11
+ * Get the configuration file from the source for the backend api service
12
+ */
13
+ constructor(httpClient: HttpClient);
14
+ /**
15
+ * Search for terms in an ontology
16
+ * @param query - the search query
17
+ * @param limit - the number of results to return
18
+ * @param ontology - the ontology to search
19
+ */
20
+ search(query: string, limit: number, ontology: Ontology): Observable<CollectionResponse<OntologyTerm>>;
21
+ /**
22
+ * Get a term by its ID
23
+ * @param id - the term ID
24
+ */
25
+ term(id: string): Observable<Response<OntologyTerm>>;
26
+ /**
27
+ * Get the parents of a term
28
+ * @param id - the term ID
29
+ */
30
+ parents(id: string): Observable<CollectionResponse<OntologyTerm>>;
31
+ /**
32
+ * Get the children of a term
33
+ * @param id - the term ID
34
+ */
35
+ children(id: string): Observable<CollectionResponse<OntologyTerm>>;
36
+ /**
37
+ * Get the ancestors of a term
38
+ * @param id - the term ID
39
+ */
40
+ ancestors(id: string): Observable<CollectionResponse<OntologyTerm>>;
41
+ /**
42
+ * Get the descendants of a term
43
+ * @param id - the term ID
44
+ */
45
+ descendants(id: string): Observable<CollectionResponse<OntologyTerm>>;
46
+ /**
47
+ * Get the ontology from curie
48
+ */
49
+ ontologyFromCurie(curie: string): Ontology;
50
+ /**
51
+ * Get the ontology api base url configuration
52
+ **/
53
+ ontologyBaseResolver(ontology: Ontology): string;
54
+ static ɵfac: i0.ɵɵFactoryDeclaration<OntologyService, never>;
55
+ static ɵprov: i0.ɵɵInjectableDeclaration<OntologyService>;
56
+ }
@@ -0,0 +1,95 @@
1
+ import { SNP, SNPSearchRegion } from "../../../mvar/models/response/dtos";
2
+ export interface MusterHealthCheck {
3
+ status: string;
4
+ timestamp: string;
5
+ }
6
+ export interface MusterMetadata {
7
+ total_number_of_SNPs: number;
8
+ last_updated: string;
9
+ version: string;
10
+ total_number_of_strains: number;
11
+ }
12
+ export interface Strain {
13
+ bq_sample_id: number;
14
+ mpd_strainid: number;
15
+ strainname: string;
16
+ straintype: string;
17
+ }
18
+ export interface Gene {
19
+ symbol: string;
20
+ chr: string;
21
+ start_position: number;
22
+ end_position: number;
23
+ strand: string;
24
+ description: string;
25
+ mginum: string;
26
+ markertype: string;
27
+ centimorgan: number;
28
+ featuretype: string;
29
+ }
30
+ export interface ReferenceSNP {
31
+ chr: string;
32
+ start_position: number;
33
+ end_position?: number;
34
+ rsid: string;
35
+ }
36
+ export interface MusterSearchParameters {
37
+ bq_sample_ids: null;
38
+ genes: string | null;
39
+ genes_data: Gene[];
40
+ limit: number;
41
+ mpd_strain_ids: string;
42
+ next_region: string | null;
43
+ offset: number;
44
+ query_regions: {
45
+ chromosome: string;
46
+ regions: SNPSearchRegion[];
47
+ }[];
48
+ regions: SNPSearchRegion[];
49
+ rsids: string | null;
50
+ rsids_data: ReferenceSNP[];
51
+ strain_limit: number;
52
+ strain_names: null;
53
+ dataset: Dataset;
54
+ }
55
+ export interface SNPSearchProperties {
56
+ strains: number[];
57
+ strains_b?: number[];
58
+ rsids?: string[];
59
+ regions?: string[];
60
+ assembly: string;
61
+ genes?: string[];
62
+ offset?: number;
63
+ dataset_id?: number;
64
+ is_unique_row?: boolean;
65
+ }
66
+ export interface GenotypeResults {
67
+ message: string | null;
68
+ next_region: string;
69
+ parameter: MusterSearchParameters;
70
+ snps: SNP[];
71
+ status: string;
72
+ total_rows: number;
73
+ }
74
+ export declare enum DatasetStatus {
75
+ Queued = "queued",
76
+ Loading = "loading",
77
+ Done = "done",
78
+ Archived = "archived"
79
+ }
80
+ export interface Dataset {
81
+ id: number;
82
+ display_name: string;
83
+ sort_by: number;
84
+ year: string;
85
+ procedure: string;
86
+ panel: string;
87
+ sex: string;
88
+ dataset_name: string;
89
+ source: string;
90
+ status: DatasetStatus;
91
+ num_of_strains: number;
92
+ pubmed: string;
93
+ description: string;
94
+ assembly_version: string;
95
+ }
@@ -0,0 +1,9 @@
1
+ import { ModuleWithProviders } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ import * as i1 from "@angular/common";
4
+ export declare class SnpGridClientModule {
5
+ static forRoot(environment: any): ModuleWithProviders<SnpGridClientModule>;
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<SnpGridClientModule, never>;
7
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SnpGridClientModule, never, [typeof i1.CommonModule], never>;
8
+ static ɵinj: i0.ɵɵInjectorDeclaration<SnpGridClientModule>;
9
+ }
@@ -0,0 +1,97 @@
1
+ import { HttpClient } from "@angular/common/http";
2
+ import { Observable } from "rxjs";
3
+ import { Dataset, DatasetStatus, Gene, GenotypeResults, MusterHealthCheck, MusterMetadata, ReferenceSNP, SNPSearchProperties, Strain } from './models/response/dtos';
4
+ import { SNPSearchRegion } from '../mvar/models/response/dtos';
5
+ import * as i0 from "@angular/core";
6
+ export declare class SnpGridService {
7
+ private http;
8
+ private environment;
9
+ private api;
10
+ apiAvailable: boolean;
11
+ private strains;
12
+ strains$: Observable<Strain[]>;
13
+ constructor(http: HttpClient, environment: any);
14
+ /**
15
+ * Returns the result of a health check for the API
16
+ */
17
+ getHealthCheck(): Observable<MusterHealthCheck>;
18
+ /**
19
+ * Returns the metadata on the MUSter DB
20
+ */
21
+ getMusterMetadata(): Observable<MusterMetadata>;
22
+ /**
23
+ * Returns strains available in the API and takes an optional limit; by default the limit is set
24
+ * to 5000 to get all strains
25
+ * @param limit - maximum number of strains to be returned
26
+ */
27
+ getStrains(limit?: number): Observable<Strain[]>;
28
+ /**
29
+ * Returns a list of known genes whose symbols/coordinates start with the specified value.
30
+ * @param searchValue - value to use for the "starts with" filter
31
+ * @param limit - maximum number of genes to return, default is 20
32
+ */
33
+ getGenes(searchValue: string, limit?: number): Observable<Gene[]>;
34
+ /**
35
+ * Returns the gene that matches the specified gene symbol
36
+ * @param geneSymbol - symbol to use to get the associated gene info
37
+ */
38
+ getGene(geneSymbol: string): Observable<Gene | null>;
39
+ /**
40
+ * Returns true if the specified gene symbol is valid from the perspective of MUSter
41
+ * @param geneSymbol - symbol to use to check the validity of
42
+ */
43
+ isGeneSymbolValid(geneSymbol: string): Observable<boolean>;
44
+ /**
45
+ * Returns list of known reference SNP (RS) data which includes IDs and coordinates
46
+ * @param searchValue - value to use to filter the search results
47
+ * @param limit - maximum number of results to return, default is 20
48
+ */
49
+ getReferenceSNPs(searchValue: string, limit?: number): Observable<ReferenceSNP[]>;
50
+ /**
51
+ * Returns the RS info that matches the specified rsID
52
+ * @param rsid - the RSID to use to get the associated RS info
53
+ */
54
+ getReferenceSNP(rsid: string): Observable<ReferenceSNP | null>;
55
+ /**
56
+ * Returns true if the specified rsID is valid from the perspective of MUSter
57
+ * @param rsid - rsID to use to check the validity of
58
+ */
59
+ isRSIDValid(rsid: string): Observable<boolean>;
60
+ /**
61
+ * Returns the SNP results generated from the query constructed from the specified parameters and page
62
+ * @param parameters - search properties (strain IDs, regions, assembly version, etc.)
63
+ * @param page - requested page, which is 0-indexed. The 0th page is the initial page
64
+ * @param pageSize - number of records to show per page. Default of 5000
65
+ */
66
+ getGenotypes(parameters: SNPSearchProperties, page?: number, pageSize?: number): Observable<GenotypeResults>;
67
+ /**
68
+ * Returns the URL that will generate a download (in file form) for the specified strain IDs and regions
69
+ * @param strains - list of mpd_strain_ids to query SNPs for
70
+ * @param regions - list of SNPSearchRegions to query SNPs for (chromosome, start and end)
71
+ * @param dataset_id - ID of the dataset to query SNPs for
72
+ * @param is_unique_row - boolean for polymorphism filtering - true for only rows with polymorphism, false for all
73
+ * @param limit - the limit of the number of result rows to include in the download - you're likely to
74
+ * prefer to pass the total number of rows generated by the query itself, which is included
75
+ * as part of the GenotypeResults returned by getGenotypes()
76
+ */
77
+ getGenotypeDownloadURLForCurrentData(strains: number[], regions: SNPSearchRegion[], dataset_id: number | undefined, is_unique_row: boolean | undefined, limit: number): string;
78
+ /**
79
+ * Returns the dataset with the given ID
80
+ * @param id
81
+ */
82
+ getDataset(id: number): Observable<Dataset>;
83
+ /**
84
+ * Returns a list of Datasets that match the given criteria
85
+ * @param status The value of the status to be used for filtering
86
+ * @param limit The maximum number of records to return
87
+ */
88
+ findDatasets(status: DatasetStatus, limit?: number): Observable<Dataset[]>;
89
+ /**
90
+ * Return a list of strains that match the given criteria
91
+ * @param datasetId The ID of the dataset from which to fetch the strains
92
+ * @param limit The maximum number of records to return
93
+ */
94
+ datasetStrains(datasetId: number, limit?: number): Observable<Strain[]>;
95
+ static ɵfac: i0.ɵɵFactoryDeclaration<SnpGridService, never>;
96
+ static ɵprov: i0.ɵɵInjectableDeclaration<SnpGridService>;
97
+ }
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@jax-data-science/api-clients",
3
+ "version": "0.0.1-0",
4
+ "dependencies": {
5
+ "@microsoft/fetch-event-source": "^2.0.1",
6
+ "rxjs": "^7.8.0",
7
+ "tslib": "^2.3.0"
8
+ },
9
+ "peerDependencies": {
10
+ "@angular/common": "^19.1.0",
11
+ "@angular/core": "^19.1.0"
12
+ },
13
+ "sideEffects": false,
14
+ "publishConfig": {
15
+ "access": "public"
16
+ },
17
+ "module": "fesm2022/jax-data-science-api-clients.mjs",
18
+ "typings": "index.d.ts",
19
+ "exports": {
20
+ "./package.json": {
21
+ "default": "./package.json"
22
+ },
23
+ ".": {
24
+ "types": "./index.d.ts",
25
+ "default": "./fesm2022/jax-data-science-api-clients.mjs"
26
+ }
27
+ }
28
+ }