-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AN-372] Make DRS URI IGV enhancements generally available (#5225)
- Loading branch information
Showing
3 changed files
with
26 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,8 @@ | ||
import { getIgvMetricDetails, getValidIgvFiles, getValidIgvFilesFromAttributeValues, isDrsUri } from 'src/components/IGVFileSelector'; | ||
import { DrsUriResolver } from 'src/libs/ajax/drs/DrsUriResolver'; | ||
import { isFeaturePreviewEnabled } from 'src/libs/feature-previews'; | ||
|
||
jest.mock('src/libs/ajax/drs/DrsUriResolver'); | ||
|
||
jest.mock('src/libs/feature-previews', () => ({ | ||
...jest.requireActual('src/libs/feature-previews'), | ||
isFeaturePreviewEnabled: jest.fn(), | ||
})); | ||
|
||
describe('getValidIgvFiles', () => { | ||
it('allows BAM files with indices', async () => { | ||
expect( | ||
|
@@ -205,15 +199,37 @@ describe('getValidIgvFilesFromAttributeValues', () => { | |
}); | ||
|
||
it('does not consider single DRS URI valid', async () => { | ||
// This is a DRS URI with a data GUID namespace, from | ||
// https://support.terra.bio/hc/en-us/articles/360039330211-Overview-Interoperable-data-GA4GH-DRS-URIs | ||
const drsUri = 'drs://dg.4503:2802a94d-f540-499f-950a-db3c2a9f2dc4'; | ||
// An IGV selection generally must have a file (e.g. VCF) and an index file (TBI) | ||
const fileDrsUri = 'drs://dg.4503:2802a94d-f540-499f-950a-db3c2a9f2dc4'; | ||
const fileName = 'foo.vcf.gz'; | ||
|
||
const fileNameJson = { fileName }; | ||
|
||
// The access URL (aka signed URL) can have various parameters to track requester-pay features | ||
const accessUrlParams = '[email protected]&userProject=my-billing-project&signature=secret'; | ||
const fileAccessUrl = `https://bucket/${fileName}?${accessUrlParams}`; | ||
|
||
// DRS URIs get resolved via DRS Hub. | ||
// API docs: https://drshub.dsde-prod.broadinstitute.org/#/drsHub/resolveDrs | ||
DrsUriResolver.mockImplementation(() => ({ | ||
getDataObjectMetadata: jest.fn((_, fields) => { | ||
if (fields.includes('fileName')) { | ||
const mockJson = fileNameJson; | ||
return Promise.resolve(mockJson); | ||
} | ||
if (fields.includes('accessUrl')) { | ||
const mockAccessUrl = fileAccessUrl; | ||
const mockAccessUrlJson = { accessUrl: { url: mockAccessUrl } }; | ||
return Promise.resolve(mockAccessUrlJson); | ||
} | ||
}), | ||
})); | ||
|
||
expect( | ||
await getValidIgvFilesFromAttributeValues([ | ||
{ | ||
itemsType: 'AttributeValue', | ||
items: ['testString', drsUri, 'testString2'], | ||
items: ['testString', fileDrsUri, 'testString2'], | ||
}, | ||
]) | ||
).toEqual([]); | ||
|
@@ -273,8 +289,6 @@ describe('getValidIgvFilesFromAttributeValues', () => { | |
}), | ||
})); | ||
|
||
isFeaturePreviewEnabled.mockReturnValue(true); | ||
|
||
expect( | ||
await getValidIgvFilesFromAttributeValues([ | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,6 @@ export const COHORT_BUILDER_CARD = 'cohortBuilderCard'; | |
export const SPEND_REPORTING = 'spendReporting'; | ||
export const AUTO_GENERATE_DATA_TABLES = 'autoGenerateDataTables'; | ||
export const PREVIEW_COST_CAPPING = 'previewCostCapping'; | ||
export const IGV_ENHANCEMENTS = 'igvEnhancements'; | ||
export const GCP_BATCH = 'gcpBatch'; | ||
|
||
// If the groups option is defined for a FeaturePreview, it must contain at least one group. | ||
|
@@ -151,16 +150,6 @@ const featurePreviewsConfig: readonly FeaturePreview[] = [ | |
lastUpdated: '12/6/2024', | ||
articleUrl: 'https://support.terra.bio/hc/en-us/articles/31269696049307', | ||
}, | ||
{ | ||
id: IGV_ENHANCEMENTS, | ||
title: 'Enhancements to IGV genome browser integration', | ||
description: | ||
'Enabling this feature will show improvements that make IGV easier to find and use with data in a workspace.', | ||
feedbackUrl: `mailto:[email protected]?subject=${encodeURIComponent( | ||
'Feedback on enhancements to IGV genome browser integration' | ||
)}`, | ||
lastUpdated: '12/12/2024', | ||
}, | ||
{ | ||
id: GCP_BATCH, | ||
title: 'Run workflows on GCP Batch', | ||
|