Skip to content

Commit b8b37fb

Browse files
feat: removed verbatim ff #4350 (#4363)
1 parent e2653f5 commit b8b37fb

File tree

9 files changed

+39
-152
lines changed

9 files changed

+39
-152
lines changed

app/components/Export/components/AnVILExplorer/ExportMethod/exportMethod.tsx

Lines changed: 0 additions & 22 deletions
This file was deleted.

app/content/anvil-cmg/guides.mdx

Lines changed: 10 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ We are excited to introduce users of the [AnVIL Portal]({portalURL}) to the [AnV
1111

1212
## What is the AnVIL Data Explorer?
1313

14-
Until now, the way to browse datasets through the AnVIL portal has been to use the [AnVIL Dataset Catalog]({portalURL}/data/consortia), which allows you to organize your search results based on the workspaces that contain a subset of a dataset by its consent code. The AnVIL Dataset Catalog provides summary level information of the dataset and study.
14+
Until now, the way to browse datasets through the AnVIL Portal has been to use the [AnVIL Dataset Catalog]({portalURL}/data/consortia), which allows you to organize your search results based on the workspaces that contain a subset of a dataset by its consent code. The AnVIL Dataset Catalog provides summary level information of the dataset and study.
1515

1616
With the addition of the [AnVIL Data Explorer]({browserURL}), you’ll be able to sort the datasets you’re browsing based on the following managed access categories:
1717

@@ -31,7 +31,7 @@ When working with NIH data, particularly managed access data, users must follow
3131

3232
## How do I use the AnVIL Data Explorer?
3333

34-
Below you’ll find step-by-step instructions for navigating the AnVIL Data Explorer and exporting data to Terra. In order to successfully import data from the AnVIL Data Explorer to Terra, you’ll need to make your selection in the AnVIL Data Explorer, export this selection to a Terra workspace, and (as an interim stopgap) run a final step in the form of a Jupyter Notebook in order to retrieve all of the data relevant to your selection.
34+
Below you’ll find step-by-step instructions for navigating the AnVIL Data Explorer and exporting data to Terra.
3535

3636
### Step 1: Finding the AnVIL Data Explorer
3737

@@ -61,37 +61,20 @@ The facets are visible in the screen above in the column on the left. If you cli
6161

6262
When you select multiple facets, only data matching all selected facets is displayed (e.g. filter by Anatomical Site AND BioSample Type). When you select multiple values within a facet, data matching any of the facet values is displayed (e.g. selecting both Blood and Tissue above will list studies that include Blood OR Tissue samples).
6363

64-
#### Exploring Studies
64+
#### Exploring Datasets
6565

66-
Note: Currently the summary pages of studies in the AnVIL Data Explorer are not populated with information, yet the information described below will be populated for all of the studies as development progresses.
66+
When you click on a dataset, you’ll be taken a summary page where you can find a variety of information and helpful links, including but not limited to:
6767

68-
When you click on a study, you’ll be taken a summary page where you can find a variety of information and helpful links, including but not limited to:
69-
70-
- What consortium the data is associated with
68+
- What consortium the dataset is associated with
7169
- The quantity and types of data
7270
- Links to APIs for accessing the data programmatically
7371
- Links to request access
74-
- A button for exporting the data to a Terra workspace
72+
- A button for exporting the dataset to a Terra workspace
7573

76-
<Figure alt="Exploring Studies" src="/guides/exploring-studies.png" />
74+
<Figure alt="Exploring Datasets" src="/guides/exploring-studies.png" />
7775

7876
### Step 4: Exporting Data
7977

80-
<Alert severity="warning">
81-
<AlertTitle>Note</AlertTitle>
82-
83-
The format of exported study data is currently being updated. Exporting study
84-
data is temporarily disabled by default while this work is in progress. Export
85-
will be reenabled when the format is stable and working well.
86-
87-
</Alert>
88-
89-
To use data you’ve found through the AnVIL Data Explorer within your Terra workspace, you’ll need to follow two steps:
90-
91-
First, you export the data from the AnVIL Data Explorer to Terra.
92-
93-
Second, currently, you will need to use a publicly available notebook to fill in some of the metadata that doesn’t populate automatically.
94-
9578
#### Exporting from The AnVIL Data Explorer
9679

9780
Once you’re ready to export the data, you can click Export to Terra from within a particular study, or you can also click the Export button at the top right of your screen when you are on the AnVIL Data Explorer’s main page.
@@ -113,15 +96,13 @@ After you click this button, you will be prompted to wait while the system gener
11396
src="/guides/export-to-terra2.png"
11497
/>
11598

116-
#### Working with the Data in Terra
99+
### Working with the Data in Terra
117100

118101
Until recently, AnVIL data has been hosted and shared from multiple Terra workspaces making it hard to generate cohorts across differing studies. To resolve this, we created the AnVIL Data Explorer enabling you to create custom cohorts and then hand them off to your own Terra workspaces.
119102

120103
Depending on the AnVIL dataset/study, the data in question have varying schemas (different columns and structure to the data). In an effort to ingest all of the AnVIL datasets, the Broad's Data Sciences Platform created a common subset schema across all AnVIL datasets. When you use the AnVIL Data Explorer, it actually searches through a specialized subset - called the Findability Subset (FSS) - that only contains the attributes which are most commonly used by researchers across a broad range of study data types and for diverse analyses.
121104

122-
At this point in development, the data that you hand off from the AnVIL Data Explorer to your Terra workspace is incomplete - it only contains the columns that were deemed relevant for the FSS used in the AnVIL Data Explorer. Currently, if you want the complete data, you will need to perform one additional step after exporting to your workspace. This step is performed by running a publicly available Jupyter Notebook, as instructed below.
123-
124-
##### Working with NIH Data in Terra
105+
#### Working with NIH Data in Terra
125106

126107
When working with NIH data in Terra, we require users to import data to workspaces with the checkbox for protected data marked. Optionally, an Authorization Domain may be applied and is highly recommended if working with controlled access data.
127108

@@ -132,7 +113,7 @@ In the data handoff from the AnVIL Data Explorer, you will transition to the Ter
132113
src="/guides/working-with-data.png"
133114
/>
134115

135-
##### Selecting Workspace
116+
#### Selecting Workspace
136117

137118
Next, you’ll see a workspace selection screen where you can either choose an existing workspace or create a new workspace to receive the data.
138119

@@ -150,21 +131,3 @@ If you choose to “start with a new workspace”, you will see that the import
150131
<Figure alt="Create New Workspace" src="/guides/create-new-workspace.png" />
151132

152133
Once you’ve completed this step, your workspace will spin up and you can go to the Data tab of your workspace to see a set of tables have been successfully imported into the workspace.
153-
154-
##### Using the Notebook
155-
156-
The data you now see in your workspace is incomplete - to retrieve the complete data, you’ll need to run a Jupyter Notebook created for this purpose called \*get_non_findability_subset_data_v7.ipynb\*. We’ve published this notebook in a [public workspace](https://app.terra.bio/#workspaces/anvil-datastorage/AnVIL_Explorer_FSS_Tool) for your convenience. To complete the import process, all you need to do is copy the notebook from the public workspace into the workspace to which you’ve imported your data, and run the notebook from within that workspace.
157-
158-
##### Copy the Notebook
159-
160-
Go to the public workspace containing the AnVIL FSS tool notebook, navigate to the Analyses section, and use the three-dot menu to the right of the notebook name to find the option to copy the notebook to another workspace:
161-
162-
<Figure alt="Copy the Notebook" src="/guides/copy-notebook.png" />
163-
164-
##### Run the Notebook
165-
166-
Once the notebook is in the same workspace as the data, set up a Clou open the notebook in edit mode (the default environment is sufficient), and select “Run All” from the Cell menu:
167-
168-
<Figure alt="Run the Notebook" src="/guides/run-notebook.png" />
169-
170-
Once you’ve completed this step, you should be able to see a new set of tables in the Data tab of your workspace.

app/viewModelBuilders/azul/anvil-cmg/common/viewModelBuilders.ts

Lines changed: 1 addition & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,9 @@ import {
104104
import * as C from "../../../../components";
105105
import * as MDX from "../../../../components/common/MDXContent/anvil-cmg";
106106
import { Description } from "../../../../components/Detail/components/MDX/components/Description/description";
107-
import { ExportMethod } from "../../../../components/Export/components/AnVILExplorer/ExportMethod/exportMethod";
107+
import { ExportMethod } from "@databiosphere/findable-ui/lib/components/Export/components/ExportMethod/exportMethod";
108108
import { METADATA_KEY } from "../../../../components/Index/common/entities";
109109
import { getPluralizedMetadataLabel } from "../../../../components/Index/common/indexTransformer";
110-
import { FEATURE_FLAGS } from "../../../common/contants";
111110
import { Unused, Void } from "../../../common/entities";
112111
import { SUMMARY_DISPLAY_TEXT } from "./summaryMapper/constants";
113112
import { mapExportSummary } from "./summaryMapper/summaryMapper";
@@ -167,31 +166,6 @@ export const buildAlertDatasetManifestDownloadWarning = (
167166
};
168167
};
169168

170-
/**
171-
* Build props for dataset-related export warning Alert component.
172-
* @param _ - Unused.
173-
* @param viewContext - View context.
174-
* @returns model to be used as props for the Alert component.
175-
*/
176-
export const buildAlertDatasetTerraExportWarning = (
177-
_: Unused,
178-
viewContext: ViewContext<Unused>
179-
): React.ComponentProps<typeof MDX.Alert> => {
180-
const {
181-
exploreState: { featureFlagState },
182-
} = viewContext;
183-
const content = featureFlagState?.includes(FEATURE_FLAGS.VERBATIM)
184-
? isUserAuthenticated(viewContext)
185-
? "To export this dataset, please request access."
186-
: "To export this dataset, please sign in and, if necessary, request access."
187-
: "Export functionality is currently under development. Check back soon for updates.";
188-
return {
189-
...ALERT_PROPS.STANDARD_WARNING,
190-
component: C.FluidPaper,
191-
content,
192-
};
193-
};
194-
195169
/**
196170
* Build props for list view access warning Alert component.
197171
* @param _ - Unused.
@@ -1473,50 +1447,6 @@ export const renderWhenUnAuthenticated = (
14731447
};
14741448
};
14751449

1476-
/**
1477-
* Renders dataset export to Terra component when the given datasests response is accessible. Note,
1478-
* this can be removed once the verbatim feature flag is removed (use renderDatasetExport instead).
1479-
* @param datasetsResponse - Response model return from datasets API.
1480-
* @param viewContext - View context.
1481-
* @returns model to be used as props for the ConditionalComponent component.
1482-
* @deprecated
1483-
*/
1484-
export const renderDatasetTerraExport = (
1485-
datasetsResponse: DatasetsResponse,
1486-
viewContext: ViewContext<DatasetsResponse>
1487-
): React.ComponentProps<typeof C.ConditionalComponent> => {
1488-
const {
1489-
exploreState: { featureFlagState },
1490-
} = viewContext;
1491-
return {
1492-
isIn:
1493-
isDatasetAccessible(datasetsResponse) &&
1494-
Boolean(featureFlagState?.includes(FEATURE_FLAGS.VERBATIM)),
1495-
};
1496-
};
1497-
1498-
/**
1499-
* Renders dataset export to Terra warning component when the given datasests response is accessible. Note,
1500-
* this can be removed once the verbatim feature flag is removed (use renderDatasetExportWarning instead).
1501-
* @param datasetsResponse - Response model return from datasets API.
1502-
* @param viewContext - View context.
1503-
* @returns model to be used as props for the ConditionalComponent component.
1504-
* @deprecated
1505-
*/
1506-
export const renderDatasetTerraExportWarning = (
1507-
datasetsResponse: DatasetsResponse,
1508-
viewContext: ViewContext<DatasetsResponse>
1509-
): React.ComponentProps<typeof C.ConditionalComponent> => {
1510-
const {
1511-
exploreState: { featureFlagState },
1512-
} = viewContext;
1513-
return {
1514-
isIn:
1515-
!isDatasetAccessible(datasetsResponse) ||
1516-
Boolean(!featureFlagState?.includes(FEATURE_FLAGS.VERBATIM)),
1517-
};
1518-
};
1519-
15201450
/**
15211451
* Renders dataset export-related components (either the choose export method component,
15221452
* or specific export components) when the given dataset is accessble.

app/viewModelBuilders/common/contants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ export const DATE_TIME_FORMAT_OPTIONS: Intl.DateTimeFormatOptions = {
66
};
77
export const DATE_TIME_LOCALES = "en-US";
88
export const FEATURE_FLAGS = {
9-
VERBATIM: "verbatim",
9+
VERBATIM: "verbatim", // Deprecated
1010
};

e2e/anvil/anvil-dataset.spec.ts

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
import {
1212
MUI_ALERT_ROOT,
1313
MUI_BUTTON_GROUP_ROOT,
14+
MUI_FORM_CONTROL_ROOT,
1415
MUI_TABLE_CELL_ROOT,
1516
MUI_TABLE_ROOT,
1617
MUI_TABLE_ROW_ROOT,
@@ -151,11 +152,26 @@ describe("Dataset", () => {
151152
// Confirm Terra export method is visible and click it.
152153
await clickLink(page, BUTTON_TEXT_ANALYZE_IN_TERRA);
153154

154-
// Confirm the analyze in Terra page is loaded: check the "coming soon"
155-
// message is displayed.
156-
await expect(
157-
page.locator(`${MUI_ALERT_ROOT}:has-text("under development")`)
158-
).toBeVisible();
155+
// Confirm the analyze in Terra page is loaded: check for form elements.
156+
await expect(page.locator(MUI_FORM_CONTROL_ROOT).first()).toBeVisible();
157+
});
158+
159+
test("displays analyze in Terra selected data", async ({ page }) => {
160+
await goToDataset(page, CHIP_TEXT_ACCESS_GRANTED);
161+
162+
// Confirm export button is visible and click it.
163+
await clickLink(page, BUTTON_TEXT_EXPORT);
164+
165+
// Wait for the summary request once the file manifest button is clicked.
166+
const [request] = await Promise.all([
167+
page.waitForRequest((request) =>
168+
request.url().includes(API_ENDPOINT_SUMMARY)
169+
),
170+
clickLink(page, BUTTON_TEXT_ANALYZE_IN_TERRA),
171+
]);
172+
173+
// Confirm summary request has dataset ID request param.
174+
verifySummaryRequest(request);
159175
});
160176
});
161177

e2e/features/common/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export const MUI_ALERT_ROOT = ".MuiAlert-root";
22
export const MUI_BUTTON_GROUP_ROOT = ".MuiButtonGroup-root";
3+
export const MUI_FORM_CONTROL_ROOT = ".MuiFormControl-root";
34
export const MUI_TABLE_CELL_ROOT = ".MuiTableCell-root";
45
export const MUI_TABLE_ROOT = ".MuiTable-root";
56
export const MUI_TABLE_ROW_ROOT = ".MuiTableRow-root";

public/guides/exploring-studies.png

-2.67 MB
Loading

site-config/anvil-cmg/dev/detail/dataset/export/export.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ export const exportConfig: ExportConfig = {
3636
children: [
3737
{
3838
component: MDX.Alert,
39-
viewBuilder: V.buildAlertDatasetTerraExportWarning,
39+
viewBuilder: V.buildAlertDatasetExportWarning,
4040
} as ComponentConfig<typeof MDX.Alert, DatasetsResponse>,
4141
],
4242
component: C.BackPageContentSingleColumn,
4343
} as ComponentConfig<typeof C.BackPageContentSingleColumn>,
4444
],
4545
component: C.ConditionalComponent,
46-
viewBuilder: V.renderDatasetTerraExportWarning,
46+
viewBuilder: V.renderDatasetExportWarning,
4747
} as ComponentConfig<typeof C.ConditionalComponent, DatasetsResponse>,
4848
/* ------ */
4949
/* Dataset is accessible; render Terra export method */
@@ -63,7 +63,7 @@ export const exportConfig: ExportConfig = {
6363
...exportSideColumn,
6464
],
6565
component: C.ConditionalComponent,
66-
viewBuilder: V.renderDatasetTerraExport,
66+
viewBuilder: V.renderDatasetExport,
6767
} as ComponentConfig<typeof C.ConditionalComponent, DatasetsResponse>,
6868
],
6969
route: ROUTE_EXPORT_TO_TERRA,

site-config/anvil-cmg/dev/export/export.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
ExportConfig,
44
} from "@databiosphere/findable-ui/lib/config/entities";
55
import * as C from "../../../../app/components";
6-
import { ExportMethod } from "../../../../app/components/Export/components/AnVILExplorer/ExportMethod/exportMethod";
76
import * as V from "../../../../app/viewModelBuilders/azul/anvil-cmg/common/viewModelBuilders";
87
import { ROUTE_EXPORT_TO_TERRA, ROUTE_MANIFEST_DOWNLOAD } from "./constants";
98
import { mainColumn as exportMainColumn } from "./exportMainColumn";
@@ -73,9 +72,9 @@ export const exportConfig: ExportConfig = {
7372
{
7473
children: [
7574
{
76-
component: ExportMethod,
75+
component: C.ExportMethod,
7776
viewBuilder: V.buildExportMethodTerra,
78-
} as ComponentConfig<typeof ExportMethod>,
77+
} as ComponentConfig<typeof C.ExportMethod>,
7978
{
8079
component: C.ExportMethod,
8180
viewBuilder: V.buildExportMethodManifestDownload,

0 commit comments

Comments
 (0)