diff --git a/apps/agora/api/src/api.ts b/apps/agora/api/src/api.ts index a12543b54f..f1ff703a98 100644 --- a/apps/agora/api/src/api.ts +++ b/apps/agora/api/src/api.ts @@ -1,7 +1,18 @@ import express from 'express'; import mongoose from 'mongoose'; -import { dataVersionRoute } from './components/dataversion'; -import { teamMemberImageRoute, teamsRoute } from './components/teams'; +import { + allBiodomainsRoute, + biodomainsRoute, + comparisonGenesRoute, + dataVersionRoute, + distributionRoute, + geneRoute, + genesRoute, + nominatedGenesRoute, + searchGeneRoute, + teamMemberImageRoute, + teamsRoute, +} from './components'; const mongoUri = process.env.MONGODB_URI; @@ -19,7 +30,15 @@ mongoose.connection.on('error', console.error.bind(console, 'MongoDB connection const router = express.Router(); mongoose.connection.once('open', async () => { + router.get('/biodomains', allBiodomainsRoute); + router.get('/biodomains/:id', biodomainsRoute); router.get('/dataversion', dataVersionRoute); + router.get('/distribution', distributionRoute); + router.get('/genes/search', searchGeneRoute); + router.get('/genes/comparison', comparisonGenesRoute); + router.get('/genes/nominated', nominatedGenesRoute); + router.get('/genes/:id', geneRoute); + router.get('/genes', genesRoute); router.get('/teams', teamsRoute); router.get('/teamMembers/:name/image', teamMemberImageRoute); }); diff --git a/apps/agora/api/src/components/biodomains.ts b/apps/agora/api/src/components/biodomains.ts new file mode 100644 index 0000000000..6f075d982c --- /dev/null +++ b/apps/agora/api/src/components/biodomains.ts @@ -0,0 +1,84 @@ +// -------------------------------------------------------------------------- // +// Internal +// -------------------------------------------------------------------------- // +import { Request, Response, NextFunction } from 'express'; +import { cache, setHeaders } from '../helpers'; +import { AllBioDomainsCollection, BioDomainsCollection } from '../models'; +import { BioDomains, BioDomainInfo } from '@sagebionetworks/agora/api-client-angular'; + +// -------------------------------------------------------------------------- // +// Functions +// -------------------------------------------------------------------------- // +export async function getAllBioDomains() { + const cacheKey = 'all-biodomains'; + let result: BioDomainInfo[] | null | undefined = cache.get(cacheKey); + + if (result) { + return result; + } + + result = await AllBioDomainsCollection.find().lean().sort().exec(); + + cache.set(cacheKey, result); + return result || undefined; +} + +export async function getAllGeneBioDomains() { + const cacheKey = 'all-genebiodomains'; + let result: BioDomains[] | null | undefined = cache.get(cacheKey); + + if (result) { + return result; + } + + result = await BioDomainsCollection.find().lean().sort().exec(); + + cache.set(cacheKey, result); + return result || undefined; +} + +export async function getBioDomains(ensg: string) { + const cacheKey = ensg + '-biodomains'; + let result: BioDomains | null | undefined = cache.get(cacheKey); + + if (result) { + return result; + } + + result = await BioDomainsCollection.findOne({ + ensembl_gene_id: ensg, + }) + .lean() + .exec(); + + cache.set(cacheKey, result); + return result || undefined; +} + +// -------------------------------------------------------------------------- // +// Routes +// -------------------------------------------------------------------------- // +export async function allBiodomainsRoute(req: Request, res: Response, next: NextFunction) { + try { + const result = await getAllBioDomains(); + setHeaders(res); + res.json(result); + } catch (err) { + next(err); + } +} + +export async function biodomainsRoute(req: Request, res: Response, next: NextFunction) { + if (!req.params || !req.params.id) { + res.status(404).send('Not found'); + return; + } + + try { + const result = await getBioDomains(req.params.id); + setHeaders(res); + res.json(result?.gene_biodomains); + } catch (err) { + next(err); + } +} diff --git a/apps/agora/api/src/components/comparison.ts b/apps/agora/api/src/components/comparison.ts new file mode 100644 index 0000000000..dac678b791 --- /dev/null +++ b/apps/agora/api/src/components/comparison.ts @@ -0,0 +1,285 @@ +// -------------------------------------------------------------------------- // +// External +// -------------------------------------------------------------------------- // +import { Request, Response, NextFunction } from 'express'; + +// -------------------------------------------------------------------------- // +// Internal +// -------------------------------------------------------------------------- // +import { setHeaders, altCache } from '../helpers'; +import { getGenesMap, getAllScores, getTeams, getAllGeneBioDomains } from './'; +import { + Gene, + GCTGene, + GCTGeneNominations, + RnaDifferentialExpressionCollection, + ProteomicsLFQCollection, + ProteomicsTMTCollection, + ProteomicsSRMCollection, +} from '../models'; +import { + BioDomains, + ProteinDifferentialExpression, + RnaDifferentialExpression, + TargetNomination, + Team, +} from '@sagebionetworks/agora/api-client-angular'; +import { Scores } from 'libs/agora/models'; +// -------------------------------------------------------------------------- // +// Functions +// -------------------------------------------------------------------------- // + +function getComparisonGeneAssociations(gene: Gene) { + const data: number[] = []; + + // Genetically Associated with LOAD + if (gene.is_igap) { + data.push(1); + } + + // eQTL in Brain + if (gene.is_eqtl) { + data.push(2); + } + + // RNA Expression Changed in AD Brain + if (gene.rna_brain_change_studied && gene.is_any_rna_changed_in_ad_brain) { + data.push(3); + } + + // Protein Expression Changed in AD Brain + if (gene.protein_brain_change_studied && gene.is_any_protein_changed_in_ad_brain) { + data.push(4); + } + + return data; +} + +function getComparisonGeneNominations(gene: Gene, teams: Team[]) { + const data: GCTGeneNominations = { + count: gene.total_nominations || 0, + year: 0, + teams: [], + studies: [], + inputs: [], + programs: [], + validations: [], + }; + + gene.target_nominations?.forEach((n: TargetNomination) => { + // Year + if (n.initial_nomination && (!data.year || n.initial_nomination < data.year)) { + data.year = n.initial_nomination; + } + + // Team / Programs + if (n.team) { + const team = teams.find((item: Team) => item.team === n.team); + + if (team && !data.programs.includes(team.program)) { + data.programs.push(team.program); + } + + data.teams.push(n.team); + } + + // Studies + if (n.study) { + n.study.split(', ').forEach((item: string) => { + if (!data.studies.includes(item)) { + data.studies.push(item); + } + }); + } + + // Inputs + if (n.input_data) { + n.input_data.split(', ').forEach((item: string) => { + if (!data.inputs.includes(item)) { + data.inputs.push(item); + } + }); + } + + // Validations + if (n.validation_study_details && !data.validations.includes(n.validation_study_details)) { + data.validations.push(n.validation_study_details.trim()); + } + }); + + return data; +} + +function getComparisonGene( + gene: Gene, + teams: Team[], + scores: Scores[], + allBiodomains: BioDomains[] | undefined, +) { + const geneScores = scores.find((score) => score.ensembl_gene_id == gene.ensembl_gene_id); + const geneBiodomains = allBiodomains + ?.find((b) => b.ensembl_gene_id === gene.ensembl_gene_id) + ?.gene_biodomains.map((b) => b.biodomain); + + const data: GCTGene = { + ensembl_gene_id: gene.ensembl_gene_id || '', + hgnc_symbol: gene.hgnc_symbol || '', + tissues: [], + nominations: getComparisonGeneNominations(gene, teams), + associations: getComparisonGeneAssociations(gene), + target_risk_score: geneScores ? geneScores.target_risk_score : null, + genetics_score: geneScores ? geneScores.genetics_score : null, + multi_omics_score: geneScores ? geneScores.multi_omics_score : null, + biodomains: geneBiodomains, + target_enabling_resources: getTargetEnablingResources(gene), + }; + + return data; +} + +export function getTargetEnablingResources(gene: Gene) { + const resources: string[] = []; + if (gene.is_adi) resources.push('AD Informer Set'); + if (gene.is_tep) resources.push('Target Enabling Package'); + return resources; +} + +export async function getRnaComparisonGenes(model: string) { + const cacheKey = 'rna-comparison-' + model.replace(/[^a-z0-9]/gi, ''); + + let result: GCTGene[] | undefined = altCache.get(cacheKey); + + if (result) { + return result; + } + + const differentialExpression: RnaDifferentialExpression[] = + await RnaDifferentialExpressionCollection.find({ + model: model, + }) + .lean() + .sort({ hgnc_symbol: 1, tissue: 1 }) + .exec(); + + if (differentialExpression) { + const genes: { [key: string]: GCTGene } = {}; + const allGenes = await getGenesMap(); + const teams = await getTeams(); + const scores = await getAllScores(); + const allBiodomains = await getAllGeneBioDomains(); + + differentialExpression.forEach((exp: RnaDifferentialExpression) => { + if (!genes[exp.ensembl_gene_id]) { + const gene: Gene = + allGenes.get(exp.ensembl_gene_id) || + ({ + ensembl_gene_id: exp.ensembl_gene_id || '', + hgnc_symbol: exp.hgnc_symbol || '', + } as Gene); + genes[exp.ensembl_gene_id] = getComparisonGene(gene, teams, scores, allBiodomains); + } + + genes[exp.ensembl_gene_id].tissues.push({ + name: exp.tissue, + logfc: exp.logfc, + adj_p_val: exp.adj_p_val, + ci_l: exp.ci_l, + ci_r: exp.ci_r, + }); + }); + + result = Object.values(genes); + } + + altCache.set(cacheKey, result); + return result; +} + +export async function getProteinComparisonGenes(method: string) { + const cacheKey = 'rna-comparison-' + method.replace(/[^a-z0-9]/gi, ''); + + let result = altCache.get(cacheKey); + + if (result?.length) { + return result; + } + + let items: ProteinDifferentialExpression[] = []; + + if ('TMT' === method) { + items = await ProteomicsTMTCollection.find().lean().sort({ hgnc_symbol: 1, tissue: 1 }).exec(); + } else if ('LFQ' === method) { + items = await ProteomicsLFQCollection.find().lean().sort({ hgnc_symbol: 1, tissue: 1 }).exec(); + } else if ('SRM' === method) { + items = await ProteomicsSRMCollection.find().lean().sort({ hgnc_symbol: 1, tissue: 1 }).exec(); + } else { + // TODO capture corner scenarios + throw 'unknown method selected: ' + method; + } + + if (items) { + const genes: { [key: string]: GCTGene } = {}; + const allGenes = await getGenesMap(); + const teams = await getTeams(); + const scores = await getAllScores(); + const allBiodomains = await getAllGeneBioDomains(); + + items.forEach((item: ProteinDifferentialExpression) => { + if (!genes[item.uniqid]) { + const gene: Gene = + allGenes.get(item.ensembl_gene_id) || + ({ + ensembl_gene_id: item.ensembl_gene_id || '', + hgnc_symbol: item.hgnc_symbol || '', + } as Gene); + genes[item.uniqid] = getComparisonGene(gene, teams, scores, allBiodomains); + genes[item.uniqid].uniprotid = item.uniprotid; + } + + genes[item.uniqid].tissues.push({ + name: item.tissue, + logfc: item.log2_fc, + adj_p_val: item.cor_pval, + ci_l: item.ci_lwr, + ci_r: item.ci_upr, + }); + }); + + result = Object.values(genes); + } + + altCache.set(cacheKey, result); + return result; +} + +// -------------------------------------------------------------------------- // +// Routes +// -------------------------------------------------------------------------- // + +export async function comparisonGenesRoute(req: Request, res: Response, next: NextFunction) { + if ( + !req.query || + !req.query.category || + typeof req.query.category !== 'string' || + !req.query.subCategory || + typeof req.query.subCategory !== 'string' + ) { + res.status(404).send('Not found'); + return; + } + + try { + let items: GCTGene[] | undefined = [] as GCTGene[]; + + if ('RNA - Differential Expression' === req.query.category) { + items = await getRnaComparisonGenes(req.query.subCategory); + } else if ('Protein - Differential Expression' === req.query.category) { + items = await getProteinComparisonGenes(req.query.subCategory); + } + + setHeaders(res); + res.json({ items }); + } catch (err) { + next(err); + } +} diff --git a/apps/agora/api/src/components/distribution.ts b/apps/agora/api/src/components/distribution.ts new file mode 100644 index 0000000000..0cf08a5084 --- /dev/null +++ b/apps/agora/api/src/components/distribution.ts @@ -0,0 +1,106 @@ +// -------------------------------------------------------------------------- // +// External +// -------------------------------------------------------------------------- // +import { Request, Response, NextFunction } from 'express'; + +// -------------------------------------------------------------------------- // +// Internal +// -------------------------------------------------------------------------- // +import { setHeaders, cache } from '../helpers'; +import { + RnaDistributionCollection, + ProteomicDistributionCollection, + OverallScoresDistributionCollection, +} from '../models'; +import { + RnaDistribution, + Distribution, + OverallScores, + OverallScoresDistribution, + ProteomicsDistribution, +} from '@sagebionetworks/agora/api-client-angular'; + +// -------------------------------------------------------------------------- // +// Functions +// -------------------------------------------------------------------------- // + +export async function getRnaDistribution() { + const cacheKey = 'rna-distribution'; + let result: RnaDistribution[] | undefined = cache.get(cacheKey); + + if (result) { + return result; + } + + result = await RnaDistributionCollection.find().lean().exec(); + + cache.set(cacheKey, result); + return result; +} + +export async function getProteomicDistribution(type: string) { + const cacheKey = 'proteomics-' + type + '-distribution'; + let result: ProteomicsDistribution[] | undefined = cache.get(cacheKey); + + if (result) { + return result; + } + + result = await ProteomicDistributionCollection.find({ type: type }).lean().exec(); + + cache.set(cacheKey, result); + return result; +} + +export async function getOverallScoresDistribution() { + const cacheKey = 'overall-scores-distribution'; + let result: OverallScoresDistribution[] | undefined = cache.get(cacheKey); + + if (result) { + return result; + } + + result = await OverallScoresDistributionCollection.find({}).sort('name').lean().exec(); + + // Handle old format + if (result.length === 1) { + result = Object.values(result[0]).filter((d: any) => d.distribution?.length); + } + + cache.set(cacheKey, result); + return result; +} + +export async function getDistribution() { + const cacheKey = 'distribution'; + let result: Distribution | undefined = cache.get(cacheKey); + + if (result) { + return result; + } + + result = { + rna_differential_expression: await getRnaDistribution(), + proteomics_LFQ: await getProteomicDistribution('LFQ'), + proteomics_SRM: await getProteomicDistribution('SRM'), + proteomics_TMT: await getProteomicDistribution('TMT'), + overall_scores: await getOverallScoresDistribution(), + }; + + cache.set(cacheKey, result); + return result; +} + +// -------------------------------------------------------------------------- // +// +// -------------------------------------------------------------------------- // + +export async function distributionRoute(req: Request, res: Response, next: NextFunction) { + try { + const result = await getDistribution(); + setHeaders(res); + res.json(result); + } catch (err) { + next(err); + } +} diff --git a/apps/agora/api/src/components/experimental-validation.ts b/apps/agora/api/src/components/experimental-validation.ts new file mode 100644 index 0000000000..04f6959d72 --- /dev/null +++ b/apps/agora/api/src/components/experimental-validation.ts @@ -0,0 +1,28 @@ +// -------------------------------------------------------------------------- // +// Internal +// -------------------------------------------------------------------------- // +import { cache } from '../helpers'; +import { ExperimentalValidationCollection } from '../models'; +import { ExperimentalValidation } from 'libs/agora/models'; + +// -------------------------------------------------------------------------- // +// Functions +// -------------------------------------------------------------------------- // + +export async function getExperimentalValidation(ensg: string) { + const cacheKey = 'experimental-validation-' + ensg; + let result: ExperimentalValidation[] | undefined = cache.get(cacheKey); + + if (result) { + return result; + } + + result = await ExperimentalValidationCollection.find({ + ensembl_gene_id: ensg, + }) + .lean() + .exec(); + + cache.set(cacheKey, result); + return result; +} diff --git a/apps/agora/api/src/components/gene-links.ts b/apps/agora/api/src/components/gene-links.ts new file mode 100644 index 0000000000..54bde5586a --- /dev/null +++ b/apps/agora/api/src/components/gene-links.ts @@ -0,0 +1,58 @@ +// -------------------------------------------------------------------------- // +// Internal +// -------------------------------------------------------------------------- // +import { cache } from '../helpers'; +import { GeneLinkCollection } from '../models'; + +// -------------------------------------------------------------------------- // +// Functions +// -------------------------------------------------------------------------- // +export async function getGeneLinks(ensg: string) { + const cacheKey = ensg + '-gene-links'; + let result: any = cache.get(cacheKey); + + if (result) { + return result; + } + + const listA = await GeneLinkCollection.find({ + geneA_ensembl_gene_id: ensg, + }) + .lean() + .exec(); + if (!listA) { + return; + } + + const listB = await GeneLinkCollection.find({ + geneB_ensembl_gene_id: ensg, + }) + .lean() + .exec(); + if (!listB) { + return; + } + + const ids = [ + ...listA.map((link) => { + return link.geneB_ensembl_gene_id; + }), + ...listB.map((link) => { + return link.geneA_ensembl_gene_id; + }), + ]; + + const listC = await GeneLinkCollection.find({ + $and: [{ geneA_ensembl_gene_id: { $in: ids } }, { geneB_ensembl_gene_id: { $in: ids } }], + }) + .lean() + .exec(); + if (!listC) { + return; + } + + result = [...listA, ...listB, ...listC]; + + cache.set(cacheKey, result); + return result; +} diff --git a/apps/agora/api/src/components/genes.ts b/apps/agora/api/src/components/genes.ts new file mode 100644 index 0000000000..f79f135cec --- /dev/null +++ b/apps/agora/api/src/components/genes.ts @@ -0,0 +1,211 @@ +// -------------------------------------------------------------------------- // +// External +// -------------------------------------------------------------------------- // +import { Request, Response, NextFunction } from 'express'; + +// -------------------------------------------------------------------------- // +// Internal +// -------------------------------------------------------------------------- // +import { setHeaders, cache, altCache } from '../helpers'; +import { Gene, GeneCollection } from '../models'; +import { + getRnaDifferentialExpression, + getProteomicsLFQ, + getProteomicsSRM, + getProteomicsTMT, + getMetabolomics, + getExperimentalValidation, + getNeuropathologicCorrelations, + getOverallScores, + getGeneLinks, + getBioDomains, +} from '.'; + +// -------------------------------------------------------------------------- // +// Functions +// -------------------------------------------------------------------------- // +export async function getAllGenes() { + const cacheKey = 'genes'; + let result: Gene[] | undefined = altCache.get(cacheKey); + + if (result) { + return result; + } + + result = await GeneCollection.find().lean().sort({ hgnc_symbol: 1, ensembl_gene_id: 1 }).exec(); + + altCache.set(cacheKey, result); + return result; +} + +export async function getGenes(ids?: string | string[]) { + const genes: Gene[] = await getAllGenes(); + + if (ids) { + ids = typeof ids == 'string' ? ids.split(',') : ids; + return genes.filter((g: Gene) => ids?.includes(g.ensembl_gene_id)); + } + + return genes; +} + +export async function getGenesMap() { + const genes = await getGenes(); + return new Map(genes.map((g: Gene) => [g.ensembl_gene_id, g])); +} + +export async function getGene(ensg: string) { + ensg = ensg.trim(); + const cacheKey = ensg + '-gene'; + let result: Gene | null | undefined = cache.get(cacheKey); + + if (result) { + return result; + } + + result = await GeneCollection.findOne({ + ensembl_gene_id: ensg, + }) + .lean() + .exec(); + + if (result) { + result.rna_differential_expression = await getRnaDifferentialExpression(ensg); + result.proteomics_LFQ = await getProteomicsLFQ(ensg); + result.proteomics_SRM = await getProteomicsSRM(ensg); + result.proteomics_TMT = await getProteomicsTMT(ensg); + result.metabolomics = await getMetabolomics(ensg); + result.neuropathologic_correlations = await getNeuropathologicCorrelations(ensg); + result.overall_scores = await getOverallScores(ensg); + result.experimental_validation = await getExperimentalValidation(ensg); + result.links = await getGeneLinks(ensg); + result.bio_domains = await getBioDomains(ensg); + } + + cache.set(cacheKey, result); + return result; +} + +export async function searchGene(id: string) { + id = id.trim(); + const isEnsembl = id.startsWith('ENSG'); + let query: { [key: string]: any } | null = null; + + if (isEnsembl) { + if (id.length == 15) { + query = { ensembl_gene_id: id }; + } else { + query = { ensembl_gene_id: { $regex: id, $options: 'i' } }; + } + } else { + query = { + $or: [ + { + hgnc_symbol: { $regex: id, $options: 'i' }, + }, + { + alias: new RegExp('^' + id + '$', 'i'), + }, + ], + }; + } + + const result = await GeneCollection.find(query).lean().exec(); + + return result; +} + +export async function getNominatedGenes() { + const cacheKey = 'nominated-genes'; + let result: Gene[] | undefined = cache.get(cacheKey); + + if (result) { + return result; + } + + result = await GeneCollection.find({ total_nominations: { $gt: 0 } }) + .select( + [ + 'hgnc_symbol', + 'ensembl_gene_id', + 'total_nominations', + 'target_nominations.initial_nomination', + 'target_nominations.team', + 'target_nominations.study', + 'target_nominations.source', + 'target_nominations.input_data', + 'target_nominations.validation_study_details', + 'druggability.pharos_class', + 'druggability.sm_druggability_bucket', + 'druggability.classification', + 'druggability.safety_bucket', + 'druggability.safety_bucket_definition', + 'druggability.abability_bucket', + 'druggability.abability_bucket_definition', + ].join(' '), + ) + .lean() + .sort({ nominations: -1, hgnc_symbol: 1 }) + .exec(); + + cache.set(cacheKey, result); + return result; +} + +// -------------------------------------------------------------------------- // +// Routes +// -------------------------------------------------------------------------- // +export async function genesRoute(req: Request, res: Response, next: NextFunction) { + if (!req.query || !req.query.ids) { + res.status(404).send('Not found'); + return; + } + + try { + const result = await getGenes(req.query.ids); + setHeaders(res); + res.json({ items: result }); + } catch (err) { + next(err); + } +} + +export async function geneRoute(req: Request, res: Response, next: NextFunction) { + if (!req.params || !req.params.id) { + res.status(404).send('Not found'); + return; + } + + try { + const result = await getGene(req.params.id); + setHeaders(res); + res.json(result); + } catch (err) { + next(err); + } +} + +export async function searchGeneRoute(req: Request, res: Response, next: NextFunction) { + if (!req.query || !req.query.id) { + res.status(404).send('Not found'); + return; + } + + try { + const result = await searchGene(req.query.id); + setHeaders(res); + res.json({ items: result }); + } catch (err) { + next(err); + } +} + +export async function nominatedGenesRoute(req: Request, res: Response, next: NextFunction) { + try { + const result = await getNominatedGenes(); + setHeaders(res); + res.json({ items: result }); + } catch (err) { + next(err); + } +} diff --git a/apps/agora/api/src/components/index.ts b/apps/agora/api/src/components/index.ts index 98f33b07fe..6f16c9d104 100644 --- a/apps/agora/api/src/components/index.ts +++ b/apps/agora/api/src/components/index.ts @@ -1,2 +1,14 @@ +export * from './biodomains'; +export * from './comparison'; export * from './dataversion'; +export * from './distribution'; +export * from './experimental-validation'; +export * from './genes'; +export * from './gene-links'; +export * from './metabolomics'; +export * from './neuropathologic-correlations'; +export * from './overall-scores'; +export * from './proteomics'; +export * from './rna'; +export * from './scores'; export * from './teams'; diff --git a/apps/agora/api/src/components/metabolomics.ts b/apps/agora/api/src/components/metabolomics.ts new file mode 100644 index 0000000000..3ea4204afa --- /dev/null +++ b/apps/agora/api/src/components/metabolomics.ts @@ -0,0 +1,27 @@ +// -------------------------------------------------------------------------- // +// Internal +// -------------------------------------------------------------------------- // +import { cache } from '../helpers'; +import { MetabolomicsCollection } from '../models'; +import { Metabolomics } from 'libs/agora/models'; + +// -------------------------------------------------------------------------- // +// Functions +// -------------------------------------------------------------------------- // +export async function getMetabolomics(ensg: string) { + const cacheKey = ensg + '-metabolomics'; + let result: Metabolomics | null | undefined = cache.get(cacheKey); + + if (result) { + return result; + } + + result = await MetabolomicsCollection.findOne({ + ensembl_gene_id: ensg, + }) + .lean() + .exec(); + + cache.set(cacheKey, result); + return result; +} diff --git a/apps/agora/api/src/components/neuropathologic-correlations.ts b/apps/agora/api/src/components/neuropathologic-correlations.ts new file mode 100644 index 0000000000..124a99c88f --- /dev/null +++ b/apps/agora/api/src/components/neuropathologic-correlations.ts @@ -0,0 +1,27 @@ +// -------------------------------------------------------------------------- // +// Internal +// -------------------------------------------------------------------------- // +import { cache } from '../helpers'; +import { NeuropathologicCorrelationCollection } from '../models'; +import { NeuropathologicCorrelation } from 'libs/agora/models'; + +// -------------------------------------------------------------------------- // +// Functions +// -------------------------------------------------------------------------- // +export async function getNeuropathologicCorrelations(ensg: string) { + const cacheKey = ensg + '-neuropathology-correlations'; + let result: NeuropathologicCorrelation[] | undefined = cache.get(cacheKey); + + if (result) { + return result; + } + + result = await NeuropathologicCorrelationCollection.find({ + ensg: ensg, + }) + .lean() + .exec(); + + cache.set(cacheKey, result); + return result; +} diff --git a/apps/agora/api/src/components/overall-scores.ts b/apps/agora/api/src/components/overall-scores.ts new file mode 100644 index 0000000000..5386dd5ccb --- /dev/null +++ b/apps/agora/api/src/components/overall-scores.ts @@ -0,0 +1,30 @@ +// -------------------------------------------------------------------------- // +// Internal +// -------------------------------------------------------------------------- // +import { cache } from '../helpers'; +import { OverallScoresCollection } from '../models'; +import { OverallScores } from 'libs/agora/models'; + +// -------------------------------------------------------------------------- // +// Functions +// -------------------------------------------------------------------------- // +export async function getOverallScores(ensg: string) { + const cacheKey = ensg + '-overall-scores'; + let result: OverallScores | null | undefined = cache.get(cacheKey); + + if (result) { + return result; + } + + result = await OverallScoresCollection.findOne( + { + ensembl_gene_id: ensg, + }, + { _id: 0, target_risk_score: 1, genetics_score: 1, multi_omics_score: 1, literature_score: 1 }, + ) + .lean() + .exec(); + + cache.set(cacheKey, result); + return result || undefined; +} diff --git a/apps/agora/api/src/components/proteomics.ts b/apps/agora/api/src/components/proteomics.ts new file mode 100644 index 0000000000..b659bafc3b --- /dev/null +++ b/apps/agora/api/src/components/proteomics.ts @@ -0,0 +1,85 @@ +// -------------------------------------------------------------------------- // +// Internal +// -------------------------------------------------------------------------- // +import { cache } from '../helpers'; +import { + ProteomicsLFQCollection, + ProteomicsSRMCollection, + ProteomicsTMTCollection, +} from '../models'; +import { ProteinDifferentialExpression } from 'libs/agora/models'; + +// -------------------------------------------------------------------------- // +// Functions +// -------------------------------------------------------------------------- // +export async function getProteomicsLFQ(ensg: string) { + const cacheKey = ensg + '-protein-LFQ'; + let result: ProteinDifferentialExpression[] | undefined = cache.get(cacheKey); + + if (result) { + return result; + } + + result = await ProteomicsLFQCollection.find({ + ensembl_gene_id: ensg, + }) + .lean() + .exec(); + + if (result) { + result = result.filter((item: any) => { + return item.log2_fc; + }); + } + + cache.set(cacheKey, result); + return result; +} + +export async function getProteomicsSRM(ensg: string) { + const cacheKey = ensg + '-protein-SRM'; + let result: ProteinDifferentialExpression[] | undefined = cache.get(cacheKey); + + if (result) { + return result; + } + + result = await ProteomicsSRMCollection.find({ + ensembl_gene_id: ensg, + }) + .lean() + .exec(); + + if (result) { + result = result.filter((item: any) => { + return item.log2_fc; + }); + } + + cache.set(cacheKey, result); + return result; +} + +export async function getProteomicsTMT(ensg: string) { + const cacheKey = ensg + '-protein-TMT'; + let result: ProteinDifferentialExpression[] | undefined = cache.get(cacheKey); + + if (result) { + return result; + } + + result = await ProteomicsTMTCollection.find({ + ensembl_gene_id: ensg, + }) + .lean() + .exec(); + + if (result) { + result = result.filter((item: any) => { + return item.log2_fc; + }); + } + + cache.set(cacheKey, result); + return result; +} diff --git a/apps/agora/api/src/components/rna.ts b/apps/agora/api/src/components/rna.ts new file mode 100644 index 0000000000..475b41d59f --- /dev/null +++ b/apps/agora/api/src/components/rna.ts @@ -0,0 +1,45 @@ +// -------------------------------------------------------------------------- // +// Internal +// -------------------------------------------------------------------------- // +import { cache } from '../helpers'; +import { RnaDifferentialExpressionCollection } from '../models'; +import { RnaDifferentialExpression } from 'libs/agora/models'; +// -------------------------------------------------------------------------- // +// Functions +// -------------------------------------------------------------------------- // +export async function getRnaDifferentialExpression(ensg: string) { + const cacheKey = ensg + '-rna-differential-expression'; + let result: RnaDifferentialExpression[] | undefined = cache.get(cacheKey); + + if (result) { + return result; + } + + result = await RnaDifferentialExpressionCollection.find({ + ensembl_gene_id: ensg, + }) + .lean() + .sort({ hgnc_symbol: 1, tissue: 1, model: 1 }) + .exec(); + + if (result) { + const models: { [key: string]: string[] } = {}; + + // Filter out duplicates + result = result.filter((item: any) => { + if (!models[item['model']]) { + models[item['model']] = []; + } + + if (!models[item['model']].includes(item['tissue'])) { + models[item['model']].push(item['tissue']); + return true; + } + + return false; + }); + } + + cache.set(cacheKey, result); + return result; +} diff --git a/apps/agora/api/src/components/scores.ts b/apps/agora/api/src/components/scores.ts new file mode 100644 index 0000000000..f08afe5dcd --- /dev/null +++ b/apps/agora/api/src/components/scores.ts @@ -0,0 +1,23 @@ +// -------------------------------------------------------------------------- // +// Internal +// -------------------------------------------------------------------------- // +import { cache } from '../helpers'; +import { ScoresCollection } from '../models'; +import { Scores } from 'libs/agora/models'; + +// -------------------------------------------------------------------------- // +// Functions +// -------------------------------------------------------------------------- // + +export async function getAllScores() { + let scores: Scores[] | undefined = cache.get('scores'); + + if (scores) { + return scores; + } + + scores = await ScoresCollection.find().lean().exec(); + + cache.set('scores', scores); + return scores; +} diff --git a/apps/agora/api/src/main.ts b/apps/agora/api/src/main.ts index a4781e9563..a152fbf28c 100644 --- a/apps/agora/api/src/main.ts +++ b/apps/agora/api/src/main.ts @@ -2,6 +2,8 @@ * This is not a production server yet! * This is only a minimal backend to get started. */ +import '@angular/platform-browser-dynamic'; +import '@angular/compiler'; import express from 'express'; import path from 'path'; diff --git a/apps/agora/api/src/models/biodomains.ts b/apps/agora/api/src/models/biodomains.ts new file mode 100644 index 0000000000..a98dc21f2a --- /dev/null +++ b/apps/agora/api/src/models/biodomains.ts @@ -0,0 +1,35 @@ +import { Schema, model } from 'mongoose'; +import { BioDomains, BioDomain, BioDomainInfo } from '@sagebionetworks/agora/api-client-angular'; + +const BioDomainSchema = new Schema({ + biodomain: { type: String, required: true }, + go_terms: { type: [String], required: true }, + n_biodomain_terms: { type: Number, required: true }, + n_gene_biodomain_terms: { type: Number, required: true }, + pct_linking_terms: { type: Number, required: true }, +}); + +const BioDomainInfoSchema = new Schema( + { + name: { type: String, required: true }, + }, + { collection: 'biodomaininfo' }, +); + +const BioDomainsSchema = new Schema( + { + ensembl_gene_id: { type: String, required: true }, + gene_biodomains: { type: [BioDomainSchema], required: true }, + }, + { collection: 'genesbiodomains' }, +); + +// -------------------------------------------------------------------------- // +// Models +// -------------------------------------------------------------------------- // +export const AllBioDomainsCollection = model( + 'BioDomainsInfoCollection', + BioDomainInfoSchema, +); + +export const BioDomainsCollection = model('BioDomainsCollection', BioDomainsSchema); diff --git a/apps/agora/api/src/models/comparison.ts b/apps/agora/api/src/models/comparison.ts new file mode 100644 index 0000000000..71fc33b871 --- /dev/null +++ b/apps/agora/api/src/models/comparison.ts @@ -0,0 +1,9 @@ +// -------------------------------------------------------------------------- // +// Internal +// -------------------------------------------------------------------------- // + +export { + GCTGene, + GCTGeneTissue, + GCTGeneNominations, +} from '@sagebionetworks/agora/api-client-angular'; diff --git a/apps/agora/api/src/models/dataversion.ts b/apps/agora/api/src/models/dataversion.ts index 886a5b4969..9a53661c84 100644 --- a/apps/agora/api/src/models/dataversion.ts +++ b/apps/agora/api/src/models/dataversion.ts @@ -1,5 +1,5 @@ -import { Dataversion } from '@sagebionetworks/agora/api-client-angular'; import { Schema, model } from 'mongoose'; +import { Dataversion } from '@sagebionetworks/agora/api-client-angular'; const DataVersionSchema = new Schema( { diff --git a/apps/agora/api/src/models/distribution.ts b/apps/agora/api/src/models/distribution.ts new file mode 100644 index 0000000000..88cd9ba316 --- /dev/null +++ b/apps/agora/api/src/models/distribution.ts @@ -0,0 +1,66 @@ +// -------------------------------------------------------------------------- // +// External +// -------------------------------------------------------------------------- // +import { Schema, model } from 'mongoose'; + +// -------------------------------------------------------------------------- // +// Internal +// -------------------------------------------------------------------------- // +import { + RnaDistribution, + OverallScoresDistribution, + ProteomicsDistribution, +} from '@sagebionetworks/agora/api-client-angular'; + +// -------------------------------------------------------------------------- // +// Schemas +// -------------------------------------------------------------------------- // +const RnaDistributionSchema = new Schema( + { + _id: { type: String, required: true }, + model: { type: String, required: true }, + tissue: { type: String, required: true }, + min: { type: Number, required: true }, + max: { type: Number, required: true }, + first_quartile: { type: Number, required: true }, + median: { type: Number, required: true }, + third_quartile: { type: Number, required: true }, + }, + { collection: 'rnaboxdistribution' }, +); + +const ProteomicDistributionSchema = new Schema( + { + type: String, + }, + { collection: 'proteomicsboxdistribution' }, +); + +const OverallScoresDistributionSchema = new Schema( + { + distribution: [{ type: Number, required: true }], + bins: [[{ type: Number, required: true }]], + name: { type: String, required: true }, + syn_id: { type: String, required: true }, + wiki_id: { type: String, required: true }, + }, + { collection: 'genescoredistribution' }, +); + +// -------------------------------------------------------------------------- // +// Models +// -------------------------------------------------------------------------- // +export const RnaDistributionCollection = model( + 'RnaDistributionCollection', + RnaDistributionSchema, +); + +export const ProteomicDistributionCollection = model( + 'ProteomicDistributionCollection', + ProteomicDistributionSchema, +); + +export const OverallScoresDistributionCollection = model( + 'OverallScoresDistributionCollection', + OverallScoresDistributionSchema, +); diff --git a/apps/agora/api/src/models/experimental-validation.ts b/apps/agora/api/src/models/experimental-validation.ts new file mode 100644 index 0000000000..b6a652c27a --- /dev/null +++ b/apps/agora/api/src/models/experimental-validation.ts @@ -0,0 +1,32 @@ +import { Schema, model } from 'mongoose'; +import { ExperimentalValidation } from '@sagebionetworks/agora/api-client-angular'; + +const ExperimentalValidationSchema = new Schema( + { + _id: { type: String, required: true }, + ensembl_gene_id: { type: String, required: true }, + hgnc_symbol: { type: String, required: true }, + hypothesis_tested: { type: String, required: true }, + summary_findings: { type: String, required: true }, + published: { type: String, required: true }, + reference: { type: String, required: true }, + species: { type: String, required: true }, + model_system: { type: String, required: true }, + outcome_measure: { type: String, required: true }, + outcome_measure_details: { type: String, required: true }, + balanced_for_sex: { type: String, required: true }, + contributors: { type: String, required: true }, + team: { type: String, required: true }, + reference_doi: { type: String, required: true }, + date_report: { type: String, required: true }, + }, + { collection: 'geneexpvalidation' }, +); + +// -------------------------------------------------------------------------- // +// Models +// -------------------------------------------------------------------------- // +export const ExperimentalValidationCollection = model( + 'ExperimentalValidationCollection', + ExperimentalValidationSchema, +); diff --git a/apps/agora/api/src/models/gene-links.ts b/apps/agora/api/src/models/gene-links.ts new file mode 100644 index 0000000000..1a6ee9cd55 --- /dev/null +++ b/apps/agora/api/src/models/gene-links.ts @@ -0,0 +1,15 @@ +import { Schema, model } from 'mongoose'; +import { GeneNetworkLinks } from 'libs/agora/models'; + +const GeneLinkSchema = new Schema( + { + geneA_ensembl_gene_id: { type: String, required: true }, + geneB_ensembl_gene_id: { type: String, required: true }, + geneA_external_gene_name: { type: String, required: true }, + geneB_external_gene_name: { type: String, required: true }, + brainRegion: { type: String, required: true }, + }, + { collection: 'geneslinks' }, +); + +export const GeneLinkCollection = model('GeneLinksCollection', GeneLinkSchema); diff --git a/apps/agora/api/src/models/genes.ts b/apps/agora/api/src/models/genes.ts new file mode 100644 index 0000000000..d706e66618 --- /dev/null +++ b/apps/agora/api/src/models/genes.ts @@ -0,0 +1,88 @@ +// -------------------------------------------------------------------------- // +// External +// -------------------------------------------------------------------------- // +import { Schema, model } from 'mongoose'; + +// -------------------------------------------------------------------------- // +// Internal +// -------------------------------------------------------------------------- // +import { + Gene, + MedianExpression, + TargetNomination, + Druggability, + EnsemblInfo, +} from '@sagebionetworks/agora/api-client-angular'; +export { Gene } from '@sagebionetworks/agora/api-client-angular'; + +// -------------------------------------------------------------------------- // +// Schemas +// -------------------------------------------------------------------------- // +const TargetNominationSchema = new Schema({ + source: { type: String, required: true }, + team: { type: String, required: true }, + rank: { type: String, required: true }, + hgnc_symbol: { type: String, required: true }, + target_choice_justification: { type: String, required: true }, + predicted_therapeutic_direction: { type: String, required: true }, + data_used_to_support_target_selection: { type: String, required: true }, + data_synapseid: { type: String, required: true }, + study: { type: String, required: true }, + input_data: { type: String, required: true }, + validation_study_details: { type: String, required: true }, + initial_nomination: { type: Number, required: true }, +}); + +const MedianExpressionSchema = new Schema({ + min: Number, + first_quartile: Number, + median: Number, + mean: Number, + third_quartile: Number, + max: Number, + tissue: { type: String, required: true }, +}); + +const EnsemblInfoSchema = new Schema({ + ensembl_release: { type: Number, required: true }, + ensembl_possible_replacements: { type: [String], required: true }, + ensembl_permalink: { type: String, required: true }, +}); + +const DruggabilitySchema = new Schema({ + sm_druggability_bucket: { type: Number, required: true }, + safety_bucket: { type: Number, required: true }, + abability_bucket: { type: Number, required: true }, + pharos_class: { type: String, required: true }, + classification: { type: String, required: true }, + safety_bucket_definition: { type: String, required: true }, + abability_bucket_definition: { type: String, required: true }, +}); + +const GeneSchema = new Schema( + { + _id: { type: String, required: true }, + ensembl_gene_id: { type: String, required: true }, + name: { type: String, required: true }, + summary: { type: String, required: true }, + hgnc_symbol: { type: String, required: true }, + alias: [{ type: String, required: true }], + is_igap: { type: Boolean, required: true }, + is_eqtl: { type: Boolean, required: true }, + is_any_rna_changed_in_ad_brain: { type: Boolean, required: true }, + rna_brain_change_studied: { type: Boolean, required: true }, + is_any_protein_changed_in_ad_brain: { type: Boolean, required: true }, + protein_brain_change_studied: { type: Boolean, required: true }, + target_nominations: { type: [TargetNominationSchema], required: true }, + median_expression: { type: [MedianExpressionSchema], required: true }, + druggability: { type: [DruggabilitySchema], required: true }, + total_nominations: { type: Number, required: true }, + ensembl_info: { type: EnsemblInfoSchema, required: true }, + }, + { collection: 'geneinfo' }, +); + +// -------------------------------------------------------------------------- // +// Models +// -------------------------------------------------------------------------- // +export const GeneCollection = model('GeneCollection', GeneSchema); diff --git a/apps/agora/api/src/models/index.ts b/apps/agora/api/src/models/index.ts index 98f33b07fe..c6b6c929cb 100644 --- a/apps/agora/api/src/models/index.ts +++ b/apps/agora/api/src/models/index.ts @@ -1,2 +1,14 @@ +export * from './biodomains'; +export * from './comparison'; export * from './dataversion'; +export * from './distribution'; +export * from './experimental-validation'; +export * from './gene-links'; +export * from './genes'; +export * from './metabolomics'; +export * from './neuropathologic-correlations'; +export * from './overall-scores'; +export * from './proteomics'; +export * from './rna'; +export * from './scores'; export * from './teams'; diff --git a/apps/agora/api/src/models/metabolomics.ts b/apps/agora/api/src/models/metabolomics.ts new file mode 100644 index 0000000000..1590622f2e --- /dev/null +++ b/apps/agora/api/src/models/metabolomics.ts @@ -0,0 +1,37 @@ +// -------------------------------------------------------------------------- // +// External +// -------------------------------------------------------------------------- // +import { Schema, model } from 'mongoose'; + +// -------------------------------------------------------------------------- // +// Internal +// -------------------------------------------------------------------------- // +import { Metabolomics } from 'libs/agora/models'; + +// -------------------------------------------------------------------------- // +// Schemas +// -------------------------------------------------------------------------- // +const MetabolomicsSchema = new Schema( + { + _id: { type: String, required: true }, + associated_gene_name: { type: String, required: true }, + ensembl_gene_id: { type: String, required: true }, + metabolite_id: { type: String, required: true }, + metabolite_full_name: { type: String, required: true }, + association_p: { type: Number, required: true }, + gene_wide_p_threshold_1kgp: { type: Number, required: true }, + n_per_group: [{ type: Number, required: true }], + boxplot_group_names: [{ type: String, required: true }], + ad_diagnosis_p_value: [{ type: Number, required: true }], + transposed_boxplot_stats: [[{ type: Number, required: true }]], + }, + { collection: 'genesmetabolomics' }, +); + +// -------------------------------------------------------------------------- // +// Models +// -------------------------------------------------------------------------- // +export const MetabolomicsCollection = model( + 'MetabolomicsCollection', + MetabolomicsSchema, +); diff --git a/apps/agora/api/src/models/neuropathologic-correlations.ts b/apps/agora/api/src/models/neuropathologic-correlations.ts new file mode 100644 index 0000000000..860bfe4d43 --- /dev/null +++ b/apps/agora/api/src/models/neuropathologic-correlations.ts @@ -0,0 +1,35 @@ +// -------------------------------------------------------------------------- // +// External +// -------------------------------------------------------------------------- // +import { Schema, model } from 'mongoose'; + +// -------------------------------------------------------------------------- // +// Internal +// -------------------------------------------------------------------------- // +import { NeuropathologicCorrelation } from '@sagebionetworks/agora/api-client-angular'; + +// -------------------------------------------------------------------------- // +// Schemas +// -------------------------------------------------------------------------- // +const NeuropathologicCorrelationSchema = new Schema( + { + _id: { type: String, required: true }, + ensg: { type: String, required: true }, + gname: { type: String, required: true }, + oddsratio: { type: Number, required: true }, + ci_lower: { type: Number, required: true }, + ci_upper: { type: Number, required: true }, + pval: { type: Number, required: true }, + pval_adj: { type: Number, required: true }, + neuropath_type: { type: String, required: true }, + }, + { collection: 'genesneuropathcorr' }, +); + +// -------------------------------------------------------------------------- // +// Models +// -------------------------------------------------------------------------- // +export const NeuropathologicCorrelationCollection = model( + 'NeuropathologicCorrelationCollection', + NeuropathologicCorrelationSchema, +); diff --git a/apps/agora/api/src/models/overall-scores.ts b/apps/agora/api/src/models/overall-scores.ts new file mode 100644 index 0000000000..5707a0889b --- /dev/null +++ b/apps/agora/api/src/models/overall-scores.ts @@ -0,0 +1,34 @@ +// -------------------------------------------------------------------------- // +// External +// -------------------------------------------------------------------------- // +import { Schema, model } from 'mongoose'; + +// -------------------------------------------------------------------------- // +// Internal +// -------------------------------------------------------------------------- // +import { + OverallScores, + OverallScoresDistribution, +} from '@sagebionetworks/agora/api-client-angular'; + +// -------------------------------------------------------------------------- // +// Schemas +// -------------------------------------------------------------------------- // +const OverallScoresSchema = new Schema( + { + ensembl_gene_id: { type: String, required: true }, + target_risk_score: { type: Number, required: true }, + genetics_score: { type: Number, required: true }, + multi_omics_score: { type: Number, required: true }, + literature_score: { type: Number, required: true }, + }, + { collection: 'genesoverallscores' }, +); + +// -------------------------------------------------------------------------- // +// Models +// -------------------------------------------------------------------------- // +export const OverallScoresCollection = model( + 'OverallScoresCollection', + OverallScoresSchema, +); diff --git a/apps/agora/api/src/models/proteomics.ts b/apps/agora/api/src/models/proteomics.ts new file mode 100644 index 0000000000..f2eac12b6a --- /dev/null +++ b/apps/agora/api/src/models/proteomics.ts @@ -0,0 +1,81 @@ +// -------------------------------------------------------------------------- // +// External +// -------------------------------------------------------------------------- // +import { Schema, model } from 'mongoose'; + +// -------------------------------------------------------------------------- // +// Internal +// -------------------------------------------------------------------------- // +import { ProteinDifferentialExpression } from '@sagebionetworks/agora/api-client-angular'; + +// -------------------------------------------------------------------------- // +// Schemas +// -------------------------------------------------------------------------- // +const ProteinDifferentialExpressionSchema = new Schema( + { + _id: { type: String, required: true }, + uniqid: { type: String, required: true }, + hgnc_symbol: { type: String, required: true }, + uniprotid: { type: String, required: true }, + ensembl_gene_id: { type: String, required: true }, + tissue: { type: String, required: true }, + log2_fc: { type: Number, required: true }, + ci_upr: { type: Number, required: true }, + ci_lwr: { type: Number, required: true }, + pval: { type: Number, required: true }, + cor_pval: { type: Number, required: true }, + }, + { collection: 'genesproteomics' }, +); + +const ProteomicsSRMSchema = new Schema( + { + _id: { type: String, required: true }, + uniqid: { type: String, required: true }, + hgnc_symbol: { type: String, required: true }, + uniprotid: { type: String, required: true }, + ensembl_gene_id: { type: String, required: true }, + tissue: { type: String, required: true }, + log2_fc: { type: Number, required: true }, + ci_upr: { type: Number, required: true }, + ci_lwr: { type: Number, required: true }, + pval: { type: Number, required: true }, + cor_pval: { type: Number, required: true }, + }, + { collection: 'proteomicssrm' }, +); + +const ProteomicsTMTSchema = new Schema( + { + _id: { type: String, required: true }, + uniqid: { type: String, required: true }, + hgnc_symbol: { type: String, required: true }, + uniprotid: { type: String, required: true }, + ensembl_gene_id: { type: String, required: true }, + tissue: { type: String, required: true }, + log2_fc: { type: Number, required: true }, + ci_upr: { type: Number, required: true }, + ci_lwr: { type: Number, required: true }, + pval: { type: Number, required: true }, + cor_pval: { type: Number, required: true }, + }, + { collection: 'proteomicstmt' }, +); + +// -------------------------------------------------------------------------- // +// Models +// -------------------------------------------------------------------------- // +export const ProteomicsLFQCollection = model( + 'ProteomicsLFQCollection', + ProteinDifferentialExpressionSchema, +); + +export const ProteomicsSRMCollection = model( + 'ProteomicsSRMCollection', + ProteomicsSRMSchema, +); + +export const ProteomicsTMTCollection = model( + 'ProteomicsTMTCollection', + ProteomicsTMTSchema, +); diff --git a/apps/agora/api/src/models/rna.ts b/apps/agora/api/src/models/rna.ts new file mode 100644 index 0000000000..f9fb8f0390 --- /dev/null +++ b/apps/agora/api/src/models/rna.ts @@ -0,0 +1,37 @@ +// -------------------------------------------------------------------------- // +// External +// -------------------------------------------------------------------------- // +import { Schema, model } from 'mongoose'; + +// -------------------------------------------------------------------------- // +// Internal +// -------------------------------------------------------------------------- // +import { RnaDifferentialExpression } from '@sagebionetworks/agora/api-client-angular'; + +// -------------------------------------------------------------------------- // +// Schemas +// -------------------------------------------------------------------------- // +const RnaDifferentialExpressionSchema = new Schema( + { + _id: { type: String, required: true }, + ensembl_gene_id: { type: String, required: true }, + hgnc_symbol: { type: String, required: true }, + logfc: { type: Number, required: true }, + fc: { type: Number, required: true }, + ci_l: { type: Number, required: true }, + ci_r: { type: Number, required: true }, + adj_p_val: { type: Number, required: true }, + tissue: { type: String, required: true }, + study: { type: String, required: true }, + model: { type: String, required: true }, + }, + { collection: 'genes' }, +); + +// -------------------------------------------------------------------------- // +// Models +// -------------------------------------------------------------------------- // +export const RnaDifferentialExpressionCollection = model( + 'RnaDifferentialExpressionCollection', + RnaDifferentialExpressionSchema, +); diff --git a/apps/agora/api/src/models/scores.ts b/apps/agora/api/src/models/scores.ts new file mode 100644 index 0000000000..5d7abb75ff --- /dev/null +++ b/apps/agora/api/src/models/scores.ts @@ -0,0 +1,27 @@ +// -------------------------------------------------------------------------- // +// External +// -------------------------------------------------------------------------- // +import { Schema, model } from 'mongoose'; + +// -------------------------------------------------------------------------- // +// Internal +// -------------------------------------------------------------------------- // +import { Scores } from 'libs/agora/models'; + +// -------------------------------------------------------------------------- // +// Schemas +// -------------------------------------------------------------------------- // +const ScoresSchema = new Schema( + { + ensembl_gene_id: { type: String, required: true }, + target_risk_score: { type: Number, required: true }, + genetics_score: { type: Number, required: true }, + multi_omics_score: { type: Number, required: true }, + }, + { collection: 'genesoverallscores' }, +); + +// -------------------------------------------------------------------------- // +// Models +// -------------------------------------------------------------------------- // +export const ScoresCollection = model('ScoresCollection', ScoresSchema); diff --git a/libs/agora/api-client-angular/src/lib/.openapi-generator/FILES b/libs/agora/api-client-angular/src/lib/.openapi-generator/FILES index cc4d2a0e1c..5096c294b2 100644 --- a/libs/agora/api-client-angular/src/lib/.openapi-generator/FILES +++ b/libs/agora/api-client-angular/src/lib/.openapi-generator/FILES @@ -2,18 +2,45 @@ README.md api.module.ts api/api.ts +api/bioDomains.service.ts api/dataversion.service.ts -api/team.service.ts -api/teamMember.service.ts +api/distribution.service.ts +api/genes.service.ts +api/teams.service.ts configuration.ts encoder.ts git_push.sh index.ts model/basicError.ts +model/bioDomain.ts +model/bioDomainInfo.ts +model/bioDomains.ts model/dataversion.ts +model/distribution.ts +model/druggability.ts +model/ensemblInfo.ts +model/experimentalValidation.ts +model/gCTGene.ts +model/gCTGeneNominations.ts +model/gCTGeneTissue.ts +model/gCTGenesList.ts +model/gene.ts +model/medianExpression.ts model/models.ts +model/neuropathologicCorrelation.ts +model/nominatedGenesList.ts +model/overallScores.ts +model/overallScoresDistribution.ts +model/proteinDifferentialExpression.ts +model/proteomicsDistribution.ts +model/rnaDifferentialExpression.ts +model/rnaDistribution.ts +model/similarGenesNetwork.ts +model/similarGenesNetworkLink.ts +model/similarGenesNetworkNode.ts +model/targetNomination.ts model/team.ts -model/teamList.ts model/teamMember.ts +model/teamsList.ts param.ts variables.ts diff --git a/libs/agora/api-client-angular/src/lib/api.module.ts b/libs/agora/api-client-angular/src/lib/api.module.ts index fc9aac1f70..b6a24dcb2f 100644 --- a/libs/agora/api-client-angular/src/lib/api.module.ts +++ b/libs/agora/api-client-angular/src/lib/api.module.ts @@ -2,32 +2,35 @@ import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core import { Configuration } from './configuration'; import { HttpClient } from '@angular/common/http'; +import { BioDomainsService } from './api/bioDomains.service'; import { DataversionService } from './api/dataversion.service'; -import { TeamService } from './api/team.service'; -import { TeamMemberService } from './api/teamMember.service'; +import { DistributionService } from './api/distribution.service'; +import { GenesService } from './api/genes.service'; +import { TeamsService } from './api/teams.service'; @NgModule({ - imports: [], + imports: [], declarations: [], - exports: [], - providers: [] + exports: [], + providers: [], }) export class ApiModule { - public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders { - return { - ngModule: ApiModule, - providers: [ { provide: Configuration, useFactory: configurationFactory } ] - }; - } + public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders { + return { + ngModule: ApiModule, + providers: [{ provide: Configuration, useFactory: configurationFactory }], + }; + } - constructor( @Optional() @SkipSelf() parentModule: ApiModule, - @Optional() http: HttpClient) { - if (parentModule) { - throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); - } - if (!http) { - throw new Error('You need to import the HttpClientModule in your AppModule! \n' + - 'See also https://github.com/angular/angular/issues/20575'); - } + constructor(@Optional() @SkipSelf() parentModule: ApiModule, @Optional() http: HttpClient) { + if (parentModule) { + throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); + } + if (!http) { + throw new Error( + 'You need to import the HttpClientModule in your AppModule! \n' + + 'See also https://github.com/angular/angular/issues/20575', + ); } + } } diff --git a/libs/agora/api-client-angular/src/lib/api/api.ts b/libs/agora/api-client-angular/src/lib/api/api.ts index 4ed127e0d8..7bc6a749f1 100644 --- a/libs/agora/api-client-angular/src/lib/api/api.ts +++ b/libs/agora/api-client-angular/src/lib/api/api.ts @@ -1,7 +1,17 @@ +export * from './bioDomains.service'; +import { BioDomainsService } from './bioDomains.service'; export * from './dataversion.service'; import { DataversionService } from './dataversion.service'; -export * from './team.service'; -import { TeamService } from './team.service'; -export * from './teamMember.service'; -import { TeamMemberService } from './teamMember.service'; -export const APIS = [DataversionService, TeamService, TeamMemberService]; +export * from './distribution.service'; +import { DistributionService } from './distribution.service'; +export * from './genes.service'; +import { GenesService } from './genes.service'; +export * from './teams.service'; +import { TeamsService } from './teams.service'; +export const APIS = [ + BioDomainsService, + DataversionService, + DistributionService, + GenesService, + TeamsService, +]; diff --git a/libs/agora/api-client-angular/src/lib/api/bioDomains.service.ts b/libs/agora/api-client-angular/src/lib/api/bioDomains.service.ts new file mode 100644 index 0000000000..e10d73690f --- /dev/null +++ b/libs/agora/api-client-angular/src/lib/api/bioDomains.service.ts @@ -0,0 +1,265 @@ +/** + * Agora REST API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { BasicError } from '../model/basicError'; +// @ts-ignore +import { BioDomain } from '../model/bioDomain'; +// @ts-ignore +import { BioDomainInfo } from '../model/bioDomainInfo'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + +@Injectable({ + providedIn: 'root', +}) +export class BioDomainsService { + protected basePath = 'http://localhost/v1'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration: Configuration, + ) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (Array.isArray(basePath) && basePath.length > 0) { + basePath = basePath[0]; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === 'object' && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === 'object') { + if (Array.isArray(value)) { + (value as any[]).forEach( + (elem) => (httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)), + ); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substr(0, 10)); + } else { + throw Error('key may not be null if value is Date'); + } + } else { + Object.keys(value).forEach( + (k) => + (httpParams = this.addToHttpParamsRecursive( + httpParams, + value[k], + key != null ? `${key}[${k}]` : k, + )), + ); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error('key may not be null if value is not object or array'); + } + return httpParams; + } + + /** + * Retrieve bioDomain for a given ENSG + * Get bioDomain + * @param ensg The ENSG (Ensembl Gene ID) for which to retrieve biodomain data. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getBioDomain( + ensg: string, + observe?: 'body', + reportProgress?: boolean, + options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext }, + ): Observable>; + public getBioDomain( + ensg: string, + observe?: 'response', + reportProgress?: boolean, + options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext }, + ): Observable>>; + public getBioDomain( + ensg: string, + observe?: 'events', + reportProgress?: boolean, + options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext }, + ): Observable>>; + public getBioDomain( + ensg: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext }, + ): Observable { + if (ensg === null || ensg === undefined) { + throw new Error('Required parameter ensg was null or undefined when calling getBioDomain.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = ['application/json']; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/biodomains/${this.configuration.encodeParam({ name: 'ensg', value: ensg, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + return this.httpClient.get>(`${this.configuration.basePath}${localVarPath}`, { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress, + }); + } + + /** + * List BioDomains + * List BioDomains + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public listBioDomains( + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json' | 'application/problem+json'; + context?: HttpContext; + }, + ): Observable>; + public listBioDomains( + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json' | 'application/problem+json'; + context?: HttpContext; + }, + ): Observable>>; + public listBioDomains( + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json' | 'application/problem+json'; + context?: HttpContext; + }, + ): Observable>>; + public listBioDomains( + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json' | 'application/problem+json'; + context?: HttpContext; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = ['application/json', 'application/problem+json']; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/biodomains`; + return this.httpClient.get>( + `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress, + }, + ); + } +} diff --git a/libs/agora/api-client-angular/src/lib/api/team.service.ts b/libs/agora/api-client-angular/src/lib/api/distribution.service.ts similarity index 91% rename from libs/agora/api-client-angular/src/lib/api/team.service.ts rename to libs/agora/api-client-angular/src/lib/api/distribution.service.ts index 0064447ce6..2888e8e7ae 100644 --- a/libs/agora/api-client-angular/src/lib/api/team.service.ts +++ b/libs/agora/api-client-angular/src/lib/api/distribution.service.ts @@ -27,7 +27,7 @@ import { Observable } from 'rxjs'; // @ts-ignore import { BasicError } from '../model/basicError'; // @ts-ignore -import { TeamList } from '../model/teamList'; +import { Distribution } from '../model/distribution'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; @@ -36,7 +36,7 @@ import { Configuration } from '../configuration'; @Injectable({ providedIn: 'root', }) -export class TeamService { +export class DistributionService { protected basePath = 'http://localhost/v1'; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); @@ -108,36 +108,36 @@ export class TeamService { } /** - * List Teams - * List Teams + * Get distribution data + * Get distribution data * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public listTeams( + public getDistribution( observe?: 'body', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json' | 'application/problem+json'; context?: HttpContext; }, - ): Observable; - public listTeams( + ): Observable; + public getDistribution( observe?: 'response', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json' | 'application/problem+json'; context?: HttpContext; }, - ): Observable>; - public listTeams( + ): Observable>; + public getDistribution( observe?: 'events', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json' | 'application/problem+json'; context?: HttpContext; }, - ): Observable>; - public listTeams( + ): Observable>; + public getDistribution( observe: any = 'body', reportProgress: boolean = false, options?: { @@ -173,8 +173,8 @@ export class TeamService { } } - let localVarPath = `/teams`; - return this.httpClient.get(`${this.configuration.basePath}${localVarPath}`, { + let localVarPath = `/distribution`; + return this.httpClient.get(`${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, withCredentials: this.configuration.withCredentials, diff --git a/libs/agora/api-client-angular/src/lib/api/genes.service.ts b/libs/agora/api-client-angular/src/lib/api/genes.service.ts new file mode 100644 index 0000000000..cb722d9377 --- /dev/null +++ b/libs/agora/api-client-angular/src/lib/api/genes.service.ts @@ -0,0 +1,573 @@ +/** + * Agora REST API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { BasicError } from '../model/basicError'; +// @ts-ignore +import { GCTGenesList } from '../model/gCTGenesList'; +// @ts-ignore +import { Gene } from '../model/gene'; +// @ts-ignore +import { NominatedGenesList } from '../model/nominatedGenesList'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + +@Injectable({ + providedIn: 'root', +}) +export class GenesService { + protected basePath = 'http://localhost/v1'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration: Configuration, + ) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (Array.isArray(basePath) && basePath.length > 0) { + basePath = basePath[0]; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === 'object' && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === 'object') { + if (Array.isArray(value)) { + (value as any[]).forEach( + (elem) => (httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)), + ); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substr(0, 10)); + } else { + throw Error('key may not be null if value is Date'); + } + } else { + Object.keys(value).forEach( + (k) => + (httpParams = this.addToHttpParamsRecursive( + httpParams, + value[k], + key != null ? `${key}[${k}]` : k, + )), + ); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error('key may not be null if value is not object or array'); + } + return httpParams; + } + + /** + * Get comparison genes based on category and subcategory + * Get comparison genes based on category and subcategory + * @param category The category of the comparison (either RNA or Protein Differential Expression). + * @param subCategory The subcategory for gene comparison (sub-category must be a string). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getComparisonGenes( + category: 'RNA - Differential Expression' | 'Protein - Differential Expression', + subCategory: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json' | 'application/problem+json'; + context?: HttpContext; + }, + ): Observable; + public getComparisonGenes( + category: 'RNA - Differential Expression' | 'Protein - Differential Expression', + subCategory: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json' | 'application/problem+json'; + context?: HttpContext; + }, + ): Observable>; + public getComparisonGenes( + category: 'RNA - Differential Expression' | 'Protein - Differential Expression', + subCategory: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json' | 'application/problem+json'; + context?: HttpContext; + }, + ): Observable>; + public getComparisonGenes( + category: 'RNA - Differential Expression' | 'Protein - Differential Expression', + subCategory: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json' | 'application/problem+json'; + context?: HttpContext; + }, + ): Observable { + if (category === null || category === undefined) { + throw new Error( + 'Required parameter category was null or undefined when calling getComparisonGenes.', + ); + } + if (subCategory === null || subCategory === undefined) { + throw new Error( + 'Required parameter subCategory was null or undefined when calling getComparisonGenes.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + if (category !== undefined && category !== null) { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + category, + 'category', + ); + } + if (subCategory !== undefined && subCategory !== null) { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + subCategory, + 'subCategory', + ); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = ['application/json', 'application/problem+json']; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/genes/comparison`; + return this.httpClient.get(`${this.configuration.basePath}${localVarPath}`, { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress, + }); + } + + /** + * Get gene details by Ensembl Gene ID + * @param ensg Ensembl Gene ID (ENSG) + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getGene( + ensg: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json' | 'application/problem+json'; + context?: HttpContext; + }, + ): Observable; + public getGene( + ensg: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json' | 'application/problem+json'; + context?: HttpContext; + }, + ): Observable>; + public getGene( + ensg: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json' | 'application/problem+json'; + context?: HttpContext; + }, + ): Observable>; + public getGene( + ensg: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json' | 'application/problem+json'; + context?: HttpContext; + }, + ): Observable { + if (ensg === null || ensg === undefined) { + throw new Error('Required parameter ensg was null or undefined when calling getGene.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = ['application/json', 'application/problem+json']; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/genes/${this.configuration.encodeParam({ name: 'ensg', value: ensg, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + return this.httpClient.get(`${this.configuration.basePath}${localVarPath}`, { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress, + }); + } + + /** + * Retrieve a list of genes or filter by Ensembl gene IDs + * This endpoint returns all genes or filters genes by Ensembl gene IDs if provided. + * @param ids + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getGenes( + ids?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json' | 'application/problem+json'; + context?: HttpContext; + }, + ): Observable>; + public getGenes( + ids?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json' | 'application/problem+json'; + context?: HttpContext; + }, + ): Observable>>; + public getGenes( + ids?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json' | 'application/problem+json'; + context?: HttpContext; + }, + ): Observable>>; + public getGenes( + ids?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json' | 'application/problem+json'; + context?: HttpContext; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + if (ids !== undefined && ids !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, ids, 'ids'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = ['application/json', 'application/problem+json']; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/genes`; + return this.httpClient.get>(`${this.configuration.basePath}${localVarPath}`, { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress, + }); + } + + /** + * Get nominated genes + * Retrieves a list of genes with nominations and relevant information. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getNominatedGenes( + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json' | 'application/problem+json'; + context?: HttpContext; + }, + ): Observable; + public getNominatedGenes( + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json' | 'application/problem+json'; + context?: HttpContext; + }, + ): Observable>; + public getNominatedGenes( + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json' | 'application/problem+json'; + context?: HttpContext; + }, + ): Observable>; + public getNominatedGenes( + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json' | 'application/problem+json'; + context?: HttpContext; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = ['application/json', 'application/problem+json']; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/genes/nominated`; + return this.httpClient.get( + `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress, + }, + ); + } + + /** + * Search Genes + * Search Genes + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchGene( + id: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json' | 'application/problem+json'; + context?: HttpContext; + }, + ): Observable>; + public searchGene( + id: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json' | 'application/problem+json'; + context?: HttpContext; + }, + ): Observable>>; + public searchGene( + id: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json' | 'application/problem+json'; + context?: HttpContext; + }, + ): Observable>>; + public searchGene( + id: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json' | 'application/problem+json'; + context?: HttpContext; + }, + ): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling searchGene.'); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + if (id !== undefined && id !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, id, 'id'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = ['application/json', 'application/problem+json']; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/genes/search`; + return this.httpClient.get>(`${this.configuration.basePath}${localVarPath}`, { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress, + }); + } +} diff --git a/libs/agora/api-client-angular/src/lib/api/teamMember.service.ts b/libs/agora/api-client-angular/src/lib/api/teams.service.ts similarity index 68% rename from libs/agora/api-client-angular/src/lib/api/teamMember.service.ts rename to libs/agora/api-client-angular/src/lib/api/teams.service.ts index 234831b942..257feae7c9 100644 --- a/libs/agora/api-client-angular/src/lib/api/teamMember.service.ts +++ b/libs/agora/api-client-angular/src/lib/api/teams.service.ts @@ -26,6 +26,8 @@ import { Observable } from 'rxjs'; // @ts-ignore import { BasicError } from '../model/basicError'; +// @ts-ignore +import { TeamsList } from '../model/teamsList'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; @@ -34,7 +36,7 @@ import { Configuration } from '../configuration'; @Injectable({ providedIn: 'root', }) -export class TeamMemberService { +export class TeamsService { protected basePath = 'http://localhost/v1'; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); @@ -186,4 +188,81 @@ export class TeamMemberService { reportProgress: reportProgress, }); } + + /** + * List Teams + * List Teams + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public listTeams( + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json' | 'application/problem+json'; + context?: HttpContext; + }, + ): Observable; + public listTeams( + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json' | 'application/problem+json'; + context?: HttpContext; + }, + ): Observable>; + public listTeams( + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json' | 'application/problem+json'; + context?: HttpContext; + }, + ): Observable>; + public listTeams( + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json' | 'application/problem+json'; + context?: HttpContext; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = ['application/json', 'application/problem+json']; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/teams`; + return this.httpClient.get(`${this.configuration.basePath}${localVarPath}`, { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress, + }); + } } diff --git a/libs/agora/api-client-angular/src/lib/model/bioDomain.ts b/libs/agora/api-client-angular/src/lib/model/bioDomain.ts new file mode 100644 index 0000000000..ef6d36e210 --- /dev/null +++ b/libs/agora/api-client-angular/src/lib/model/bioDomain.ts @@ -0,0 +1,37 @@ +/** + * Agora REST API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * BioDomain + */ +export interface BioDomain { + /** + * Name of the biological domain + */ + biodomain: string; + /** + * List of Gene Ontology (GO) terms + */ + go_terms: Array; + /** + * Number of terms associated with the biological domain + */ + n_biodomain_terms: number; + /** + * Number of gene terms linked to the biological domain + */ + n_gene_biodomain_terms: number; + /** + * Percentage of terms linking to the domain + */ + pct_linking_terms: number; +} diff --git a/libs/agora/api-client-angular/src/lib/model/bioDomainInfo.ts b/libs/agora/api-client-angular/src/lib/model/bioDomainInfo.ts new file mode 100644 index 0000000000..c6e1d27de8 --- /dev/null +++ b/libs/agora/api-client-angular/src/lib/model/bioDomainInfo.ts @@ -0,0 +1,18 @@ +/** + * Agora REST API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * BioDomainInfo + */ +export interface BioDomainInfo { + name: string; +} diff --git a/libs/agora/api-client-angular/src/lib/model/bioDomains.ts b/libs/agora/api-client-angular/src/lib/model/bioDomains.ts new file mode 100644 index 0000000000..b147dc320a --- /dev/null +++ b/libs/agora/api-client-angular/src/lib/model/bioDomains.ts @@ -0,0 +1,26 @@ +/** + * Agora REST API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { BioDomain } from './bioDomain'; + +/** + * BioDomains + */ +export interface BioDomains { + /** + * The Ensembl Gene ID. + */ + ensembl_gene_id: string; + /** + * A list of gene biodomains. + */ + gene_biodomains: Array; +} diff --git a/libs/agora/api-client-angular/src/lib/model/distribution.ts b/libs/agora/api-client-angular/src/lib/model/distribution.ts new file mode 100644 index 0000000000..d73c488e98 --- /dev/null +++ b/libs/agora/api-client-angular/src/lib/model/distribution.ts @@ -0,0 +1,25 @@ +/** + * Agora REST API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { RnaDistribution } from './rnaDistribution'; +import { ProteomicsDistribution } from './proteomicsDistribution'; +import { OverallScoresDistribution } from './overallScoresDistribution'; + +/** + * Distributions + */ +export interface Distribution { + rna_differential_expression: Array; + proteomics_LFQ: Array; + proteomics_SRM: Array; + proteomics_TMT: Array; + overall_scores: Array; +} diff --git a/libs/agora/api-client-angular/src/lib/model/druggability.ts b/libs/agora/api-client-angular/src/lib/model/druggability.ts new file mode 100644 index 0000000000..20d0e4a3a5 --- /dev/null +++ b/libs/agora/api-client-angular/src/lib/model/druggability.ts @@ -0,0 +1,24 @@ +/** + * Agora REST API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Druggability + */ +export interface Druggability { + sm_druggability_bucket: number; + safety_bucket: number; + abability_bucket: number; + pharos_class: string; + classification: string; + safety_bucket_definition: string; + abability_bucket_definition: string; +} diff --git a/libs/agora/api-client-angular/src/lib/model/ensemblInfo.ts b/libs/agora/api-client-angular/src/lib/model/ensemblInfo.ts new file mode 100644 index 0000000000..e3491e2ed8 --- /dev/null +++ b/libs/agora/api-client-angular/src/lib/model/ensemblInfo.ts @@ -0,0 +1,20 @@ +/** + * Agora REST API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * EnsemblInfo + */ +export interface EnsemblInfo { + ensembl_release: number; + ensembl_possible_replacements: Array; + ensembl_permalink: string; +} diff --git a/libs/agora/api-client-angular/src/lib/model/experimentalValidation.ts b/libs/agora/api-client-angular/src/lib/model/experimentalValidation.ts new file mode 100644 index 0000000000..1218180a67 --- /dev/null +++ b/libs/agora/api-client-angular/src/lib/model/experimentalValidation.ts @@ -0,0 +1,33 @@ +/** + * Agora REST API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Experimental Validation + */ +export interface ExperimentalValidation { + _id: string; + ensembl_gene_id: string; + hgnc_symbol: string; + hypothesis_tested: string; + summary_findings: string; + published: string; + reference: string; + species: string; + model_system: string; + outcome_measure: string; + outcome_measure_details: string; + balanced_for_sex: string; + contributors: string; + team: string; + reference_doi: string; + date_report: string; +} diff --git a/libs/agora/api-client-angular/src/lib/model/gCTGene.ts b/libs/agora/api-client-angular/src/lib/model/gCTGene.ts new file mode 100644 index 0000000000..1c47453be8 --- /dev/null +++ b/libs/agora/api-client-angular/src/lib/model/gCTGene.ts @@ -0,0 +1,76 @@ +/** + * Agora REST API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { GCTGeneNominations } from './gCTGeneNominations'; +import { GCTGeneTissue } from './gCTGeneTissue'; + +/** + * GCT Gene + */ +export interface GCTGene { + /** + * Ensembl gene identifier + */ + ensembl_gene_id: string; + /** + * HGNC gene symbol + */ + hgnc_symbol: string; + /** + * UniProt identifier + */ + uniprotid?: string | null; + /** + * Unique identifier + */ + uid?: string | null; + /** + * Search string + */ + search_string?: string | null; + /** + * Array of search terms + */ + search_array?: Array | null; + /** + * Array of gene tissues + */ + tissues: Array; + nominations?: GCTGeneNominations; + /** + * Array of association values + */ + associations?: Array | null; + /** + * Target risk score + */ + target_risk_score: number | null; + /** + * Genetics score + */ + genetics_score: number | null; + /** + * Multi-omics score + */ + multi_omics_score: number | null; + /** + * Array of biological domains + */ + biodomains?: Array | null; + /** + * Whether the gene is pinned + */ + pinned?: boolean | null; + /** + * Target enabling resources + */ + target_enabling_resources?: Array | null; +} diff --git a/libs/agora/api-client-angular/src/lib/model/gCTGeneNominations.ts b/libs/agora/api-client-angular/src/lib/model/gCTGeneNominations.ts new file mode 100644 index 0000000000..9a75a5e631 --- /dev/null +++ b/libs/agora/api-client-angular/src/lib/model/gCTGeneNominations.ts @@ -0,0 +1,45 @@ +/** + * Agora REST API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * GCTGeneNominations + */ +export interface GCTGeneNominations { + /** + * The total number of gene nominations. + */ + count: number; + /** + * The year of the nominations. + */ + year: number; + /** + * The list of teams involved in the nominations. + */ + teams: Array; + /** + * The list of studies related to the nominations. + */ + studies: Array; + /** + * The input data used for the nominations. + */ + inputs: Array; + /** + * The list of programs associated with the nominations. + */ + programs: Array; + /** + * The list of validations for the nominations. + */ + validations: Array; +} diff --git a/libs/agora/api-client-angular/src/lib/model/gCTGeneTissue.ts b/libs/agora/api-client-angular/src/lib/model/gCTGeneTissue.ts new file mode 100644 index 0000000000..e5701ead3e --- /dev/null +++ b/libs/agora/api-client-angular/src/lib/model/gCTGeneTissue.ts @@ -0,0 +1,39 @@ +/** + * Agora REST API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { MedianExpression } from './medianExpression'; + +/** + * GCTGeneTissue + */ +export interface GCTGeneTissue { + /** + * Name of the gene or tissue. + */ + name: string; + /** + * Log fold change value. + */ + logfc: number; + /** + * Adjusted p-value. + */ + adj_p_val: number; + /** + * Lower confidence interval. + */ + ci_l: number; + /** + * Upper confidence interval. + */ + ci_r: number; + medianexpression?: MedianExpression; +} diff --git a/libs/agora/api-client-angular/src/lib/model/gCTGenesList.ts b/libs/agora/api-client-angular/src/lib/model/gCTGenesList.ts new file mode 100644 index 0000000000..3f2cdc61df --- /dev/null +++ b/libs/agora/api-client-angular/src/lib/model/gCTGenesList.ts @@ -0,0 +1,19 @@ +/** + * Agora REST API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { GCTGene } from './gCTGene'; + +/** + * List of GCTGene + */ +export interface GCTGenesList { + items?: Array; +} diff --git a/libs/agora/api-client-angular/src/lib/model/gene.ts b/libs/agora/api-client-angular/src/lib/model/gene.ts new file mode 100644 index 0000000000..377938232d --- /dev/null +++ b/libs/agora/api-client-angular/src/lib/model/gene.ts @@ -0,0 +1,71 @@ +/** + * Agora REST API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { MedianExpression } from './medianExpression'; +import { ExperimentalValidation } from './experimentalValidation'; +import { EnsemblInfo } from './ensemblInfo'; +import { RnaDifferentialExpression } from './rnaDifferentialExpression'; +import { BioDomains } from './bioDomains'; +import { TargetNomination } from './targetNomination'; +import { NeuropathologicCorrelation } from './neuropathologicCorrelation'; +import { SimilarGenesNetwork } from './similarGenesNetwork'; +import { Druggability } from './druggability'; +import { OverallScores } from './overallScores'; +import { ProteinDifferentialExpression } from './proteinDifferentialExpression'; + +/** + * Gene + */ +export interface Gene { + _id: string; + ensembl_gene_id: string; + name: string; + summary: string; + hgnc_symbol: string; + alias: Array; + is_igap: boolean; + is_eqtl: boolean; + is_any_rna_changed_in_ad_brain: boolean; + rna_brain_change_studied: boolean; + is_any_protein_changed_in_ad_brain: boolean; + protein_brain_change_studied: boolean; + target_nominations: Array | null; + median_expression: Array; + druggability: Array; + total_nominations: number | null; + is_adi?: boolean; + is_tep?: boolean; + resource_url?: string | null; + rna_differential_expression?: Array | null; + proteomics_LFQ?: Array | null; + proteomics_SRM?: Array | null; + proteomics_TMT?: Array | null; + metabolomics?: { [key: string]: any } | null; + overall_scores?: OverallScores; + neuropathologic_correlations?: Array | null; + experimental_validation?: Array | null; + links?: { [key: string]: object } | null; + similar_genes_network?: SimilarGenesNetwork; + ab_modality_display_value?: string | null; + safety_rating_display_value?: string | null; + sm_druggability_display_value?: string | null; + pharos_class_display_value?: string | null; + is_any_rna_changed_in_ad_brain_display_value?: string | null; + is_any_protein_changed_in_ad_brain_display_value?: string | null; + nominated_target_display_value?: boolean | null; + initial_nomination_display_value?: number | null; + teams_display_value?: string | null; + study_display_value?: string | null; + programs_display_value?: string | null; + input_data_display_value?: string | null; + bio_domains?: BioDomains; + ensembl_info: EnsemblInfo; +} diff --git a/libs/agora/api-client-angular/src/lib/model/medianExpression.ts b/libs/agora/api-client-angular/src/lib/model/medianExpression.ts new file mode 100644 index 0000000000..4f8128386a --- /dev/null +++ b/libs/agora/api-client-angular/src/lib/model/medianExpression.ts @@ -0,0 +1,24 @@ +/** + * Agora REST API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * MedianExpression + */ +export interface MedianExpression { + min?: number; + first_quartile?: number; + median?: number; + mean?: number; + third_quartile?: number; + max?: number; + tissue: string; +} diff --git a/libs/agora/api-client-angular/src/lib/model/models.ts b/libs/agora/api-client-angular/src/lib/model/models.ts index 90cbc4253b..d683eb3a3e 100644 --- a/libs/agora/api-client-angular/src/lib/model/models.ts +++ b/libs/agora/api-client-angular/src/lib/model/models.ts @@ -1,5 +1,30 @@ export * from './basicError'; +export * from './bioDomain'; +export * from './bioDomainInfo'; +export * from './bioDomains'; export * from './dataversion'; +export * from './distribution'; +export * from './druggability'; +export * from './ensemblInfo'; +export * from './experimentalValidation'; +export * from './gCTGene'; +export * from './gCTGeneNominations'; +export * from './gCTGeneTissue'; +export * from './gCTGenesList'; +export * from './gene'; +export * from './medianExpression'; +export * from './neuropathologicCorrelation'; +export * from './nominatedGenesList'; +export * from './overallScores'; +export * from './overallScoresDistribution'; +export * from './proteinDifferentialExpression'; +export * from './proteomicsDistribution'; +export * from './rnaDifferentialExpression'; +export * from './rnaDistribution'; +export * from './similarGenesNetwork'; +export * from './similarGenesNetworkLink'; +export * from './similarGenesNetworkNode'; +export * from './targetNomination'; export * from './team'; -export * from './teamList'; export * from './teamMember'; +export * from './teamsList'; diff --git a/libs/agora/api-client-angular/src/lib/model/neuropathologicCorrelation.ts b/libs/agora/api-client-angular/src/lib/model/neuropathologicCorrelation.ts new file mode 100644 index 0000000000..2ca6214fe3 --- /dev/null +++ b/libs/agora/api-client-angular/src/lib/model/neuropathologicCorrelation.ts @@ -0,0 +1,26 @@ +/** + * Agora REST API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * NeuropathologicCorrelation + */ +export interface NeuropathologicCorrelation { + _id: string; + ensg: string; + gname: string; + oddsratio: number; + ci_lower: number; + ci_upper: number; + pval: number; + pval_adj: number; + neuropath_type: string; +} diff --git a/libs/agora/api-client-angular/src/lib/model/nominatedGenesList.ts b/libs/agora/api-client-angular/src/lib/model/nominatedGenesList.ts new file mode 100644 index 0000000000..8458fa26eb --- /dev/null +++ b/libs/agora/api-client-angular/src/lib/model/nominatedGenesList.ts @@ -0,0 +1,19 @@ +/** + * Agora REST API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Gene } from './gene'; + +/** + * List of nominated genes + */ +export interface NominatedGenesList { + items?: Array; +} diff --git a/libs/agora/api-client-angular/src/lib/model/overallScores.ts b/libs/agora/api-client-angular/src/lib/model/overallScores.ts new file mode 100644 index 0000000000..1c9bcbb6d8 --- /dev/null +++ b/libs/agora/api-client-angular/src/lib/model/overallScores.ts @@ -0,0 +1,22 @@ +/** + * Agora REST API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * OverallScores + */ +export interface OverallScores { + ensembl_gene_id: string; + target_risk_score: number; + genetics_score: number; + multi_omics_score: number; + literature_score: number; +} diff --git a/libs/agora/api-client-angular/src/lib/model/overallScoresDistribution.ts b/libs/agora/api-client-angular/src/lib/model/overallScoresDistribution.ts new file mode 100644 index 0000000000..b5ebead8e8 --- /dev/null +++ b/libs/agora/api-client-angular/src/lib/model/overallScoresDistribution.ts @@ -0,0 +1,37 @@ +/** + * Agora REST API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Distributions + */ +export interface OverallScoresDistribution { + /** + * Distribution of overall scores + */ + distribution: Array; + /** + * Bins used in the distribution + */ + bins: Array>; + /** + * Name of the score distribution + */ + name: string; + /** + * Synapse ID associated with the score + */ + syn_id: string; + /** + * Wiki ID associated with the score + */ + wiki_id: string; +} diff --git a/libs/agora/api-client-angular/src/lib/model/proteinDifferentialExpression.ts b/libs/agora/api-client-angular/src/lib/model/proteinDifferentialExpression.ts new file mode 100644 index 0000000000..a834803489 --- /dev/null +++ b/libs/agora/api-client-angular/src/lib/model/proteinDifferentialExpression.ts @@ -0,0 +1,28 @@ +/** + * Agora REST API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * ProteinDifferentialExpression + */ +export interface ProteinDifferentialExpression { + _id: string; + uniqid: string; + hgnc_symbol: string; + uniprotid: string; + ensembl_gene_id: string; + tissue: string; + log2_fc: number; + ci_upr: number; + ci_lwr: number; + pval: number; + cor_pval: number; +} diff --git a/libs/agora/api-client-angular/src/lib/model/proteomicsDistribution.ts b/libs/agora/api-client-angular/src/lib/model/proteomicsDistribution.ts new file mode 100644 index 0000000000..4e62823234 --- /dev/null +++ b/libs/agora/api-client-angular/src/lib/model/proteomicsDistribution.ts @@ -0,0 +1,21 @@ +/** + * Agora REST API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Distributions + */ +export interface ProteomicsDistribution { + /** + * Type of proteomics distribution (e.g., LFQ, SRM, TMT) + */ + type: string; +} diff --git a/libs/agora/api-client-angular/src/lib/model/rnaDifferentialExpression.ts b/libs/agora/api-client-angular/src/lib/model/rnaDifferentialExpression.ts new file mode 100644 index 0000000000..c55ba82c77 --- /dev/null +++ b/libs/agora/api-client-angular/src/lib/model/rnaDifferentialExpression.ts @@ -0,0 +1,28 @@ +/** + * Agora REST API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * RnaDifferentialExpression + */ +export interface RnaDifferentialExpression { + _id: string; + ensembl_gene_id: string; + hgnc_symbol: string; + logfc: number; + fc: number; + ci_l: number; + ci_r: number; + adj_p_val: number; + tissue: string; + study: string; + model: string; +} diff --git a/libs/agora/api-client-angular/src/lib/model/rnaDistribution.ts b/libs/agora/api-client-angular/src/lib/model/rnaDistribution.ts new file mode 100644 index 0000000000..307e82a450 --- /dev/null +++ b/libs/agora/api-client-angular/src/lib/model/rnaDistribution.ts @@ -0,0 +1,49 @@ +/** + * Agora REST API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Distributions + */ +export interface RnaDistribution { + /** + * ID of the RNA distribution + */ + _id: string; + /** + * Model of the RNA data + */ + model: string; + /** + * Tissue type + */ + tissue: string; + /** + * Minimum value in the distribution + */ + min: number; + /** + * Maximum value in the distribution + */ + max: number; + /** + * First quartile value + */ + first_quartile: number; + /** + * Median value + */ + median: number; + /** + * Third quartile value + */ + third_quartile: number; +} diff --git a/libs/agora/api-client-angular/src/lib/model/similarGenesNetwork.ts b/libs/agora/api-client-angular/src/lib/model/similarGenesNetwork.ts new file mode 100644 index 0000000000..04af68cbff --- /dev/null +++ b/libs/agora/api-client-angular/src/lib/model/similarGenesNetwork.ts @@ -0,0 +1,23 @@ +/** + * Agora REST API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { SimilarGenesNetworkLink } from './similarGenesNetworkLink'; +import { SimilarGenesNetworkNode } from './similarGenesNetworkNode'; + +/** + * SimilarGenesNetwork + */ +export interface SimilarGenesNetwork { + nodes?: Array; + links?: Array; + min?: number; + max?: number; +} diff --git a/libs/agora/api-client-angular/src/lib/model/similarGenesNetworkLink.ts b/libs/agora/api-client-angular/src/lib/model/similarGenesNetworkLink.ts new file mode 100644 index 0000000000..eab24f39b6 --- /dev/null +++ b/libs/agora/api-client-angular/src/lib/model/similarGenesNetworkLink.ts @@ -0,0 +1,22 @@ +/** + * Agora REST API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * SimilarGenesNetworkLink + */ +export interface SimilarGenesNetworkLink { + source?: string; + target?: string; + source_hgnc_symbol?: string; + target_hgnc_symbol?: string; + brain_regions?: Array; +} diff --git a/libs/agora/api-client-angular/src/lib/model/similarGenesNetworkNode.ts b/libs/agora/api-client-angular/src/lib/model/similarGenesNetworkNode.ts new file mode 100644 index 0000000000..3cf348f16f --- /dev/null +++ b/libs/agora/api-client-angular/src/lib/model/similarGenesNetworkNode.ts @@ -0,0 +1,20 @@ +/** + * Agora REST API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * SimilarGenesNetworkNode + */ +export interface SimilarGenesNetworkNode { + ensembl_gene_id?: string; + hgnc_symbol?: string; + brain_regions?: Array; +} diff --git a/libs/agora/api-client-angular/src/lib/model/targetNomination.ts b/libs/agora/api-client-angular/src/lib/model/targetNomination.ts new file mode 100644 index 0000000000..06323ec497 --- /dev/null +++ b/libs/agora/api-client-angular/src/lib/model/targetNomination.ts @@ -0,0 +1,29 @@ +/** + * Agora REST API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * TargetNomination + */ +export interface TargetNomination { + source: string; + team: string; + rank: string; + hgnc_symbol: string; + target_choice_justification: string; + predicted_therapeutic_direction: string; + data_used_to_support_target_selection: string; + data_synapseid: string; + study: string; + input_data: string; + validation_study_details: string; + initial_nomination: number; +} diff --git a/libs/agora/api-client-angular/src/lib/model/teamList.ts b/libs/agora/api-client-angular/src/lib/model/teamsList.ts similarity index 93% rename from libs/agora/api-client-angular/src/lib/model/teamList.ts rename to libs/agora/api-client-angular/src/lib/model/teamsList.ts index bb3fb7fcf1..50d7e78d6b 100644 --- a/libs/agora/api-client-angular/src/lib/model/teamList.ts +++ b/libs/agora/api-client-angular/src/lib/model/teamsList.ts @@ -14,6 +14,6 @@ import { Team } from './team'; /** * List of Teams */ -export interface TeamList { +export interface TeamsList { items?: Array; } diff --git a/libs/agora/api-description/build/openapi.yaml b/libs/agora/api-description/build/openapi.yaml index c3b20e090b..0bb12af76b 100644 --- a/libs/agora/api-description/build/openapi.yaml +++ b/libs/agora/api-description/build/openapi.yaml @@ -21,6 +21,183 @@ tags: - name: TeamMember description: Operations about team members. paths: + /biodomains: + get: + tags: + - BioDomains + summary: List BioDomains + description: List BioDomains + operationId: listBioDomains + responses: + '200': + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/BioDomainInfo' + description: Success + '400': + $ref: '#/components/responses/BadRequest' + '500': + $ref: '#/components/responses/InternalServerError' + /biodomains/{ensg}: + get: + tags: + - BioDomains + summary: Retrieve bioDomain for a given ENSG + description: Get bioDomain + operationId: getBioDomain + parameters: + - name: ensg + in: path + required: true + description: The ENSG (Ensembl Gene ID) for which to retrieve biodomain data. + schema: + type: string + responses: + '200': + description: Successful retrieval of bio-domains + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/BioDomain' + '404': + description: ENSG not found + '500': + description: Internal server error + /genes: + get: + tags: + - Genes + summary: Retrieve a list of genes or filter by Ensembl gene IDs + description: This endpoint returns all genes or filters genes by Ensembl gene IDs if provided. + operationId: getGenes + parameters: + - in: query + name: ids + schema: + type: string + description: Comma-separated list of Ensembl gene IDs to filter. + required: false + example: ENSG00000139618,ENSG00000248378 + responses: + '200': + description: A list of genes. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Gene' + '400': + $ref: '#/components/responses/BadRequest' + '500': + $ref: '#/components/responses/InternalServerError' + /genes/{ensg}: + get: + tags: + - Genes + summary: Get gene details by Ensembl Gene ID + operationId: getGene + parameters: + - name: ensg + in: path + required: true + description: Ensembl Gene ID (ENSG) + schema: + type: string + responses: + '200': + description: Gene details successfully retrieved + content: + application/json: + schema: + $ref: '#/components/schemas/Gene' + '400': + $ref: '#/components/responses/BadRequest' + '500': + $ref: '#/components/responses/InternalServerError' + /genes/search: + get: + tags: + - Genes + summary: Search Genes + description: Search Genes + operationId: searchGene + parameters: + - name: id + in: query + required: true + schema: + type: string + responses: + '200': + description: Success + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Gene' + '400': + $ref: '#/components/responses/BadRequest' + '500': + $ref: '#/components/responses/InternalServerError' + /genes/comparison: + get: + tags: + - Genes + summary: Get comparison genes based on category and subcategory + description: Get comparison genes based on category and subcategory + operationId: getComparisonGenes + parameters: + - in: query + name: category + required: true + schema: + type: string + enum: + - RNA - Differential Expression + - Protein - Differential Expression + description: The category of the comparison (either RNA or Protein Differential Expression). + - in: query + name: subCategory + required: true + schema: + type: string + description: The subcategory for gene comparison (sub-category must be a string). + responses: + '200': + description: Successful response with comparison genes + content: + application/json: + schema: + $ref: '#/components/schemas/GCTGenesList' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + /genes/nominated: + get: + tags: + - Genes + summary: Get nominated genes + description: Retrieves a list of genes with nominations and relevant information. + operationId: getNominatedGenes + responses: + '200': + description: A list of nominated genes. + content: + application/json: + schema: + $ref: '#/components/schemas/NominatedGenesList' + '400': + $ref: '#/components/responses/BadRequest' + '500': + $ref: '#/components/responses/InternalServerError' /dataversion: get: tags: @@ -39,10 +216,28 @@ paths: $ref: '#/components/responses/BadRequest' '500': $ref: '#/components/responses/InternalServerError' + /distribution: + get: + tags: + - Distribution + summary: Get distribution data + description: Get distribution data + operationId: getDistribution + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Distribution' + description: A successful response + '400': + $ref: '#/components/responses/BadRequest' + '500': + $ref: '#/components/responses/InternalServerError' /teams: get: tags: - - Team + - Teams summary: List Teams description: List Teams operationId: listTeams @@ -51,7 +246,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TeamList' + $ref: '#/components/schemas/TeamsList' description: Success '400': $ref: '#/components/responses/BadRequest' @@ -60,7 +255,7 @@ paths: /teamMembers/{name}/image: get: tags: - - TeamMember + - Teams summary: Get Team Member Image description: Get Team Member Image operationId: getTeamMemberImage @@ -89,20 +284,14 @@ paths: $ref: '#/components/responses/InternalServerError' components: schemas: - Dataversion: + BioDomainInfo: type: object - description: Synapse data version + description: BioDomainInfo properties: - data_file: - type: string - data_version: - type: string - team_images_id: + name: type: string required: - - data_file - - data_version - - team_images_id + - name BasicError: type: object description: Problem details (tools.ietf.org/html/rfc7807) @@ -125,6 +314,839 @@ components: x-java-class-annotations: - '@lombok.AllArgsConstructor' - '@lombok.Builder' + BioDomain: + type: object + description: BioDomain + properties: + biodomain: + type: string + description: Name of the biological domain + go_terms: + type: array + description: List of Gene Ontology (GO) terms + items: + type: string + n_biodomain_terms: + type: integer + description: Number of terms associated with the biological domain + n_gene_biodomain_terms: + type: integer + description: Number of gene terms linked to the biological domain + pct_linking_terms: + type: number + format: float + description: Percentage of terms linking to the domain + required: + - biodomain + - go_terms + - n_biodomain_terms + - n_gene_biodomain_terms + - pct_linking_terms + TargetNomination: + type: object + description: TargetNomination + properties: + source: + type: string + team: + type: string + rank: + type: string + hgnc_symbol: + type: string + target_choice_justification: + type: string + predicted_therapeutic_direction: + type: string + data_used_to_support_target_selection: + type: string + data_synapseid: + type: string + study: + type: string + input_data: + type: string + validation_study_details: + type: string + initial_nomination: + type: number + required: + - source + - team + - rank + - hgnc_symbol + - target_choice_justification + - predicted_therapeutic_direction + - data_used_to_support_target_selection + - data_synapseid + - study + - input_data + - validation_study_details + - initial_nomination + MedianExpression: + type: object + description: MedianExpression + properties: + min: + type: number + format: float + first_quartile: + type: number + format: float + median: + type: number + format: float + mean: + type: number + format: float + third_quartile: + type: number + format: float + max: + type: number + format: float + tissue: + type: string + required: + - tissue + Druggability: + type: object + description: Druggability + properties: + sm_druggability_bucket: + type: integer + example: 1 + safety_bucket: + type: integer + example: 2 + abability_bucket: + type: integer + example: 3 + pharos_class: + type: string + example: Tclin + classification: + type: string + example: Enzyme + safety_bucket_definition: + type: string + example: Low risk + abability_bucket_definition: + type: string + example: Moderate bioavailability + required: + - sm_druggability_bucket + - safety_bucket + - abability_bucket + - pharos_class + - classification + - safety_bucket_definition + - abability_bucket_definition + RnaDifferentialExpression: + type: object + description: RnaDifferentialExpression + properties: + _id: + type: string + ensembl_gene_id: + type: string + hgnc_symbol: + type: string + logfc: + type: number + fc: + type: number + ci_l: + type: number + ci_r: + type: number + adj_p_val: + type: number + tissue: + type: string + study: + type: string + model: + type: string + required: + - _id + - ensembl_gene_id + - hgnc_symbol + - logfc + - fc + - ci_l + - ci_r + - adj_p_val + - tissue + - study + - model + ProteinDifferentialExpression: + type: object + description: ProteinDifferentialExpression + properties: + _id: + type: string + uniqid: + type: string + hgnc_symbol: + type: string + uniprotid: + type: string + ensembl_gene_id: + type: string + tissue: + type: string + log2_fc: + type: number + ci_upr: + type: number + ci_lwr: + type: number + pval: + type: number + cor_pval: + type: number + required: + - _id + - uniqid + - hgnc_symbol + - uniprotid + - ensembl_gene_id + - tissue + - log2_fc + - ci_upr + - ci_lwr + - pval + - cor_pval + OverallScores: + type: object + description: OverallScores + properties: + ensembl_gene_id: + type: string + target_risk_score: + type: number + genetics_score: + type: number + multi_omics_score: + type: number + literature_score: + type: number + required: + - ensembl_gene_id + - target_risk_score + - genetics_score + - multi_omics_score + - literature_score + NeuropathologicCorrelation: + type: object + description: NeuropathologicCorrelation + properties: + _id: + type: string + ensg: + type: string + gname: + type: string + oddsratio: + type: number + ci_lower: + type: number + ci_upper: + type: number + pval: + type: number + pval_adj: + type: number + neuropath_type: + type: string + required: + - _id + - ensg + - gname + - oddsratio + - ci_lower + - ci_upper + - pval + - pval_adj + - neuropath_type + ExperimentalValidation: + type: object + description: Experimental Validation + properties: + _id: + type: string + ensembl_gene_id: + type: string + hgnc_symbol: + type: string + hypothesis_tested: + type: string + summary_findings: + type: string + published: + type: string + reference: + type: string + species: + type: string + model_system: + type: string + outcome_measure: + type: string + outcome_measure_details: + type: string + balanced_for_sex: + type: string + contributors: + type: string + team: + type: string + reference_doi: + type: string + date_report: + type: string + required: + - _id + - ensembl_gene_id + - hgnc_symbol + - hypothesis_tested + - summary_findings + - published + - reference + - species + - model_system + - outcome_measure + - outcome_measure_details + - balanced_for_sex + - contributors + - team + - reference_doi + - date_report + - abability_bucket_definition + SimilarGenesNetworkNode: + type: object + description: SimilarGenesNetworkNode + properties: + ensembl_gene_id: + type: string + hgnc_symbol: + type: string + brain_regions: + type: array + items: + type: string + SimilarGenesNetworkLink: + type: object + description: SimilarGenesNetworkLink + properties: + source: + type: string + target: + type: string + source_hgnc_symbol: + type: string + target_hgnc_symbol: + type: string + brain_regions: + type: array + items: + type: string + SimilarGenesNetwork: + type: object + description: SimilarGenesNetwork + properties: + nodes: + type: array + items: + $ref: '#/components/schemas/SimilarGenesNetworkNode' + links: + type: array + items: + $ref: '#/components/schemas/SimilarGenesNetworkLink' + min: + type: number + max: + type: number + BioDomains: + type: object + description: BioDomains + properties: + ensembl_gene_id: + type: string + description: The Ensembl Gene ID. + gene_biodomains: + type: array + items: + $ref: '#/components/schemas/BioDomain' + description: A list of gene biodomains. + required: + - ensembl_gene_id + - gene_biodomains + EnsemblInfo: + type: object + description: EnsemblInfo + properties: + ensembl_release: + type: integer + ensembl_possible_replacements: + type: array + items: + type: string + ensembl_permalink: + type: string + required: + - ensembl_release + - ensembl_possible_replacements + - ensembl_permalink + Gene: + type: object + description: Gene + properties: + _id: + type: string + ensembl_gene_id: + type: string + name: + type: string + summary: + type: string + hgnc_symbol: + type: string + alias: + type: array + items: + type: string + is_igap: + type: boolean + is_eqtl: + type: boolean + is_any_rna_changed_in_ad_brain: + type: boolean + rna_brain_change_studied: + type: boolean + is_any_protein_changed_in_ad_brain: + type: boolean + protein_brain_change_studied: + type: boolean + target_nominations: + type: array + items: + $ref: '#/components/schemas/TargetNomination' + nullable: true + median_expression: + type: array + items: + $ref: '#/components/schemas/MedianExpression' + druggability: + type: array + items: + $ref: '#/components/schemas/Druggability' + total_nominations: + type: integer + nullable: true + is_adi: + type: boolean + is_tep: + type: boolean + resource_url: + type: string + nullable: true + rna_differential_expression: + type: array + items: + $ref: '#/components/schemas/RnaDifferentialExpression' + nullable: true + proteomics_LFQ: + type: array + items: + $ref: '#/components/schemas/ProteinDifferentialExpression' + nullable: true + proteomics_SRM: + type: array + items: + $ref: '#/components/schemas/ProteinDifferentialExpression' + nullable: true + proteomics_TMT: + type: array + items: + $ref: '#/components/schemas/ProteinDifferentialExpression' + nullable: true + metabolomics: + type: object + additionalProperties: true + nullable: true + overall_scores: + $ref: '#/components/schemas/OverallScores' + nullable: true + neuropathologic_correlations: + type: array + items: + $ref: '#/components/schemas/NeuropathologicCorrelation' + nullable: true + experimental_validation: + type: array + items: + $ref: '#/components/schemas/ExperimentalValidation' + nullable: true + links: + type: object + additionalProperties: + type: object + nullable: true + similar_genes_network: + $ref: '#/components/schemas/SimilarGenesNetwork' + nullable: true + ab_modality_display_value: + type: string + nullable: true + safety_rating_display_value: + type: string + nullable: true + sm_druggability_display_value: + type: string + nullable: true + pharos_class_display_value: + type: string + nullable: true + is_any_rna_changed_in_ad_brain_display_value: + type: string + nullable: true + is_any_protein_changed_in_ad_brain_display_value: + type: string + nullable: true + nominated_target_display_value: + type: boolean + nullable: true + initial_nomination_display_value: + type: integer + nullable: true + teams_display_value: + type: string + nullable: true + study_display_value: + type: string + nullable: true + programs_display_value: + type: string + nullable: true + input_data_display_value: + type: string + nullable: true + bio_domains: + $ref: '#/components/schemas/BioDomains' + nullable: true + ensembl_info: + $ref: '#/components/schemas/EnsemblInfo' + required: + - _id + - ensembl_gene_id + - name + - summary + - hgnc_symbol + - alias + - is_igap + - is_eqtl + - is_any_rna_changed_in_ad_brain + - rna_brain_change_studied + - is_any_protein_changed_in_ad_brain + - protein_brain_change_studied + - target_nominations + - median_expression + - druggability + - total_nominations + - ensembl_info + GCTGeneTissue: + type: object + description: GCTGeneTissue + properties: + name: + type: string + description: Name of the gene or tissue. + logfc: + type: number + format: float + description: Log fold change value. + adj_p_val: + type: number + format: float + description: Adjusted p-value. + ci_l: + type: number + format: float + description: Lower confidence interval. + ci_r: + type: number + format: float + description: Upper confidence interval. + medianexpression: + $ref: '#/components/schemas/MedianExpression' + nullable: true + required: + - name + - logfc + - adj_p_val + - ci_l + - ci_r + - mediaexpression + GCTGeneNominations: + type: object + description: GCTGeneNominations + properties: + count: + type: integer + description: The total number of gene nominations. + year: + type: integer + description: The year of the nominations. + teams: + type: array + items: + type: string + description: The list of teams involved in the nominations. + studies: + type: array + items: + type: string + description: The list of studies related to the nominations. + inputs: + type: array + items: + type: string + description: The input data used for the nominations. + programs: + type: array + items: + type: string + description: The list of programs associated with the nominations. + validations: + type: array + items: + type: string + description: The list of validations for the nominations. + required: + - count + - year + - teams + - studies + - inputs + - programs + - validations + GCTGene: + type: object + description: GCT Gene + properties: + ensembl_gene_id: + type: string + description: Ensembl gene identifier + hgnc_symbol: + type: string + description: HGNC gene symbol + uniprotid: + type: string + nullable: true + description: UniProt identifier + uid: + type: string + nullable: true + description: Unique identifier + search_string: + type: string + nullable: true + description: Search string + search_array: + type: array + items: + type: string + nullable: true + description: Array of search terms + tissues: + type: array + items: + $ref: '#/components/schemas/GCTGeneTissue' + description: Array of gene tissues + nominations: + $ref: '#/components/schemas/GCTGeneNominations' + nullable: true + description: Gene nominations data + associations: + type: array + items: + type: number + nullable: true + description: Array of association values + target_risk_score: + type: number + nullable: true + description: Target risk score + genetics_score: + type: number + nullable: true + description: Genetics score + multi_omics_score: + type: number + nullable: true + description: Multi-omics score + biodomains: + type: array + items: + type: string + nullable: true + description: Array of biological domains + pinned: + type: boolean + nullable: true + description: Whether the gene is pinned + target_enabling_resources: + type: array + items: + type: string + nullable: true + description: Target enabling resources + required: + - ensembl_gene_id + - hgnc_symbol + - tissues + - target_risk_score + - genetics_score + - multi_omics_score + GCTGenesList: + type: object + description: List of GCTGene + properties: + items: + type: array + items: + $ref: '#/components/schemas/GCTGene' + NominatedGenesList: + type: object + description: List of nominated genes + properties: + items: + type: array + items: + $ref: '#/components/schemas/Gene' + Dataversion: + type: object + description: Synapse data version + properties: + data_file: + type: string + data_version: + type: string + team_images_id: + type: string + required: + - data_file + - data_version + - team_images_id + RnaDistribution: + type: object + description: Distributions + properties: + _id: + type: string + description: ID of the RNA distribution + model: + type: string + description: Model of the RNA data + tissue: + type: string + description: Tissue type + min: + type: number + description: Minimum value in the distribution + max: + type: number + description: Maximum value in the distribution + first_quartile: + type: number + description: First quartile value + median: + type: number + description: Median value + third_quartile: + type: number + description: Third quartile value + required: + - _id + - model + - tissue + - min + - max + - first_quartile + - median + - third_quartile + ProteomicsDistribution: + type: object + description: Distributions + properties: + type: + type: string + description: Type of proteomics distribution (e.g., LFQ, SRM, TMT) + required: + - type + OverallScoresDistribution: + type: object + description: Distributions + properties: + distribution: + type: array + items: + type: number + description: Distribution of overall scores + bins: + type: array + items: + type: array + items: + type: number + description: Bins used in the distribution + name: + type: string + description: Name of the score distribution + syn_id: + type: string + description: Synapse ID associated with the score + wiki_id: + type: string + description: Wiki ID associated with the score + required: + - distribution + - bins + - name + - syn_id + - wiki_id + Distribution: + type: object + description: Distributions + properties: + rna_differential_expression: + type: array + items: + $ref: '#/components/schemas/RnaDistribution' + proteomics_LFQ: + type: array + items: + $ref: '#/components/schemas/ProteomicsDistribution' + proteomics_SRM: + type: array + items: + $ref: '#/components/schemas/ProteomicsDistribution' + proteomics_TMT: + type: array + items: + $ref: '#/components/schemas/ProteomicsDistribution' + overall_scores: + type: array + items: + $ref: '#/components/schemas/OverallScoresDistribution' + required: + - rna_differential_expression + - proteomics_LFQ + - proteomics_SRM + - proteomics_TMT + - overall_scores TeamMember: type: object description: Team Member @@ -160,7 +1182,7 @@ components: - program - description - members - TeamList: + TeamsList: type: object description: List of Teams properties: @@ -184,3 +1206,9 @@ components: application/problem+json: schema: $ref: '#/components/schemas/BasicError' + NotFound: + description: The specified resource was not found + content: + application/problem+json: + schema: + $ref: '#/components/schemas/BasicError' diff --git a/libs/agora/api-description/src/components/schemas/BioDomain.yaml b/libs/agora/api-description/src/components/schemas/BioDomain.yaml new file mode 100644 index 0000000000..c19b2c3864 --- /dev/null +++ b/libs/agora/api-description/src/components/schemas/BioDomain.yaml @@ -0,0 +1,27 @@ +type: object +description: BioDomain +properties: + biodomain: + type: string + description: Name of the biological domain + go_terms: + type: array + description: List of Gene Ontology (GO) terms + items: + type: string + n_biodomain_terms: + type: integer + description: Number of terms associated with the biological domain + n_gene_biodomain_terms: + type: integer + description: Number of gene terms linked to the biological domain + pct_linking_terms: + type: number + format: float + description: Percentage of terms linking to the domain +required: + - biodomain + - go_terms + - n_biodomain_terms + - n_gene_biodomain_terms + - pct_linking_terms diff --git a/libs/agora/api-description/src/components/schemas/BioDomainInfo.yaml b/libs/agora/api-description/src/components/schemas/BioDomainInfo.yaml new file mode 100644 index 0000000000..209fd9b22b --- /dev/null +++ b/libs/agora/api-description/src/components/schemas/BioDomainInfo.yaml @@ -0,0 +1,7 @@ +type: object +description: BioDomainInfo +properties: + name: + type: string +required: + - name diff --git a/libs/agora/api-description/src/components/schemas/BioDomains.yaml b/libs/agora/api-description/src/components/schemas/BioDomains.yaml new file mode 100644 index 0000000000..e600f2e3a2 --- /dev/null +++ b/libs/agora/api-description/src/components/schemas/BioDomains.yaml @@ -0,0 +1,14 @@ +type: object +description: BioDomains +properties: + ensembl_gene_id: + type: string + description: The Ensembl Gene ID. + gene_biodomains: + type: array + items: + $ref: BioDomain.yaml + description: A list of gene biodomains. +required: + - ensembl_gene_id + - gene_biodomains diff --git a/libs/agora/api-description/src/components/schemas/Distribution.yaml b/libs/agora/api-description/src/components/schemas/Distribution.yaml new file mode 100644 index 0000000000..6aad0216a5 --- /dev/null +++ b/libs/agora/api-description/src/components/schemas/Distribution.yaml @@ -0,0 +1,29 @@ +type: object +description: Distributions +properties: + rna_differential_expression: + type: array + items: + $ref: RnaDistribution.yaml + proteomics_LFQ: + type: array + items: + $ref: ProteomicsDistribution.yaml + proteomics_SRM: + type: array + items: + $ref: ProteomicsDistribution.yaml + proteomics_TMT: + type: array + items: + $ref: ProteomicsDistribution.yaml + overall_scores: + type: array + items: + $ref: OverallScoresDistribution.yaml +required: + - rna_differential_expression + - proteomics_LFQ + - proteomics_SRM + - proteomics_TMT + - overall_scores diff --git a/libs/agora/api-description/src/components/schemas/Druggability.yaml b/libs/agora/api-description/src/components/schemas/Druggability.yaml new file mode 100644 index 0000000000..c4f0db0e06 --- /dev/null +++ b/libs/agora/api-description/src/components/schemas/Druggability.yaml @@ -0,0 +1,32 @@ +type: object +description: Druggability +properties: + sm_druggability_bucket: + type: integer + example: 1 + safety_bucket: + type: integer + example: 2 + abability_bucket: + type: integer + example: 3 + pharos_class: + type: string + example: 'Tclin' + classification: + type: string + example: 'Enzyme' + safety_bucket_definition: + type: string + example: 'Low risk' + abability_bucket_definition: + type: string + example: 'Moderate bioavailability' +required: + - sm_druggability_bucket + - safety_bucket + - abability_bucket + - pharos_class + - classification + - safety_bucket_definition + - abability_bucket_definition diff --git a/libs/agora/api-description/src/components/schemas/EnsemblInfo.yaml b/libs/agora/api-description/src/components/schemas/EnsemblInfo.yaml new file mode 100644 index 0000000000..784dcdeba6 --- /dev/null +++ b/libs/agora/api-description/src/components/schemas/EnsemblInfo.yaml @@ -0,0 +1,15 @@ +type: object +description: EnsemblInfo +properties: + ensembl_release: + type: integer + ensembl_possible_replacements: + type: array + items: + type: string + ensembl_permalink: + type: string +required: + - ensembl_release + - ensembl_possible_replacements + - ensembl_permalink diff --git a/libs/agora/api-description/src/components/schemas/ExperimentalValidation.yaml b/libs/agora/api-description/src/components/schemas/ExperimentalValidation.yaml new file mode 100644 index 0000000000..0009fa672f --- /dev/null +++ b/libs/agora/api-description/src/components/schemas/ExperimentalValidation.yaml @@ -0,0 +1,53 @@ +type: object +description: Experimental Validation +properties: + _id: + type: string + ensembl_gene_id: + type: string + hgnc_symbol: + type: string + hypothesis_tested: + type: string + summary_findings: + type: string + published: + type: string + reference: + type: string + species: + type: string + model_system: + type: string + outcome_measure: + type: string + outcome_measure_details: + type: string + balanced_for_sex: + type: string + contributors: + type: string + team: + type: string + reference_doi: + type: string + date_report: + type: string +required: + - _id + - ensembl_gene_id + - hgnc_symbol + - hypothesis_tested + - summary_findings + - published + - reference + - species + - model_system + - outcome_measure + - outcome_measure_details + - balanced_for_sex + - contributors + - team + - reference_doi + - date_report + - abability_bucket_definition diff --git a/libs/agora/api-description/src/components/schemas/GCTGene.yaml b/libs/agora/api-description/src/components/schemas/GCTGene.yaml new file mode 100644 index 0000000000..2e0f6d5afd --- /dev/null +++ b/libs/agora/api-description/src/components/schemas/GCTGene.yaml @@ -0,0 +1,77 @@ +type: object +description: GCT Gene +properties: + ensembl_gene_id: + type: string + description: 'Ensembl gene identifier' + hgnc_symbol: + type: string + description: 'HGNC gene symbol' + uniprotid: + type: string + nullable: true + description: 'UniProt identifier' + uid: + type: string + nullable: true + description: 'Unique identifier' + search_string: + type: string + nullable: true + description: 'Search string' + search_array: + type: array + items: + type: string + nullable: true + description: 'Array of search terms' + tissues: + type: array + items: + $ref: GCTGeneTissue.yaml + description: 'Array of gene tissues' + nominations: + $ref: GCTGeneNominations.yaml + nullable: true + description: 'Gene nominations data' + associations: + type: array + items: + type: number + nullable: true + description: 'Array of association values' + target_risk_score: + type: number + nullable: true + description: 'Target risk score' + genetics_score: + type: number + nullable: true + description: 'Genetics score' + multi_omics_score: + type: number + nullable: true + description: 'Multi-omics score' + biodomains: + type: array + items: + type: string + nullable: true + description: 'Array of biological domains' + pinned: + type: boolean + nullable: true + description: 'Whether the gene is pinned' + target_enabling_resources: + type: array + items: + type: string + nullable: true + description: 'Target enabling resources' +required: + - ensembl_gene_id + - hgnc_symbol + - tissues + - target_risk_score + - genetics_score + - multi_omics_score diff --git a/libs/agora/api-description/src/components/schemas/GCTGeneNominations.yaml b/libs/agora/api-description/src/components/schemas/GCTGeneNominations.yaml new file mode 100644 index 0000000000..b0af0c42be --- /dev/null +++ b/libs/agora/api-description/src/components/schemas/GCTGeneNominations.yaml @@ -0,0 +1,42 @@ +type: object +description: GCTGeneNominations +properties: + count: + type: integer + description: 'The total number of gene nominations.' + year: + type: integer + description: 'The year of the nominations.' + teams: + type: array + items: + type: string + description: 'The list of teams involved in the nominations.' + studies: + type: array + items: + type: string + description: 'The list of studies related to the nominations.' + inputs: + type: array + items: + type: string + description: 'The input data used for the nominations.' + programs: + type: array + items: + type: string + description: 'The list of programs associated with the nominations.' + validations: + type: array + items: + type: string + description: 'The list of validations for the nominations.' +required: + - count + - year + - teams + - studies + - inputs + - programs + - validations diff --git a/libs/agora/api-description/src/components/schemas/GCTGeneTissue.yaml b/libs/agora/api-description/src/components/schemas/GCTGeneTissue.yaml new file mode 100644 index 0000000000..45b6d0eacf --- /dev/null +++ b/libs/agora/api-description/src/components/schemas/GCTGeneTissue.yaml @@ -0,0 +1,32 @@ +type: object +description: GCTGeneTissue +properties: + name: + type: string + description: 'Name of the gene or tissue.' + logfc: + type: number + format: float + description: 'Log fold change value.' + adj_p_val: + type: number + format: float + description: 'Adjusted p-value.' + ci_l: + type: number + format: float + description: 'Lower confidence interval.' + ci_r: + type: number + format: float + description: 'Upper confidence interval.' + medianexpression: + $ref: MedianExpression.yaml + nullable: true +required: + - name + - logfc + - adj_p_val + - ci_l + - ci_r + - mediaexpression diff --git a/libs/agora/api-description/src/components/schemas/GCTGenesList.yaml b/libs/agora/api-description/src/components/schemas/GCTGenesList.yaml new file mode 100644 index 0000000000..cc53b437d2 --- /dev/null +++ b/libs/agora/api-description/src/components/schemas/GCTGenesList.yaml @@ -0,0 +1,7 @@ +type: object +description: List of GCTGene +properties: + items: + type: array + items: + $ref: GCTGene.yaml diff --git a/libs/agora/api-description/src/components/schemas/Gene.yaml b/libs/agora/api-description/src/components/schemas/Gene.yaml new file mode 100644 index 0000000000..7a7cff7ab9 --- /dev/null +++ b/libs/agora/api-description/src/components/schemas/Gene.yaml @@ -0,0 +1,156 @@ +type: object +description: Gene +properties: + _id: + type: string + ensembl_gene_id: + type: string + name: + type: string + summary: + type: string + hgnc_symbol: + type: string + alias: + type: array + items: + type: string + is_igap: + type: boolean + is_eqtl: + type: boolean + is_any_rna_changed_in_ad_brain: + type: boolean + rna_brain_change_studied: + type: boolean + is_any_protein_changed_in_ad_brain: + type: boolean + protein_brain_change_studied: + type: boolean + target_nominations: + type: array + items: + $ref: TargetNomination.yaml + nullable: true + median_expression: + type: array + items: + $ref: MedianExpression.yaml + druggability: + type: array + items: + $ref: Druggability.yaml + total_nominations: + type: integer + nullable: true + is_adi: + type: boolean + is_tep: + type: boolean + resource_url: + type: string + nullable: true + rna_differential_expression: + type: array + items: + $ref: RnaDifferentialExpression.yaml + nullable: true + proteomics_LFQ: + type: array + items: + $ref: ProteinDifferentialExpression.yaml + nullable: true + proteomics_SRM: + type: array + items: + $ref: ProteinDifferentialExpression.yaml + nullable: true + proteomics_TMT: + type: array + items: + $ref: ProteinDifferentialExpression.yaml + nullable: true + metabolomics: + type: object + additionalProperties: true + nullable: true + overall_scores: + $ref: OverallScores.yaml + nullable: true + neuropathologic_correlations: + type: array + items: + $ref: NeuropathologicCorrelation.yaml + nullable: true + experimental_validation: + type: array + items: + $ref: ExperimentalValidation.yaml + nullable: true + links: + type: object + additionalProperties: + type: object + nullable: true + similar_genes_network: + $ref: SimilarGenesNetwork.yaml + nullable: true + ab_modality_display_value: + type: string + nullable: true + safety_rating_display_value: + type: string + nullable: true + sm_druggability_display_value: + type: string + nullable: true + pharos_class_display_value: + type: string + nullable: true + is_any_rna_changed_in_ad_brain_display_value: + type: string + nullable: true + is_any_protein_changed_in_ad_brain_display_value: + type: string + nullable: true + nominated_target_display_value: + type: boolean + nullable: true + initial_nomination_display_value: + type: integer + nullable: true + teams_display_value: + type: string + nullable: true + study_display_value: + type: string + nullable: true + programs_display_value: + type: string + nullable: true + input_data_display_value: + type: string + nullable: true + bio_domains: + $ref: BioDomains.yaml + nullable: true + ensembl_info: + $ref: EnsemblInfo.yaml +required: + - _id + - ensembl_gene_id + - name + - summary + - hgnc_symbol + - alias + - is_igap + - is_eqtl + - is_any_rna_changed_in_ad_brain + - rna_brain_change_studied + - is_any_protein_changed_in_ad_brain + - protein_brain_change_studied + - target_nominations + - median_expression + - druggability + - total_nominations + - ensembl_info diff --git a/libs/agora/api-description/src/components/schemas/MedianExpression.yaml b/libs/agora/api-description/src/components/schemas/MedianExpression.yaml new file mode 100644 index 0000000000..f60b3c9723 --- /dev/null +++ b/libs/agora/api-description/src/components/schemas/MedianExpression.yaml @@ -0,0 +1,25 @@ +type: object +description: MedianExpression +properties: + min: + type: number + format: float + first_quartile: + type: number + format: float + median: + type: number + format: float + mean: + type: number + format: float + third_quartile: + type: number + format: float + max: + type: number + format: float + tissue: + type: string +required: + - tissue diff --git a/libs/agora/api-description/src/components/schemas/NeuropathologicCorrelation.yaml b/libs/agora/api-description/src/components/schemas/NeuropathologicCorrelation.yaml new file mode 100644 index 0000000000..d9e194e0c8 --- /dev/null +++ b/libs/agora/api-description/src/components/schemas/NeuropathologicCorrelation.yaml @@ -0,0 +1,31 @@ +type: object +description: NeuropathologicCorrelation +properties: + _id: + type: string + ensg: + type: string + gname: + type: string + oddsratio: + type: number + ci_lower: + type: number + ci_upper: + type: number + pval: + type: number + pval_adj: + type: number + neuropath_type: + type: string +required: + - _id + - ensg + - gname + - oddsratio + - ci_lower + - ci_upper + - pval + - pval_adj + - neuropath_type diff --git a/libs/agora/api-description/src/components/schemas/NominatedGenesList.yaml b/libs/agora/api-description/src/components/schemas/NominatedGenesList.yaml new file mode 100644 index 0000000000..d21ab09640 --- /dev/null +++ b/libs/agora/api-description/src/components/schemas/NominatedGenesList.yaml @@ -0,0 +1,7 @@ +type: object +description: List of nominated genes +properties: + items: + type: array + items: + $ref: Gene.yaml diff --git a/libs/agora/api-description/src/components/schemas/OverallScores.yaml b/libs/agora/api-description/src/components/schemas/OverallScores.yaml new file mode 100644 index 0000000000..f25d6fb652 --- /dev/null +++ b/libs/agora/api-description/src/components/schemas/OverallScores.yaml @@ -0,0 +1,19 @@ +type: object +description: OverallScores +properties: + ensembl_gene_id: + type: string + target_risk_score: + type: number + genetics_score: + type: number + multi_omics_score: + type: number + literature_score: + type: number +required: + - ensembl_gene_id + - target_risk_score + - genetics_score + - multi_omics_score + - literature_score diff --git a/libs/agora/api-description/src/components/schemas/OverallScoresDistribution.yaml b/libs/agora/api-description/src/components/schemas/OverallScoresDistribution.yaml new file mode 100644 index 0000000000..327df5c5bc --- /dev/null +++ b/libs/agora/api-description/src/components/schemas/OverallScoresDistribution.yaml @@ -0,0 +1,30 @@ +type: object +description: Distributions +properties: + distribution: + type: array + items: + type: number + description: Distribution of overall scores + bins: + type: array + items: + type: array + items: + type: number + description: Bins used in the distribution + name: + type: string + description: Name of the score distribution + syn_id: + type: string + description: Synapse ID associated with the score + wiki_id: + type: string + description: Wiki ID associated with the score +required: + - distribution + - bins + - name + - syn_id + - wiki_id diff --git a/libs/agora/api-description/src/components/schemas/ProteinDifferentialExpression.yaml b/libs/agora/api-description/src/components/schemas/ProteinDifferentialExpression.yaml new file mode 100644 index 0000000000..9ff2f3cd10 --- /dev/null +++ b/libs/agora/api-description/src/components/schemas/ProteinDifferentialExpression.yaml @@ -0,0 +1,37 @@ +type: object +description: ProteinDifferentialExpression +properties: + _id: + type: string + uniqid: + type: string + hgnc_symbol: + type: string + uniprotid: + type: string + ensembl_gene_id: + type: string + tissue: + type: string + log2_fc: + type: number + ci_upr: + type: number + ci_lwr: + type: number + pval: + type: number + cor_pval: + type: number +required: + - _id + - uniqid + - hgnc_symbol + - uniprotid + - ensembl_gene_id + - tissue + - log2_fc + - ci_upr + - ci_lwr + - pval + - cor_pval diff --git a/libs/agora/api-description/src/components/schemas/ProteomicsDistribution.yaml b/libs/agora/api-description/src/components/schemas/ProteomicsDistribution.yaml new file mode 100644 index 0000000000..ea9fcfccf1 --- /dev/null +++ b/libs/agora/api-description/src/components/schemas/ProteomicsDistribution.yaml @@ -0,0 +1,8 @@ +type: object +description: Distributions +properties: + type: + type: string + description: Type of proteomics distribution (e.g., LFQ, SRM, TMT) +required: + - type diff --git a/libs/agora/api-description/src/components/schemas/RnaDifferentialExpression.yaml b/libs/agora/api-description/src/components/schemas/RnaDifferentialExpression.yaml new file mode 100644 index 0000000000..379b965ef3 --- /dev/null +++ b/libs/agora/api-description/src/components/schemas/RnaDifferentialExpression.yaml @@ -0,0 +1,37 @@ +type: object +description: RnaDifferentialExpression +properties: + _id: + type: string + ensembl_gene_id: + type: string + hgnc_symbol: + type: string + logfc: + type: number + fc: + type: number + ci_l: + type: number + ci_r: + type: number + adj_p_val: + type: number + tissue: + type: string + study: + type: string + model: + type: string +required: + - _id + - ensembl_gene_id + - hgnc_symbol + - logfc + - fc + - ci_l + - ci_r + - adj_p_val + - tissue + - study + - model diff --git a/libs/agora/api-description/src/components/schemas/RnaDistribution.yaml b/libs/agora/api-description/src/components/schemas/RnaDistribution.yaml new file mode 100644 index 0000000000..c070969f97 --- /dev/null +++ b/libs/agora/api-description/src/components/schemas/RnaDistribution.yaml @@ -0,0 +1,36 @@ +type: object +description: Distributions +properties: + _id: + type: string + description: ID of the RNA distribution + model: + type: string + description: Model of the RNA data + tissue: + type: string + description: Tissue type + min: + type: number + description: Minimum value in the distribution + max: + type: number + description: Maximum value in the distribution + first_quartile: + type: number + description: First quartile value + median: + type: number + description: Median value + third_quartile: + type: number + description: Third quartile value +required: + - _id + - model + - tissue + - min + - max + - first_quartile + - median + - third_quartile diff --git a/libs/agora/api-description/src/components/schemas/Scores.yaml b/libs/agora/api-description/src/components/schemas/Scores.yaml new file mode 100644 index 0000000000..c96942252f --- /dev/null +++ b/libs/agora/api-description/src/components/schemas/Scores.yaml @@ -0,0 +1,25 @@ +type: object +description: Scores +properties: + ensembl_gene_id: + type: string + description: The ensembl gene ID. + target_risk_score: + type: number + description: The target risk score. + genetics_score: + type: number + description: The genetics score. + multi_omics_score: + type: number + description: The multi-omics score. +required: + - ensembl_gene_id + - target_risk_score + - genetics_score + - multi_omics_score +example: + ensembl_gene_id: 'ENSG00000139618' + target_risk_score: 12.5 + genetics_score: 8.3 + multi_omics_score: 15.2 diff --git a/libs/agora/api-description/src/components/schemas/SimilarGenesNetwork.yaml b/libs/agora/api-description/src/components/schemas/SimilarGenesNetwork.yaml new file mode 100644 index 0000000000..4a84e2a691 --- /dev/null +++ b/libs/agora/api-description/src/components/schemas/SimilarGenesNetwork.yaml @@ -0,0 +1,15 @@ +type: object +description: SimilarGenesNetwork +properties: + nodes: + type: array + items: + $ref: SimilarGenesNetworkNode.yaml + links: + type: array + items: + $ref: SimilarGenesNetworkLink.yaml + min: + type: number + max: + type: number diff --git a/libs/agora/api-description/src/components/schemas/SimilarGenesNetworkLink.yaml b/libs/agora/api-description/src/components/schemas/SimilarGenesNetworkLink.yaml new file mode 100644 index 0000000000..b66f77f2cc --- /dev/null +++ b/libs/agora/api-description/src/components/schemas/SimilarGenesNetworkLink.yaml @@ -0,0 +1,15 @@ +type: object +description: SimilarGenesNetworkLink +properties: + source: + type: string + target: + type: string + source_hgnc_symbol: + type: string + target_hgnc_symbol: + type: string + brain_regions: + type: array + items: + type: string diff --git a/libs/agora/api-description/src/components/schemas/SimilarGenesNetworkNode.yaml b/libs/agora/api-description/src/components/schemas/SimilarGenesNetworkNode.yaml new file mode 100644 index 0000000000..58a267c45e --- /dev/null +++ b/libs/agora/api-description/src/components/schemas/SimilarGenesNetworkNode.yaml @@ -0,0 +1,11 @@ +type: object +description: SimilarGenesNetworkNode +properties: + ensembl_gene_id: + type: string + hgnc_symbol: + type: string + brain_regions: + type: array + items: + type: string diff --git a/libs/agora/api-description/src/components/schemas/TargetNomination.yaml b/libs/agora/api-description/src/components/schemas/TargetNomination.yaml new file mode 100644 index 0000000000..5e68b0aeec --- /dev/null +++ b/libs/agora/api-description/src/components/schemas/TargetNomination.yaml @@ -0,0 +1,40 @@ +type: object +description: TargetNomination +properties: + source: + type: string + team: + type: string + rank: + type: string + hgnc_symbol: + type: string + target_choice_justification: + type: string + predicted_therapeutic_direction: + type: string + data_used_to_support_target_selection: + type: string + data_synapseid: + type: string + study: + type: string + input_data: + type: string + validation_study_details: + type: string + initial_nomination: + type: number +required: + - source + - team + - rank + - hgnc_symbol + - target_choice_justification + - predicted_therapeutic_direction + - data_used_to_support_target_selection + - data_synapseid + - study + - input_data + - validation_study_details + - initial_nomination diff --git a/libs/agora/api-description/src/components/schemas/TeamList.yaml b/libs/agora/api-description/src/components/schemas/TeamsList.yaml similarity index 100% rename from libs/agora/api-description/src/components/schemas/TeamList.yaml rename to libs/agora/api-description/src/components/schemas/TeamsList.yaml diff --git a/libs/agora/api-description/src/openapi.yaml b/libs/agora/api-description/src/openapi.yaml index 051c8903f6..e9bf42e939 100644 --- a/libs/agora/api-description/src/openapi.yaml +++ b/libs/agora/api-description/src/openapi.yaml @@ -21,8 +21,24 @@ tags: - name: TeamMember description: Operations about team members. paths: + /biodomains: + $ref: paths/biodomains.yaml + /biodomains/{ensg}: + $ref: paths/biodomains/@{ensg}.yaml + /genes: + $ref: paths/genes.yaml + /genes/{ensg}: + $ref: paths/genes/@{ensg}.yaml + /genes/search: + $ref: paths/genes/search.yaml + /genes/comparison: + $ref: paths/genes/comparison.yaml + /genes/nominated: + $ref: paths/genes/nominated.yaml /dataversion: $ref: paths/dataversion.yaml + /distribution: + $ref: paths/distribution.yaml /teams: $ref: paths/teams.yaml /teamMembers/{name}/image: diff --git a/libs/agora/api-description/src/paths/biodomains.yaml b/libs/agora/api-description/src/paths/biodomains.yaml new file mode 100644 index 0000000000..1ce6c686a7 --- /dev/null +++ b/libs/agora/api-description/src/paths/biodomains.yaml @@ -0,0 +1,19 @@ +get: + tags: + - BioDomains + summary: List BioDomains + description: List BioDomains + operationId: listBioDomains + responses: + '200': + content: + application/json: + schema: + type: array + items: + $ref: ../components/schemas/BioDomainInfo.yaml + description: Success + '400': + $ref: ../components/responses/BadRequest.yaml + '500': + $ref: ../components/responses/InternalServerError.yaml diff --git a/libs/agora/api-description/src/paths/biodomains/@{ensg}.yaml b/libs/agora/api-description/src/paths/biodomains/@{ensg}.yaml new file mode 100644 index 0000000000..51c80d39ef --- /dev/null +++ b/libs/agora/api-description/src/paths/biodomains/@{ensg}.yaml @@ -0,0 +1,26 @@ +get: + tags: + - BioDomains + summary: Retrieve bioDomain for a given ENSG + description: Get bioDomain + operationId: getBioDomain + parameters: + - name: ensg + in: path + required: true + description: The ENSG (Ensembl Gene ID) for which to retrieve biodomain data. + schema: + type: string + responses: + '200': + description: Successful retrieval of bio-domains + content: + application/json: + schema: + type: array + items: + $ref: ../../components/schemas/BioDomain.yaml + '404': + description: ENSG not found + '500': + description: Internal server error diff --git a/libs/agora/api-description/src/paths/distribution.yaml b/libs/agora/api-description/src/paths/distribution.yaml new file mode 100644 index 0000000000..1ce1826586 --- /dev/null +++ b/libs/agora/api-description/src/paths/distribution.yaml @@ -0,0 +1,17 @@ +get: + tags: + - Distribution + summary: Get distribution data + description: Get distribution data + operationId: getDistribution + responses: + '200': + content: + application/json: + schema: + $ref: ../components/schemas/Distribution.yaml + description: A successful response + '400': + $ref: ../components/responses/BadRequest.yaml + '500': + $ref: ../components/responses/InternalServerError.yaml diff --git a/libs/agora/api-description/src/paths/genes.yaml b/libs/agora/api-description/src/paths/genes.yaml new file mode 100644 index 0000000000..da51d24950 --- /dev/null +++ b/libs/agora/api-description/src/paths/genes.yaml @@ -0,0 +1,27 @@ +get: + tags: + - Genes + summary: Retrieve a list of genes or filter by Ensembl gene IDs + description: This endpoint returns all genes or filters genes by Ensembl gene IDs if provided. + operationId: getGenes + parameters: + - in: query + name: ids + schema: + type: string + description: Comma-separated list of Ensembl gene IDs to filter. + required: false + example: 'ENSG00000139618,ENSG00000248378' + responses: + '200': + description: A list of genes. + content: + application/json: + schema: + type: array + items: + $ref: ../components/schemas/Gene.yaml + '400': + $ref: ../components/responses/BadRequest.yaml + '500': + $ref: ../components/responses/InternalServerError.yaml diff --git a/libs/agora/api-description/src/paths/genes/@{ensg}.yaml b/libs/agora/api-description/src/paths/genes/@{ensg}.yaml new file mode 100644 index 0000000000..5e735e02de --- /dev/null +++ b/libs/agora/api-description/src/paths/genes/@{ensg}.yaml @@ -0,0 +1,23 @@ +get: + tags: + - Genes + summary: Get gene details by Ensembl Gene ID + operationId: getGene + parameters: + - name: ensg + in: path + required: true + description: Ensembl Gene ID (ENSG) + schema: + type: string + responses: + '200': + description: Gene details successfully retrieved + content: + application/json: + schema: + $ref: ../../components/schemas/Gene.yaml + '400': + $ref: ../../components/responses/BadRequest.yaml + '500': + $ref: ../../components/responses/InternalServerError.yaml diff --git a/libs/agora/api-description/src/paths/genes/comparison.yaml b/libs/agora/api-description/src/paths/genes/comparison.yaml new file mode 100644 index 0000000000..c3817b0cf9 --- /dev/null +++ b/libs/agora/api-description/src/paths/genes/comparison.yaml @@ -0,0 +1,33 @@ +get: + tags: + - Genes + summary: Get comparison genes based on category and subcategory + description: Get comparison genes based on category and subcategory + operationId: getComparisonGenes + parameters: + - in: query + name: category + required: true + schema: + type: string + enum: + - 'RNA - Differential Expression' + - 'Protein - Differential Expression' + description: The category of the comparison (either RNA or Protein Differential Expression). + - in: query + name: subCategory + required: true + schema: + type: string + description: The subcategory for gene comparison (sub-category must be a string). + responses: + '200': + description: Successful response with comparison genes + content: + application/json: + schema: + $ref: ../../components/schemas/GCTGenesList.yaml + '404': + $ref: ../../components/responses/NotFound.yaml + '500': + $ref: ../../components/responses/InternalServerError.yaml diff --git a/libs/agora/api-description/src/paths/genes/nominated.yaml b/libs/agora/api-description/src/paths/genes/nominated.yaml new file mode 100644 index 0000000000..1745c6285e --- /dev/null +++ b/libs/agora/api-description/src/paths/genes/nominated.yaml @@ -0,0 +1,17 @@ +get: + tags: + - Genes + summary: Get nominated genes + description: Retrieves a list of genes with nominations and relevant information. + operationId: getNominatedGenes + responses: + '200': + description: A list of nominated genes. + content: + application/json: + schema: + $ref: ../../components/schemas/NominatedGenesList.yaml + '400': + $ref: ../../components/responses/BadRequest.yaml + '500': + $ref: ../../components/responses/InternalServerError.yaml diff --git a/libs/agora/api-description/src/paths/genes/search.yaml b/libs/agora/api-description/src/paths/genes/search.yaml new file mode 100644 index 0000000000..a25a8f9909 --- /dev/null +++ b/libs/agora/api-description/src/paths/genes/search.yaml @@ -0,0 +1,25 @@ +get: + tags: + - Genes + summary: Search Genes + description: Search Genes + operationId: searchGene + parameters: + - name: id + in: query + required: true + schema: + type: string + responses: + '200': + description: Success + content: + application/json: + schema: + type: array + items: + $ref: ../../components/schemas/Gene.yaml + '400': + $ref: ../../components/responses/BadRequest.yaml + '500': + $ref: ../../components/responses/InternalServerError.yaml diff --git a/libs/agora/api-description/src/paths/nominated.yaml b/libs/agora/api-description/src/paths/nominated.yaml new file mode 100644 index 0000000000..4e0cff71e6 --- /dev/null +++ b/libs/agora/api-description/src/paths/nominated.yaml @@ -0,0 +1,17 @@ +get: + tags: + - NominatedGenes + summary: Get nominated genes + description: Get nominated genes + operationId: listNominatedGenes + responses: + '200': + content: + application/json: + schema: + $ref: ../components/schemas/NominatedGenesList.yaml + description: Success + '400': + $ref: ../components/responses/BadRequest.yaml + '500': + $ref: ../components/responses/InternalServerError.yaml diff --git a/libs/agora/api-description/src/paths/teamMembers/@{name}/image.yaml b/libs/agora/api-description/src/paths/teamMembers/@{name}/image.yaml index 6d7dd96d9e..ac2bc6e94f 100644 --- a/libs/agora/api-description/src/paths/teamMembers/@{name}/image.yaml +++ b/libs/agora/api-description/src/paths/teamMembers/@{name}/image.yaml @@ -1,6 +1,6 @@ get: tags: - - TeamMember + - Teams summary: Get Team Member Image description: Get Team Member Image operationId: getTeamMemberImage diff --git a/libs/agora/api-description/src/paths/teams.yaml b/libs/agora/api-description/src/paths/teams.yaml index 144863dc18..c3720a9d4c 100644 --- a/libs/agora/api-description/src/paths/teams.yaml +++ b/libs/agora/api-description/src/paths/teams.yaml @@ -1,6 +1,6 @@ get: tags: - - Team + - Teams summary: List Teams description: List Teams operationId: listTeams @@ -9,7 +9,7 @@ get: content: application/json: schema: - $ref: ../components/schemas/TeamList.yaml + $ref: ../components/schemas/TeamsList.yaml description: Success '400': $ref: ../components/responses/BadRequest.yaml diff --git a/libs/agora/nominated-targets/src/lib/nominated-targets.component.ts b/libs/agora/nominated-targets/src/lib/nominated-targets.component.ts index cfb0ffdece..5990e73194 100644 --- a/libs/agora/nominated-targets/src/lib/nominated-targets.component.ts +++ b/libs/agora/nominated-targets/src/lib/nominated-targets.component.ts @@ -1,7 +1,9 @@ import { CommonModule } from '@angular/common'; -import { Component } from '@angular/core'; +import { Component, inject, OnInit } from '@angular/core'; import { RouterLink } from '@angular/router'; +import { Gene, TargetNomination, GenesService } from '@sagebionetworks/agora/api-client-angular'; import { GeneTableComponent } from '@sagebionetworks/agora/genes'; +import { GeneTableColumn } from '@sagebionetworks/agora/models'; import { ModalLinkComponent, SvgIconComponent } from '@sagebionetworks/agora/ui'; @Component({ @@ -11,162 +13,158 @@ import { ModalLinkComponent, SvgIconComponent } from '@sagebionetworks/agora/ui' templateUrl: './nominated-targets.component.html', styleUrls: ['./nominated-targets.component.scss'], }) -export class NominatedTargetsComponent { - // genes: Gene[] = []; +export class NominatedTargetsComponent implements OnInit { + apiService = inject(GenesService); + + genes: Gene[] = []; searchTerm = ''; nominations: number[] = []; - // columns: GeneTableColumn[] = [ - // { field: 'hgnc_symbol', header: 'Gene Symbol', selected: true }, - // { field: 'total_nominations', header: 'Nominations', selected: true }, - // { - // field: 'initial_nomination_display_value', - // header: 'Year First Nominated', - // selected: true, - // }, - // { - // field: 'teams_display_value', - // header: 'Nominating Teams', - // selected: true, - // }, - // { field: 'study_display_value', header: 'Cohort Study', selected: true }, - // { - // field: 'programs_display_value', - // header: 'Program', - // selected: false, - // }, - // { - // field: 'input_data_display_value', - // header: 'Input Data', - // selected: false, - // }, - // { - // field: 'pharos_class_display_value', - // header: 'Pharos Class', - // selected: false, - // }, - // { - // field: 'sm_druggability_display_value', - // header: 'Small Molecule Druggability', - // selected: false, - // }, - // { - // field: 'safety_rating_display_value', - // header: 'Safety Rating', - // selected: false, - // }, - // { - // field: 'ab_modality_display_value', - // header: 'Antibody Modality', - // selected: false, - // }, - // ]; - // constructor(private apiService: ApiService) {} - // ngOnInit() { - // this.apiService.getNominatedGenes().subscribe((response: GenesResponse) => { - // const genes = response.items; - // genes.forEach((de: Gene) => { - // let teamsArray: string[] = []; - // let studyArray: string[] = []; - // let programsArray: string[] = []; - // let inputDataArray: string[] = []; - // let initialNominationArray: number[] = []; - // if (de.total_nominations) { - // if (!this.nominations.includes(de.total_nominations)) { - // this.nominations.push(de.total_nominations); - // this.nominations.sort(); - // } - // } - // // Handle TargetNomination fields - // // First map all entries nested in the data to a new array - // if (de.target_nominations?.length) { - // teamsArray = de.target_nominations.map((nt: TargetNomination) => nt.team); - // studyArray = this.removeNullAndEmptyStrings( - // de.target_nominations.map((nt: TargetNomination) => nt.study) - // ); - // programsArray = de.target_nominations.map( - // (nt: TargetNomination) => nt.source - // ); - // inputDataArray = de.target_nominations.map( - // (nt: TargetNomination) => nt.input_data - // ); - // initialNominationArray = de.target_nominations - // .map((nt: TargetNomination) => nt.initial_nomination) - // .filter((item) => item !== undefined); - // } - // // Check if there are any strings with commas inside, - // // if there are separate those into new split strings - // teamsArray = this.commaFlattenArray(teamsArray); - // studyArray = this.commaFlattenArray(studyArray); - // programsArray = this.commaFlattenArray(programsArray); - // inputDataArray = this.commaFlattenArray(inputDataArray); - // // Populate targetNomination display fields - // de.teams_display_value = - // this.getCommaSeparatedStringOfUniqueSortedValues(teamsArray); - // de.study_display_value = - // this.getCommaSeparatedStringOfUniqueSortedValues(studyArray); - // de.programs_display_value = - // this.getCommaSeparatedStringOfUniqueSortedValues(programsArray); - // de.input_data_display_value = - // this.getCommaSeparatedStringOfUniqueSortedValues(inputDataArray); - // de.initial_nomination_display_value = initialNominationArray.length - // ? Math.min(...initialNominationArray) - // : undefined; - // // Populate Druggability display fields - // if (de.druggability && de.druggability.length) { - // de.pharos_class_display_value = de.druggability[0].pharos_class - // ? de.druggability[0].pharos_class - // : 'No value'; - // de.sm_druggability_display_value = - // de.druggability[0].sm_druggability_bucket + - // ': ' + - // de.druggability[0].classification; - // de.safety_rating_display_value = - // de.druggability[0].safety_bucket + - // ': ' + - // de.druggability[0].safety_bucket_definition; - // de.ab_modality_display_value = - // de.druggability[0].abability_bucket + - // ': ' + - // de.druggability[0].abability_bucket_definition; - // } else { - // de.pharos_class_display_value = 'No value'; - // de.sm_druggability_display_value = 'No value'; - // de.safety_rating_display_value = 'No value'; - // de.ab_modality_display_value = 'No value'; - // } - // }); - // this.genes = genes; - // }); - // } - // removeNullAndEmptyStrings(items: (string | null)[]) { - // return items.filter((item) => Boolean(item)) as string[]; - // } - // getUnique(value: string, index: number, self: any) { - // return self.indexOf(value) === index; - // } - // commaFlattenArray(array: string[]): string[] { - // const finalArray: string[] = []; - // array.forEach((t) => { - // const i = t.indexOf(', '); - // if (i > -1) { - // const tmpArray = t.split(', '); - // tmpArray.forEach((val) => finalArray.push(val)); - // } else { - // finalArray.push(t); - // } - // }); - // return finalArray; - // } - // getCommaSeparatedStringOfUniqueSortedValues(inputArray: string[]) { - // let display_value = ''; - // if (inputArray.length) { - // display_value = inputArray - // .filter(this.getUnique) - // .sort((a: string, b: string) => a.localeCompare(b)) - // .join(', '); - // } - // return display_value; - // } + columns: GeneTableColumn[] = [ + { field: 'hgnc_symbol', header: 'Gene Symbol', selected: true }, + { field: 'total_nominations', header: 'Nominations', selected: true }, + { + field: 'initial_nomination_display_value', + header: 'Year First Nominated', + selected: true, + }, + { + field: 'teams_display_value', + header: 'Nominating Teams', + selected: true, + }, + { field: 'study_display_value', header: 'Cohort Study', selected: true }, + { + field: 'programs_display_value', + header: 'Program', + selected: false, + }, + { + field: 'input_data_display_value', + header: 'Input Data', + selected: false, + }, + { + field: 'pharos_class_display_value', + header: 'Pharos Class', + selected: false, + }, + { + field: 'sm_druggability_display_value', + header: 'Small Molecule Druggability', + selected: false, + }, + { + field: 'safety_rating_display_value', + header: 'Safety Rating', + selected: false, + }, + { + field: 'ab_modality_display_value', + header: 'Antibody Modality', + selected: false, + }, + ]; + + ngOnInit() { + this.apiService.getNominatedGenes().subscribe((response) => { + if (!response.items) return; + const genes = response.items; + genes.forEach((de: Gene) => { + let teamsArray: string[] = []; + let studyArray: string[] = []; + let programsArray: string[] = []; + let inputDataArray: string[] = []; + let initialNominationArray: number[] = []; + if (de.total_nominations) { + if (!this.nominations.includes(de.total_nominations)) { + this.nominations.push(de.total_nominations); + this.nominations.sort(); + } + } + // Handle TargetNomination fields + // First map all entries nested in the data to a new array + if (de.target_nominations?.length) { + teamsArray = de.target_nominations.map((nt: TargetNomination) => nt.team); + studyArray = this.removeNullAndEmptyStrings( + de.target_nominations.map((nt: TargetNomination) => nt.study), + ); + programsArray = de.target_nominations.map((nt: TargetNomination) => nt.source); + inputDataArray = de.target_nominations.map((nt: TargetNomination) => nt.input_data); + initialNominationArray = de.target_nominations + .map((nt: TargetNomination) => nt.initial_nomination) + .filter((item) => item !== undefined); + } + // Check if there are any strings with commas inside, + // if there are separate those into new split strings + teamsArray = this.commaFlattenArray(teamsArray); + studyArray = this.commaFlattenArray(studyArray); + programsArray = this.commaFlattenArray(programsArray); + inputDataArray = this.commaFlattenArray(inputDataArray); + // Populate targetNomination display fields + de.teams_display_value = this.getCommaSeparatedStringOfUniqueSortedValues(teamsArray); + de.study_display_value = this.getCommaSeparatedStringOfUniqueSortedValues(studyArray); + de.programs_display_value = this.getCommaSeparatedStringOfUniqueSortedValues(programsArray); + de.input_data_display_value = + this.getCommaSeparatedStringOfUniqueSortedValues(inputDataArray); + de.initial_nomination_display_value = initialNominationArray.length + ? Math.min(...initialNominationArray) + : undefined; + // Populate Druggability display fields + if (de.druggability && de.druggability.length) { + de.pharos_class_display_value = de.druggability[0].pharos_class + ? de.druggability[0].pharos_class + : 'No value'; + de.sm_druggability_display_value = + de.druggability[0].sm_druggability_bucket + ': ' + de.druggability[0].classification; + de.safety_rating_display_value = + de.druggability[0].safety_bucket + ': ' + de.druggability[0].safety_bucket_definition; + de.ab_modality_display_value = + de.druggability[0].abability_bucket + + ': ' + + de.druggability[0].abability_bucket_definition; + } else { + de.pharos_class_display_value = 'No value'; + de.sm_druggability_display_value = 'No value'; + de.safety_rating_display_value = 'No value'; + de.ab_modality_display_value = 'No value'; + } + }); + this.genes = genes; + }); + } + + removeNullAndEmptyStrings(items: (string | null)[]) { + return items.filter((item) => Boolean(item)) as string[]; + } + + getUnique(value: string, index: number, self: any) { + return self.indexOf(value) === index; + } + + commaFlattenArray(array: string[]): string[] { + const finalArray: string[] = []; + array.forEach((t) => { + const i = t.indexOf(', '); + if (i > -1) { + const tmpArray = t.split(', '); + tmpArray.forEach((val) => finalArray.push(val)); + } else { + finalArray.push(t); + } + }); + return finalArray; + } + + getCommaSeparatedStringOfUniqueSortedValues(inputArray: string[]) { + let display_value = ''; + if (inputArray.length) { + display_value = inputArray + .filter(this.getUnique) + .sort((a: string, b: string) => a.localeCompare(b)) + .join(', '); + } + return display_value; + } onSearch(event: any) { this.searchTerm = event.target.value || ''; diff --git a/libs/agora/teams/src/lib/team-member-list/team-member-list.component.ts b/libs/agora/teams/src/lib/team-member-list/team-member-list.component.ts index 2ea1ccff23..f90b5ab1c3 100644 --- a/libs/agora/teams/src/lib/team-member-list/team-member-list.component.ts +++ b/libs/agora/teams/src/lib/team-member-list/team-member-list.component.ts @@ -1,6 +1,6 @@ import { CommonModule } from '@angular/common'; import { Component, inject, Input } from '@angular/core'; -import { Team, TeamMember, TeamMemberService } from '@sagebionetworks/agora/api-client-angular'; +import { Team, TeamMember, TeamsService } from '@sagebionetworks/agora/api-client-angular'; import { map, Observable } from 'rxjs'; @Component({ @@ -9,10 +9,10 @@ import { map, Observable } from 'rxjs'; imports: [CommonModule], templateUrl: './team-member-list.component.html', styleUrls: ['./team-member-list.component.scss'], - providers: [TeamMemberService], + providers: [TeamsService], }) export class TeamMemberListComponent { - teamMemberService = inject(TeamMemberService); + teamsService = inject(TeamsService); _team: Team = {} as Team; get team(): Team { @@ -46,7 +46,7 @@ export class TeamMemberListComponent { } getTeamMemberImageUrl(name: string): Observable { - return this.teamMemberService.getTeamMemberImage(name).pipe( + return this.teamsService.getTeamMemberImage(name).pipe( map((buffer) => { if (!buffer || buffer.size <= 0) { return; diff --git a/libs/agora/teams/src/lib/teams/teams.component.ts b/libs/agora/teams/src/lib/teams/teams.component.ts index 3e42cc4140..5f0ae38f73 100644 --- a/libs/agora/teams/src/lib/teams/teams.component.ts +++ b/libs/agora/teams/src/lib/teams/teams.component.ts @@ -1,6 +1,6 @@ import { CommonModule } from '@angular/common'; import { Component, OnInit } from '@angular/core'; -import { Team, TeamList, TeamService } from '@sagebionetworks/agora/api-client-angular'; +import { Team, TeamsList, TeamsService } from '@sagebionetworks/agora/api-client-angular'; import { HelperService } from '@sagebionetworks/agora/services'; import { TeamListComponent } from '../team-list/team-list.component'; import { catchError, finalize, map, Observable, of } from 'rxjs'; @@ -11,14 +11,14 @@ import { catchError, finalize, map, Observable, of } from 'rxjs'; imports: [CommonModule, TeamListComponent], templateUrl: './teams.component.html', styleUrls: ['./teams.component.scss'], - providers: [HelperService, TeamService], + providers: [HelperService, TeamsService], }) export class TeamsComponent implements OnInit { teams$!: Observable; constructor( private helperService: HelperService, - private teamService: TeamService, + private teamsService: TeamsService, ) {} ngOnInit() { @@ -28,8 +28,8 @@ export class TeamsComponent implements OnInit { loadTeams() { this.helperService.setLoading(true); - this.teams$ = this.teamService.listTeams().pipe( - map((res: TeamList) => res.items || []), + this.teams$ = this.teamsService.listTeams().pipe( + map((res: TeamsList) => res.items || []), catchError((error: Error) => { console.error('Error loading teams:', error.message); return of([]); diff --git a/libs/agora/testing/src/lib/mocks/api-service-stub.ts b/libs/agora/testing/src/lib/mocks/api-service-stub.ts index a40f7c28c1..56f4652271 100644 --- a/libs/agora/testing/src/lib/mocks/api-service-stub.ts +++ b/libs/agora/testing/src/lib/mocks/api-service-stub.ts @@ -6,7 +6,7 @@ import { Observable, of } from 'rxjs'; import { Gene, GenesResponse, GCTGeneResponse, Distribution } from '@sagebionetworks/agora/models'; import { geneMock1, geneMock2, gctGeneMock1, nominatedGeneMock1, teamsResponseMock } from './'; -import { Team, TeamList } from '@sagebionetworks/agora/api-client-angular'; +import { TeamsList } from '@sagebionetworks/agora/api-client-angular'; @Injectable() export class ApiServiceStub { @@ -34,7 +34,7 @@ export class ApiServiceStub { return of({} as Distribution); } - getTeams(): Observable { + getTeams(): Observable { return of(teamsResponseMock); } diff --git a/libs/agora/testing/src/lib/mocks/team-mocks.ts b/libs/agora/testing/src/lib/mocks/team-mocks.ts index 8f1479a24c..ce47f728ca 100644 --- a/libs/agora/testing/src/lib/mocks/team-mocks.ts +++ b/libs/agora/testing/src/lib/mocks/team-mocks.ts @@ -2,7 +2,7 @@ import { Team, - TeamList as TeamsResponse, + TeamsList as TeamsResponse, TeamMember, } from '@sagebionetworks/agora/api-client-angular'; diff --git a/libs/agora/testing/src/lib/mocks/team-service-mock.ts b/libs/agora/testing/src/lib/mocks/team-service-mock.ts index efbde8ec97..ba08fdcbb0 100644 --- a/libs/agora/testing/src/lib/mocks/team-service-mock.ts +++ b/libs/agora/testing/src/lib/mocks/team-service-mock.ts @@ -1,9 +1,9 @@ // team-service.mock.ts import { Injectable } from '@angular/core'; -import { Team, TeamService } from '@sagebionetworks/agora/api-client-angular'; +import { Team, TeamsService } from '@sagebionetworks/agora/api-client-angular'; @Injectable() -export class MockTeamService extends TeamService { +export class MockTeamService extends TeamsService { getMembers(): Promise { return Promise.resolve({ team: 'Test Team',