diff --git a/admin/mockStudies.mjs b/admin/mockStudies.mjs index 5868857..f08ff07 100644 --- a/admin/mockStudies.mjs +++ b/admin/mockStudies.mjs @@ -2,18 +2,6 @@ import Ajv from 'ajv'; export const mockStudies = [ { - controlled_access: ['Registered', 'Controlled'], - data_category: [ - 'Genomics', - 'Transcriptomics', - 'Proteomics', - 'Metabolomics', - 'Cognitive', - 'Immune maps', - 'Microbiome', - 'Imaging', - 'Clinical', - ], dataset: [ { dataset_id: 'HTP-TR', @@ -107,33 +95,12 @@ export const mockStudies = [ ], date_collection_end_year: '', date_collection_start_year: '2016', - experimental_strategies: [ - { - file_count: 3200, - experimental_strategy: 'RNA-Seq', - }, - { - file_count: 880, - experimental_strategy: 'Whole Genome Sequencing', - }, - { - file_count: 447, - experimental_strategy: 'Multiplex Immunoassay', - }, - { - file_count: 418, - experimental_strategy: 'LCMS Metabolomics', - }, - ], - external_ids: ['phs002330', 'phs002981'], institutions: ['Linda Crnic Institute for Down Syndrome'], investigator_names: ['Joaquin M. Espinosa'], is_harmonized: true, study_code: 'HTP', }, { - controlled_access: ['Registered', 'Controlled'], - data_category: ['Genomics', 'Clinical'], dataset: [ { dataset_id: 'DS-COG-ALL-GEN', @@ -184,33 +151,12 @@ export const mockStudies = [ ], date_collection_end_year: '', date_collection_start_year: '', - experimental_strategies: [ - { - file_count: 0, - experimental_strategy: 'RNA-Seq', - }, - { - file_count: 7211, - experimental_strategy: 'Whole Genome Sequencing', - }, - { - file_count: 0, - experimental_strategy: 'Multiplex Immunoassay', - }, - { - file_count: 0, - experimental_strategy: 'LCMS Metabolomics', - }, - ], - external_ids: ['phs002330'], institutions: ['Baylor College Of Medicine'], investigator_names: ['Phillip J. Lupo'], is_harmonized: true, study_code: 'DS-COG-ALL', }, { - controlled_access: ['Controlled'], - data_category: ['Genomics', 'Clinical'], dataset: [ { dataset_id: 'DS360-CHD-GEN', @@ -261,33 +207,12 @@ export const mockStudies = [ ], date_collection_end_year: '', date_collection_start_year: '', - experimental_strategies: [ - { - file_count: 0, - experimental_strategy: 'RNA-Seq', - }, - { - file_count: 3769, - experimental_strategy: 'Whole Genome Sequencing', - }, - { - file_count: 0, - experimental_strategy: 'Multiplex Immunoassay', - }, - { - file_count: 0, - experimental_strategy: 'LCMS Metabolomics', - }, - ], - external_ids: ['phs002330'], institutions: ['Emory University School of Medicine'], investigator_names: ['Stephanie Sherman'], is_harmonized: true, study_code: 'DS360-CHD', }, { - controlled_access: ['Controlled'], - data_category: ['Genomics', 'Clinical'], dataset: [ { dataset_id: 'DS-PCGC-GEN', @@ -338,33 +263,12 @@ export const mockStudies = [ ], date_collection_end_year: '', date_collection_start_year: '', - experimental_strategies: [ - { - file_count: 0, - experimental_strategy: 'RNA-Seq', - }, - { - file_count: 818, - experimental_strategy: 'Whole Genome Sequencing', - }, - { - file_count: 0, - experimental_strategy: 'Multiplex Immunoassay', - }, - { - file_count: 0, - experimental_strategy: 'LCMS Metabolomics', - }, - ], - external_ids: ['phs001138', 'phs002330'], institutions: ["Cincinnati Children's Hospital Medical Center"], investigator_names: ['Eileen C. King'], is_harmonized: true, study_code: 'DS-PCGC', }, { - controlled_access: ['Registered'], - data_category: ['Genomics', 'Transcriptomics', 'Imaging', 'Clinical'], dataset: [ { dataset_id: 'X01-Hakon-GEN', @@ -438,33 +342,12 @@ export const mockStudies = [ ], date_collection_end_year: '', date_collection_start_year: '', - experimental_strategies: [ - { - file_count: 2565, - experimental_strategy: 'RNA-Seq', - }, - { - file_count: 0, - experimental_strategy: 'Whole Genome Sequencing', - }, - { - file_count: 0, - experimental_strategy: 'Multiplex Immunoassay', - }, - { - file_count: 0, - experimental_strategy: 'LCMS Metabolomics', - }, - ], - external_ids: ['phs002983'], institutions: ["Children's Hospital of Philadelphia"], investigator_names: ['Hakon Hakonarson'], is_harmonized: true, study_code: 'X01-Hakonarson', }, { - controlled_access: ['Registered'], - data_category: ['Clinical'], dataset: [ { dataset_id: 'X01-deSmith-GEN', @@ -515,123 +398,39 @@ export const mockStudies = [ ], date_collection_end_year: '', date_collection_start_year: '', - experimental_strategies: [ - { - file_count: 0, - experimental_strategy: 'RNA-Seq', - }, - { - file_count: 0, - experimental_strategy: 'Whole Genome Sequencing', - }, - { - file_count: 0, - experimental_strategy: 'Multiplex Immunoassay', - }, - { - file_count: 0, - experimental_strategy: 'LCMS Metabolomics', - }, - ], - external_ids: ['phs002982'], institutions: ['University of Oxford'], investigator_names: ['Adam de Smith'], is_harmonized: true, study_code: 'X01-deSmith', }, { - controlled_access: ['Registered'], - data_category: ['Transcriptomics', 'Clinical'], dataset: [], date_collection_end_year: '', date_collection_start_year: '2018', - experimental_strategies: [ - { - file_count: 253, - experimental_strategy: 'RNA-Seq', - }, - { - file_count: 0, - experimental_strategy: 'Whole Genome Sequencing', - }, - { - file_count: 0, - experimental_strategy: 'Multiplex Immunoassay', - }, - { - file_count: 0, - experimental_strategy: 'LCMS Metabolomics', - }, - ], - external_ids: [], institutions: ['Benaroya Research Institute'], investigator_names: ['Jane Buckner'], is_harmonized: true, study_code: 'BRI-DSR', }, { - controlled_access: ['Controlled'], - data_category: ['Genomics', 'Clinical'], dataset: [], date_collection_end_year: '', date_collection_start_year: '', - experimental_strategies: [ - { - file_count: 0, - experimental_strategy: 'RNA-Seq', - }, - { - file_count: 123, - experimental_strategy: 'Whole Genome Sequencing', - }, - { - file_count: 0, - experimental_strategy: 'Multiplex Immunoassay', - }, - { - file_count: 0, - experimental_strategy: 'LCMS Metabolomics', - }, - ], - external_ids: [], institutions: ['Linda Crnic Institute for Down Syndrome'], investigator_names: ['Joaquin Espinosa'], is_harmonized: true, study_code: 'DS-NEXUS', }, { - controlled_access: [], - data_category: ['Clinical'], dataset: [], date_collection_end_year: '', date_collection_start_year: '', - experimental_strategies: [ - { - file_count: 0, - experimental_strategy: 'RNA-Seq', - }, - { - file_count: 0, - experimental_strategy: 'Whole Genome Sequencing', - }, - { - file_count: 0, - experimental_strategy: 'Multiplex Immunoassay', - }, - { - file_count: 0, - experimental_strategy: 'LCMS Metabolomics', - }, - ], - external_ids: [], institutions: ['Geisinger Health System'], investigator_names: ['Christa Martin'], is_harmonized: true, study_code: 'DS-Sleep', }, { - controlled_access: [], - data_category: ['Clinical'], dataset: [ { dataset_id: 'DS-Connect-UNHAR', @@ -659,55 +458,15 @@ export const mockStudies = [ ], date_collection_end_year: '', date_collection_start_year: '2013', - experimental_strategies: [ - { - file_count: 0, - experimental_strategy: 'RNA-Seq', - }, - { - file_count: 0, - experimental_strategy: 'Whole Genome Sequencing', - }, - { - file_count: 0, - experimental_strategy: 'Multiplex Immunoassay', - }, - { - file_count: 0, - experimental_strategy: 'LCMS Metabolomics', - }, - ], - external_ids: [], institutions: ['Eunice Kennedy Shriver National Institute of Child Health and Human Development'], investigator_names: ['Sujata Bardhan'], is_harmonized: true, study_code: 'DSC', }, { - controlled_access: [], - data_category: ['Clinical'], dataset: [], date_collection_end_year: '', date_collection_start_year: '', - experimental_strategies: [ - { - file_count: 0, - experimental_strategy: 'RNA-Seq', - }, - { - file_count: 0, - experimental_strategy: 'Whole Genome Sequencing', - }, - { - file_count: 0, - experimental_strategy: 'Multiplex Immunoassay', - }, - { - file_count: 0, - experimental_strategy: 'LCMS Metabolomics', - }, - ], - external_ids: [], institutions: ['University of Pittsburgh'], investigator_names: ['Bradley T. Christian', 'Benjamin L. Handen', 'Elizabeth Head', 'Mark Mapstone'], is_harmonized: true, @@ -719,18 +478,6 @@ const sSchema = { title: 'Study', type: 'object', properties: { - controlled_access: { - type: 'array', - items: { - type: 'string', - }, - }, - data_category: { - type: 'array', - items: { - type: 'string', - }, - }, dataset: { type: 'array', items: { @@ -817,26 +564,6 @@ const sSchema = { date_collection_start_year: { type: 'string', }, - experimental_strategies: { - type: 'array', - items: { - type: 'object', - properties: { - file_count: { - type: 'integer', - }, - experimental_strategy: { - type: 'string', - }, - }, - }, - }, - external_ids: { - type: 'array', - items: { - type: 'string', - }, - }, institutions: { type: 'array', items: { diff --git a/admin/poorsManEsMappingsInpector.mjs b/admin/poorsManEsMappingsInpector.mjs index d45ebcd..b5c04dc 100644 --- a/admin/poorsManEsMappingsInpector.mjs +++ b/admin/poorsManEsMappingsInpector.mjs @@ -16,10 +16,11 @@ const indicesWithMappingContainingIgnoreAbove = Object.entries(r.body) if (matchesStartPos.length === 0) { return xs; } - const radiusInChars = 75; + const leftRadius = 75; + const rightRadius = 25; return [ ...xs, - { index: indexName, loci: matchesStartPos.map(n => sm.slice(n - radiusInChars, n + radiusInChars)) }, + { index: indexName, loci: matchesStartPos.map(n => sm.slice(n - leftRadius, n + rightRadius)) }, ]; }, []); diff --git a/admin/suggestStepFnPayload.mjs b/admin/suggestStepFnPayload.mjs index b9c966e..9d4df55 100644 --- a/admin/suggestStepFnPayload.mjs +++ b/admin/suggestStepFnPayload.mjs @@ -70,7 +70,7 @@ const allStudiesSearchResponse = await client.search({ }, }); -const allStudiesHits = (allStudiesSearchResponse?.body?.hits?.hits || []).sort(); +const allStudiesHits = allStudiesSearchResponse?.body?.hits?.hits || []; const fhirUrls = { ['kf-qa']: 'https://kf-api-fhir-service-upgrade-qa.kf-strides.org', @@ -82,7 +82,10 @@ const fhirUrls = { if (project === 'include') { const payloadInc = { releaseId: rel, - studyIds: allStudiesHits.filter(x => !x._index.includes('kf')).map(x => x._source.study_id), + studyIds: allStudiesHits + .filter(x => !x._index.includes('kf')) + .map(x => x._source.study_id) + .sort(), clusterSize: 'medium', portalEtlName: `clin-${env}-inc-${rel}`, fhirUrl: fhirUrls[`inc-${env}`], @@ -97,7 +100,10 @@ const addKfSuffixToRelIfInclude = () => `${rel}${isInclude ? '_kf' : ''}`; const payloadKf = { releaseId: addKfSuffixToRelIfInclude(), - studyIds: allStudiesHits.filter(x => (isInclude ? x._index.includes('kf') : x)).map(x => x._source.study_id), + studyIds: allStudiesHits + .filter(x => (isInclude ? x._index.includes('kf') : x)) + .map(x => x._source.study_id) + .sort(), clusterSize: 'medium', portalEtlName: `clin-${env}-${isInclude ? 'inc-kf' : 'kf'}-${addKfSuffixToRelIfInclude()}`, fhirUrl: fhirUrls[`kf-${env}`],