Skip to content

Commit

Permalink
Combine together CL and PCL to simplify the process
Browse files Browse the repository at this point in the history
  • Loading branch information
johardi committed Aug 3, 2024
1 parent c7fc30d commit cfe4338
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 50 deletions.
15 changes: 9 additions & 6 deletions scripts/download-ontologies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,24 @@ rm -rf $MIRROR_DIR/fma.zip

echo "Downloading the latest CL ontology..."
curl -L "$OBO_BASE_URL/cl/cl-base.owl" \
--create-dirs -o "$MIRROR_DIR/cl.owl" \
--create-dirs -o "$MIRROR_DIR/cl-base.owl" \
--retry 4 \
--max-time 200 && \
robot convert -i "$MIRROR_DIR/cl.owl" \
robot convert -i "$MIRROR_DIR/cl-base.owl" \
--format owl \
-o "$MIRROR_DIR/cl.owl"
-o "$MIRROR_DIR/cl-base.owl"

echo "Downloading the latest PCL ontology..."
curl -L "$OBO_BASE_URL/pcl/pcl-base.owl" \
--create-dirs -o "$MIRROR_DIR/pcl.owl" \
--create-dirs -o "$MIRROR_DIR/pcl-base.owl" \
--retry 4 \
--max-time 200 && \
robot convert -i "$MIRROR_DIR/pcl.owl" \
robot convert -i "$MIRROR_DIR/pcl-base.owl" \
--format owl \
-o "$MIRROR_DIR/pcl.owl"
-o "$MIRROR_DIR/pcl-base.owl"

echo "Merging CL and PCL ontologies to create a full CL ontology..."
robot merge --input "$MIRROR_DIR/cl-base.owl" --input "$MIRROR_DIR/pcl-base.owl" -o "$MIRROR_DIR/cl.owl"

echo "Downloading the latest LHMA ontology..."
curl -L "https://data.bioontology.org/ontologies/LUNGMAP_H_CELL/submissions/6/download?apikey=8b5b7825-538d-40e0-9e9e-5ab9274a9aeb" \
Expand Down
13 changes: 0 additions & 13 deletions src/enrichment/enrich-2d-ftu.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,6 @@ export function enrich2dFtuData(context) {
push(inputPaths, clExtractPath);
}

const pclEntitiesPath = collectEntities(context, 'pcl', baseInputPath);
if (!isFileEmpty(pclEntitiesPath)) {
info('Extracting PCL.');
const pclExtractPath = extractClassHierarchy(
context,
'pcl',
'http://purl.obolibrary.org/obo/CL_0000000',
pclEntitiesPath
);
logOutput(pclExtractPath);
push(inputPaths, pclExtractPath);
}

info('Merging files:');
for (const inputPath of inputPaths) {
more(` -> ${inputPath}`);
Expand Down
13 changes: 0 additions & 13 deletions src/enrichment/enrich-asct-b.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,6 @@ export function enrichAsctbData(context) {
inputPaths.push(clExtractPath);
}

const pclEntitiesPath = collectEntities(context, 'pcl', enrichedWithValidationPath);
if (!isFileEmpty(pclEntitiesPath)) {
info('Extracting PCL.');
const pclExtractPath = extractClassHierarchy(
context,
'pcl',
'http://purl.obolibrary.org/obo/CL_0000000',
pclEntitiesPath
);
logOutput(pclExtractPath);
inputPaths.push(pclExtractPath);
}

const lmhaEntitiesPath = collectEntities(context, 'lmha', enrichedWithValidationPath);
if (!isFileEmpty(lmhaEntitiesPath)) {
info('Extracting LMHA.');
Expand Down
6 changes: 4 additions & 2 deletions src/utils/get-cl-terms.sparql
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ WHERE {
{
SELECT (?s AS ?entity) WHERE {
?s ?p ?o .
FILTER(STRSTARTS(STR(?s),"http://purl.obolibrary.org/obo/CL_"))
FILTER(STRSTARTS(STR(?s),"http://purl.obolibrary.org/obo/CL_")
|| STRSTARTS(STR(?s),"http://purl.obolibrary.org/obo/PCL_"))
}
}
UNION
{
SELECT (?o AS ?entity) WHERE {
?s ?p ?o .
FILTER(STRSTARTS(STR(?o),"http://purl.obolibrary.org/obo/CL_"))
FILTER(STRSTARTS(STR(?o),"http://purl.obolibrary.org/obo/CL_")
|| STRSTARTS(STR(?o),"http://purl.obolibrary.org/obo/PCL_"))
}
}
}
16 changes: 0 additions & 16 deletions src/utils/get-pcl-terms.sparql

This file was deleted.

0 comments on commit cfe4338

Please sign in to comment.