diff --git a/backend/src/decentriq.py b/backend/src/decentriq.py index 40fa3ab..2b4afd8 100644 --- a/backend/src/decentriq.py +++ b/backend/src/decentriq.py @@ -116,6 +116,7 @@ def pandas_script_merge_cohorts(merged_cohorts: dict[str, list[str]], all_cohort ) async def create_compute_dcr( cohorts_request: dict[str, Any], + airlock: bool = True, user: Any = Depends(get_current_user), ) -> dict[str, Any]: """Create a Data Clean Room for computing with the cohorts requested using Decentriq SDK""" @@ -157,8 +158,9 @@ async def create_compute_dcr( .with_name(dcr_title) .with_owner(settings.decentriq_email) .with_description("A data clean room to run computations on cohorts for the iCARE4CVD project") - .with_airlock() ) + if airlock: + builder.with_airlock() preview_nodes = [] # Convert cohort variables to decentriq schema @@ -168,14 +170,15 @@ async def create_compute_dcr( builder.add_node_definition(TableDataNodeDefinition(name=data_node_id, columns=get_cohort_schema(cohort), is_required=True)) data_nodes.append(data_node_id) - # Add airlock node to make it easy to access small part of the dataset - preview_node_id = f"preview-{data_node_id}" - builder.add_node_definition(PreviewComputeNodeDefinition( - name=preview_node_id, - dependency=data_node_id, - quota_bytes=1048576, # 10MB - )) - preview_nodes.append(preview_node_id) + if airlock: + # Add airlock node to make it easy to access small part of the dataset + preview_node_id = f"preview-{data_node_id}" + builder.add_node_definition(PreviewComputeNodeDefinition( + name=preview_node_id, + dependency=data_node_id, + quota_bytes=1048576, # 10MB + )) + preview_nodes.append(preview_node_id) # Add data owners to provision the data for owner in cohort.cohort_email: @@ -207,7 +210,8 @@ async def create_compute_dcr( builder.add_participant(user["email"], analyst_of=[f"prepare-{cohort_id}"]) # Add users permissions - builder.add_participant(user["email"], analyst_of=preview_nodes) + if airlock: + builder.add_participant(user["email"], analyst_of=preview_nodes) builder.add_participant(settings.decentriq_email, data_owner_of=data_nodes) # Build and publish DCR diff --git a/cohort-explorer-ontology.ttl b/cohort-explorer-ontology.ttl index b6f7efd..1f2b416 100644 --- a/cohort-explorer-ontology.ttl +++ b/cohort-explorer-ontology.ttl @@ -9,7 +9,7 @@ icare: a owl:Ontology ; rdfs:label "iCARE4CVD ontology" ; - dcterms:license ; + dcterms:license ; vann:preferredNamespacePrefix "icare" ; vann:preferredNamespaceUri "https://w3id.org/icare4cvd/" ; rdfs:comment "OWL ontology for the iCARE4CVD project, to represent Cohorts tabular file containing Variables for individuals in the cohort (metadata, measurement, etc)"@en . diff --git a/frontend/src/pages/upload.tsx b/frontend/src/pages/upload.tsx index 116245b..a3f68aa 100644 --- a/frontend/src/pages/upload.tsx +++ b/frontend/src/pages/upload.tsx @@ -9,6 +9,7 @@ import {apiUrl} from '@/utils'; export default function UploadPage() { const {cohortsData, fetchCohortsData, userEmail} = useCohorts(); const [cohortId, setCohortId] = useState(''); + const [enableAirlock, setEnableAirlock] = useState(false); const [metadataFile, setMetadataFile]: any = useState(null); const [dataFile, setDataFile]: any = useState(null); const [errorMessage, setErrorMessage] = useState(''); @@ -53,6 +54,7 @@ export default function UploadPage() { const formData = new FormData(); formData.append('cohort_id', cohortId); formData.append('cohort_dictionary', metadataFile); + formData.append('airlock', enableAirlock ? 'true' : 'false'); if (dataFile) formData.append('cohort_data', dataFile); try { const response = await fetch(`${apiUrl}/upload-cohort`, { @@ -159,6 +161,19 @@ export default function UploadPage() { +
+ +
+ {/* Upload data file */} {/* {metadataFile && <>