hra-api
Version:
The Human Reference Atlas (HRA) API deployed to https://apps.humanatlas.io/api/
378 lines (360 loc) • 24 kB
JavaScript
// src/library/hra-pop/operations/cell-summary-report.js
import Papa2 from "papaparse";
// src/library/shared/utils/sparql.js
import jsonld from "jsonld";
import Papa from "papaparse";
jsonld.documentLoader = async (documentUrl) => {
const document = await fetch(documentUrl).then((r) => r.json());
return {
contextUrl: null,
document,
documentUrl
};
};
function fetchSparql(query, endpoint, mimetype) {
const body = new URLSearchParams({ query });
return fetch(endpoint, {
method: "POST",
headers: {
Accept: mimetype,
"Content-Type": "application/x-www-form-urlencoded",
"Content-Length": body.toString().length.toString()
},
body
});
}
async function select(query, endpoint) {
const resp = await fetchSparql(query, endpoint, "text/csv");
const text = await resp.text();
const { data } = Papa.parse(text, { header: true, skipEmptyLines: true, dynamicTyping: true });
return data || [];
}
async function construct(query, endpoint, frame = void 0) {
const resp = await fetchSparql(query, endpoint, "application/ld+json");
const json = await resp.json();
if (frame) {
return await jsonld.frame(json, frame);
} else {
return json;
}
}
// src/library/v1/frames/rui-locations.jsonld
var rui_locations_default = {
"@context": "https://hubmapconsortium.github.io/ccf-ontology/ccf-context.jsonld",
"@type": "ccf:Donor",
samples: {
"@type": "ccf:Sample",
rui_location: {
"@type": "ccf:SpatialEntity",
"@embed": "@always",
placement: {
"@type": "ccf:SpatialPlacement"
}
},
sections: {
"@type": "ccf:Sample",
datasets: {
"@type": "ccf:Dataset",
"@embed": "@always"
}
},
datasets: {
"@type": "ccf:Dataset",
"@embed": "@always"
}
}
};
// src/library/hra-pop/queries/select-cell-summaries.rq
var select_cell_summaries_default = "PREFIX ccf: <http://purl.org/ccf/>\nPREFIX HRApop: <https://purl.humanatlas.io/graph\
/hra-pop>\nPREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\nPREFIX owl: <http://www.w3.org/2002/07/owl#>\nPREFIX UBERO\
N: <http://purl.obolibrary.org/obo/UBERON_>\nPREFIX xsd: <http://www.w3.org/2001/XMLSchema#>\nPREFIX HRA: <https://purl.hu\
manatlas.io/collection/hra-api>\n\nSELECT ?cell_source_type ?cell_source ?cell_source_label ?cell_source_link ?tool ?modal\
ity ?cell_id\n ?percentage\nFROM HRA:\nFROM HRApop:\nWHERE {\n {\n #{{VALUES}}\n #{{TOOLS}}\n ?cell_source ccf:has_ce\
ll_summary [ ccf:has_cell_summary_row [ ccf:cell_id ?cell_id ;\n ccf:cell_label ?cell_label ;\n ccf:percen\
tage_of_total ?percentage ] ] .\n }\n OPTIONAL {\n ?cell_source ccf:has_cell_summary [ ccf:cell_annotation_method ?too\
l ;\n ccf:modality ?modality ] .\n }\n OPTIONAL {\n ?cell_source rdfs:label ?cell_source_label .\n }\n OPTIONAL\
{\n ?cell_source ccf:url ?cell_source_link .\n }\n {\n #{{ORGAN_IRIs}}\n # Anatomical Structure cell sources\n \
[] ccf:representation_of ?cell_source ;\n ccf:has_reference_organ ?refOrgan .\n VALUES (?cell_source_type) { (ccf\
:AnatomicalStructure) }\n }\n UNION\n {\n {\n # Dataset cell sources\n ?block ccf:has_registration_location ?r\
ui_location .\n ?block ccf:generates_dataset ?cell_source .\n }\n UNION\n {\n ?block ccf:subdivided_into_s\
ections ?section .\n ?block ccf:has_registration_location ?rui_location .\n ?section ccf:generates_dataset ?cell\
_source .\n }\n [] a ccf:SpatialPlacement ;\n ccf:placement_for ?rui_location ;\n ccf:placement_relative_t\
o ?refOrgan .\n VALUES (?cell_source_type) { (ccf:Dataset) }\n }\n UNION\n {\n # RUI Location cell sources\n [] a \
ccf:SpatialPlacement ;\n ccf:placement_for ?cell_source ;\n ccf:placement_relative_to ?refOrgan .\n VALUES (\
?cell_source_type) { (ccf:SpatialEntity) }\n }\n ?refOrgan ccf:representation_of [ ccf:ccf_part_of* ?organ_iri ] .\n}\n";
// src/library/hra-pop/utils/cell-summary-similarity.js
import { dot, norm } from "mathjs";
function cosineSim(a, b) {
return dot(a, b) / (norm(a) * norm(b));
}
function getCellDistributionSimilarity(cellsA, cellsB) {
const keySet = new Set(Object.keys(cellsA));
let sharedKey = false;
for (const key of Object.keys(cellsB)) {
if (keySet.has(key)) {
sharedKey = true;
}
keySet.add(key);
}
if (sharedKey) {
const keys = [...keySet];
const valuesA = keys.map((key) => cellsA[key] ?? 0);
const valuesB = keys.map((key) => cellsB[key] ?? 0);
return cosineSim(valuesA, valuesB);
} else {
return 0;
}
}
// src/library/hra-pop/queries/construct-rui-locations.rq
var construct_rui_locations_default = 'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\nPREFIX rdfs: <http://ww\
w.w3.org/2000/01/rdf-schema#>\nPREFIX ccf: <http://purl.org/ccf/>\nPREFIX dcterms: <http://purl.org/dc/terms/>\nPREFIX skos\
: <http://www.w3.org/2004/02/skos/core#>\nPREFIX HRApop: <https://purl.humanatlas.io/graph/hra-pop>\nPREFIX HRA: <https://\
purl.humanatlas.io/collection/hra-api>\n\nCONSTRUCT {\n ?block rdf:type ccf:Sample ;\n rdfs:label ?sampleLabel\
;\n rdfs:comment ?sampleDescription ;\n ccf:url ?sampleLink ;\n ccf:sample_type ?sampleTy\
pe ;\n ccf:generates_dataset ?dataset ;\n ccf:has_registration_location ?rui_location ;\n \
ccf:comes_from ?donor ;\n ccf:subdivided_into_sections ?section ;\n ccf:section_count ?sectionCount \
;\n ccf:section_size ?sectionSize ;\n ccf:section_size_unit ?sectionUnits ;\n .\n ?donor rdf:type cc\
f:Donor ;\n rdfs:label ?donorLabel ;\n rdfs:comment ?donorDescription ;\n ccf:url ?donorLink ;\n \
ccf:sex ?sex ;\n ccf:age ?age ;\n ccf:bmi ?bmi ;\n ccf:consortium_name ?consortium ;\n \
ccf:tissue_provider_name ?provider ;\n ccf:tissue_provider_uuid ?provider_uuid ;\n .\n ?rui_location rdf:type ccf\
:SpatialEntity ;\n dcterms:created ?creation_date ;\n dcterms:creator ?creator ;\n \
ccf:creator_first_name ?creator_first_name ;\n ccf:creator_last_name ?creator_last_name ;\n \
ccf:dimension_unit ?dimension_units ;\n ccf:x_dimension ?x_dimension ;\n ccf:y_dimensio\
n ?y_dimension ;\n ccf:z_dimension ?z_dimension ;\n ccf:collides_with ?anatomical_structure \
;\n ccf:slice_count ?slice_count ;\n ccf:slice_thickness ?slice_thickness ;\n .\n ?SpatialPl\
acement rdf:type ccf:SpatialPlacement ;\n dcterms:created ?placement_date ;\n ccf:x_\
scaling ?x_scaling ;\n ccf:y_scaling ?y_scaling ;\n ccf:z_scaling ?z_scaling ;\n \
ccf:scaling_unit ?scaling_units ;\n ccf:x_rotation ?x_rotation ;\n cc\
f:y_rotation ?y_rotation ;\n ccf:z_rotation ?z_rotation ;\n ccf:rotation_order ?rota\
tion_order ;\n ccf:rotation_unit ?rotation_units ;\n ccf:x_translation ?x_translatio\
n ;\n ccf:y_translation ?y_translation ;\n ccf:z_translation ?z_translation ;\n \
ccf:translation_unit ?translation_units ;\n ccf:placement_relative_to ?target ;\n \
ccf:placement_for ?rui_location ;\n .\n ?section rdf:type ccf:Sample ;\n rdfs:label ?sectionLabel ;\
\n rdfs:comment ?sectionDescription ;\n ccf:url ?sectionLink ;\n ccf:sample_type ?sectionType\
;\n ccf:generates_dataset ?sectionDataset ;\n ccf:section_number ?sectionNumber ;\n .\n ?dataset rdf:\
type ccf:Dataset ;\n rdfs:label ?datasetLabel ;\n rdfs:comment ?datasetDescription ;\n ccf:ur\
l ?datasetLink ;\n ccf:technology ?technology ;\n ccf:thumbnail ?thumbnail ;\n .\n ?sectionDataset rdf\
:type ccf:Dataset ;\n rdfs:label ?sectionDatasetLabel ;\n rdfs:comment ?sectionDatasetDe\
scription ;\n ccf:url ?sectionDatasetLink ;\n ccf:technology ?sectionTechnology ;\n \
ccf:thumbnail ?sectionThumbnail ;\n .\n}\nFROM HRA:\nFROM HRApop:\nWHERE {\n {\n SELECT ?rui_location ?datas\
et\n WHERE {\n {\n #{{DATASET_VALUES}}\n ?block ccf:has_registration_location ?rui_location .\n \
?block ccf:generates_dataset ?dataset .\n }\n UNION\n {\n ?block ccf:subdivided_into_sections ?section\
.\n ?block ccf:has_registration_location ?rui_location .\n ?section ccf:generates_dataset ?dataset .\n \
}\n }\n }\n UNION\n {\n SELECT ?rui_location ?dataset\n WHERE {\n {\n #{{RUI_LOCATION_VALUES}}\n ?\
block ccf:has_registration_location ?rui_location .\n ?block ccf:generates_dataset ?dataset .\n }\n UNION\n\
{\n ?block ccf:subdivided_into_sections ?section .\n ?block ccf:has_registration_location ?rui_locatio\
n .\n ?section ccf:generates_dataset ?dataset .\n }\n }\n }\n ?block rdf:type ccf:Sample ;\n rdfs:la\
bel ?sampleLabel ;\n rdfs:comment ?sampleDescription ;\n # skos:prefLabel ?sampleLabel ;\n # dct\
erms:description ?sampleDescription ;\n ccf:url ?sampleLink ;\n ccf:sample_type ?sampleType ;\n \
ccf:has_registration_location ?rui_location ;\n ccf:comes_from ?donor ;\n .\n ?donor rdf:type ccf:Donor ;\n \
rdfs:label ?donorLabel ;\n rdfs:comment ?donorDescription ;\n # skos:prefLabel ?donorLabel ;\n \
# dcterms:description ?donorDescription ;\n ccf:url ?donorLink ;\n ccf:sex ?sex ;\n ccf:consortium\
_name ?consortium ;\n ccf:tissue_provider_name ?provider ;\n ccf:tissue_provider_uuid ?provider_uuid ;\n .\
\n OPTIONAL { ?donor ccf:age ?age . }\n OPTIONAL { ?donor ccf:bmi ?bmi . }\n ?rui_location rdf:type ccf:SpatialEntity ;\n\
dcterms:creator ?creator ;\n ccf:creator_first_name ?creator_first_name ;\n \
ccf:creator_last_name ?creator_last_name ;\n dcterms:created ?creation_date ;\n ccf:x_dimens\
ion ?x_dimension ;\n ccf:y_dimension ?y_dimension ;\n ccf:z_dimension ?z_dimension ;\n \
ccf:dimension_unit ?dimension_units ;\n ccf:collides_with ?anatomical_structure ;\n .\n OPTIONAL \
{\n ?rui_location ccf:slice_count ?slice_count ;\n ccf:slice_thickness ?slice_thickness ;\n }\n ?Spati\
alPlacement rdf:type ccf:SpatialPlacement ;\n dcterms:created ?placement_date ;\n cc\
f:x_scaling ?x_scaling ;\n ccf:y_scaling ?y_scaling ;\n ccf:z_scaling ?z_scaling ;\n \
ccf:scaling_unit ?scaling_units ;\n ccf:x_rotation ?x_rotation ;\n \
ccf:y_rotation ?y_rotation ;\n ccf:z_rotation ?z_rotation ;\n ccf:rotation_order ?\
rotation_order ;\n ccf:rotation_unit ?rotation_units ;\n ccf:x_translation ?x_transl\
ation ;\n ccf:y_translation ?y_translation ;\n ccf:z_translation ?z_translation ;\n \
ccf:translation_unit ?translation_units ;\n ccf:placement_relative_to ?target ;\n \
ccf:placement_for ?rui_location ;\n .\n OPTIONAL {\n ?block ccf:section_count ?sectionCount ;\n \
ccf:section_size ?sectionSize ;\n ccf:section_size_unit ?sectionUnits .\n }\n OPTIONAL {\n ?block ccf:su\
bdivided_into_sections ?section .\n ?section rdf:type ccf:Sample ;\n rdfs:label ?sectionLabel ;\n \
rdfs:comment ?sectionDescription ;\n # skos:prefLabel ?sectionLabel ;\n # dcterms:description ?s\
ectionDescription ;\n ccf:url ?sectionLink ;\n ccf:sample_type ?sectionType ;\n ccf:sec\
tion_number ?sectionNumber ;\n .\n OPTIONAL {\n ?section ccf:generates_dataset ?sectionDataset .\n ?sectionD\
ataset rdf:type ccf:Dataset ;\n rdfs:label ?sectionDatasetLabel ;\n rdfs:comment\
?sectionDatasetDescription ;\n # skos:prefLabel ?sectionDatasetLabel ;\n # dcte\
rms:description ?sectionDatasetDescription ;\n ccf:url ?sectionDatasetLink ;\n c\
cf:technology ?sectionTechnology ;\n ccf:thumbnail ?sectionThumbnail ;\n .\n }\n }\n OPTIONAL \
{\n ?block ccf:generates_dataset ?dataset .\n ?dataset rdf:type ccf:Dataset ;\n rdfs:label ?datasetLabel \
;\n rdfs:comment ?datasetDescription ;\n # skos:prefLabel ?datasetLabel ;\n # dcterms:d\
escription ?datasetDescription ;\n ccf:url ?datasetLink ;\n ccf:technology ?technology ;\n \
ccf:thumbnail ?thumbnail ;\n .\n }\n\n #{{FILTER}}\n FILTER (?sampleType = "Tissue Block")\n}\n';
// src/library/hra-pop/utils/rui-locations-query.js
function getRuiLocationsQuery(datasets, ruiLocations) {
const datasetValues = datasets.reduce((vals, iri) => vals + ` (<${iri}>)`, "");
const ruiLocationValues = ruiLocations.reduce((vals, iri) => vals + ` (<${iri}>)`, "");
const dsVals = `VALUES (?dataset) { ${datasetValues} }`;
const ruiVals = `VALUES (?rui_location) { ${ruiLocationValues} }`;
return construct_rui_locations_default.replaceAll("#{{DATASET_VALUES}}", dsVals).replaceAll("#{{RUI_LOCATION_VALUES}}",
ruiVals);
}
// src/library/hra-pop/utils/get-x-from-cell-summary.js
function getCellSummariesQuery(cellWeights, organIri, tool) {
const values = Object.keys(cellWeights).reduce((vals, iri) => vals + ` (<${iri}>)`, "");
const valString = `VALUES (?cell_id) { ${values} }`;
let query = select_cell_summaries_default.replaceAll("#{{VALUES}}", valString);
if (organIri) {
const organValues = `VALUES (?organ_iri) { (<${organIri}>) }`;
query = query.replaceAll("#{{ORGAN_IRIs}}", organValues);
}
if (tool) {
const toolValues = `VALUES (?tool) { ("${tool}"^^xsd:string) }`;
query = query.replaceAll("#{{TOOLS}}", toolValues);
}
return query;
}
function getSourceSimilarities(cellWeights, summaries) {
const sources = summaries.reduce((lookup, row) => {
const id = `${row.cell_source}$${row.tool}$${row.modality}`;
if (!lookup[id]) {
lookup[id] = {
cell_source: row.cell_source,
cell_source_type: row.cell_source_type,
cell_source_label: row.cell_source_label,
cell_source_link: row.cell_source_link,
tool: row.tool,
modality: row.modality,
cellWeights: {}
};
}
const source = lookup[id];
source.cellWeights[row.cell_id] = row.percentage;
return lookup;
}, {});
for (const source of Object.values(sources)) {
source.similarity = getCellDistributionSimilarity(cellWeights, source.cellWeights);
delete source.cellWeights;
}
return Object.values(sources).sort((a, b) => b.similarity - a.similarity);
}
async function getSimilarCellSources(cellWeights, organIri, tool, endpoint = "https://lod.humanatlas.io/sparql") {
const query = getCellSummariesQuery(cellWeights, organIri, tool);
const summaries = await select(query, endpoint);
const sources = getSourceSimilarities(cellWeights, summaries);
const datasets = sources.filter((row) => row.cell_source_type === "http://purl.org/ccf/Dataset").map((row) => row.cell_source).
slice(0, 10);
const ruiLocations = sources.filter((row) => row.cell_source_type === "http://purl.org/ccf/SpatialEntity").map((row) => row.
cell_source).slice(0, 10);
const ruiLocationQuery = getRuiLocationsQuery(datasets, ruiLocations);
try {
const ruiLocationsJsonLd = await construct(ruiLocationQuery, endpoint, rui_locations_default);
return { sources, rui_locations: ruiLocationsJsonLd };
} catch (error) {
return { sources: [], rui_locations: [], error };
}
}
// src/library/hra-pop/operations/cell-summary-report.js
async function getSimilarCellSourcesReport(csvString, organIri, tool, endpoint = "https://lod.humanatlas.io/sparql") {
const data = Papa2.parse(csvString, { header: true, skipEmptyLines: true }).data;
if (data?.length > 0) {
const cellWeights = {};
for (const row of data) {
const id = row["cell_id"];
const weight = parseFloat(row["percentage"]);
if (id && !isNaN(weight) && weight > 0 && weight <= 1) {
const cellId = id.replace("CL:", "http://purl.obolibrary.org/obo/CL_");
cellWeights[cellId] = weight;
}
}
if (Object.keys(cellWeights).length > 0) {
const { sources, rui_locations, error } = await getSimilarCellSources(cellWeights, organIri, tool, endpoint);
return { sources, rui_locations, error };
} else {
return { sources: [], rui_locations: [] };
}
}
}
// src/library/v1/operations/collisions.js
var DEFAULT_ENDPOINT = "https://apps.humanatlas.io/api/v1/collisions";
async function getCollisions(ruiLocation, endpoint = DEFAULT_ENDPOINT) {
const resp = await fetch(endpoint, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(ruiLocation)
});
if (resp.ok) {
return await resp.json();
} else {
return [];
}
}
// src/library/hra-pop/queries/as-weighted-cell-summaries.rq
var as_weighted_cell_summaries_default = "PREFIX ccf: <http://purl.org/ccf/>\nPREFIX HRApop: <https://purl.humanatlas.io/\
graph/hra-pop>\nPREFIX UBERON: <http://purl.obolibrary.org/obo/UBERON_>\nPREFIX xsd: <http://www.w3.org/2001/XMLSchema#>\nP\
REFIX HRA: <https://purl.humanatlas.io/collection/hra-api>\n\nSELECT ?tool ?modality ?cell_id ?cell_label (?predicted_cell\
_count AS ?count) (?predicted_cell_count / ?total_cell_count AS ?percentage)\nFROM HRA:\nFROM HRApop:\nWHERE {\n {\n SELE\
CT ?tool ?modality ?cell_id (SAMPLE(?cell_label) AS ?cell_label) (sum(?weighted_cell_count) AS ?predicted_cell_count)\n \
WHERE {\n #{{AS_WEIGHT_VALUES}}\n ?as ccf:has_cell_summary [ ccf:cell_annotation_method ?tool ;\n ccf\
:modality ?modality ;\n ccf:has_cell_summary_row [ ccf:cell_id ?cell_id ;\n ccf:cell_label ?cell_label\
;\n ccf:cell_count ?cell_count ] ] .\n BIND (xsd:decimal(?cell_count) * xsd:decimal(?weight) AS ?weighted_\
cell_count)\n }\n GROUP BY ?tool ?modality ?cell_id\n }\n {\n SELECT ?tool ?modality (sum(?weighted_cell_count) AS\
?total_cell_count)\n WHERE {\n #{{AS_WEIGHT_VALUES}}\n ?as ccf:has_cell_summary [ ccf:cell_annotation_method \
?tool ;\n ccf:modality ?modality ;\n ccf:has_cell_summary_row [ ccf:cell_count ?cell_count ] ] .\n \
BIND (xsd:decimal(?cell_count) * xsd:decimal(?weight) AS ?weighted_cell_count)\n }\n GROUP BY ?tool ?modality\n }\n}\
\nORDER BY ?tool ?modality ?predicted_cell_count\n";
// src/library/hra-pop/operations/rui-location-cell-summary.js
function getAnatomicalStructureWeights(collisions) {
return collisions.reduce((asWeights, c) => {
const iri = c.representation_of;
const percent = c.percentage_of_tissue_block;
asWeights[iri] = (asWeights[iri] ?? 0) + percent;
return asWeights;
}, {});
}
function getCellSummaryQuery(asWeights) {
const values = Object.entries(asWeights).reduce((vals, [iri, weight]) => vals + ` (<${iri}> ${weight})`, "");
const asWeightVals = `VALUES (?as ?weight) { ${values} }`;
return as_weighted_cell_summaries_default.replaceAll("#{{AS_WEIGHT_VALUES}}", asWeightVals);
}
async function getCellSummary(ruiLocation, endpoint = "https://lod.humanatlas.io/sparql") {
const collisions = await getCollisions(ruiLocation);
if (collisions.length === 0) {
return [];
} else {
const asWeights = getAnatomicalStructureWeights(collisions);
const query = getCellSummaryQuery(asWeights);
const summary = await select(query, endpoint);
return summary;
}
}
// src/library/hra-pop/queries/supported-organs.rq
var supported_organs_default = "PREFIX ccf: <http://purl.org/ccf/>\nPREFIX HRApop: <https://purl.humanatlas.io/graph/hra-\
pop>\nPREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\nPREFIX owl: <http://www.w3.org/2002/07/owl#>\nPREFIX UBERON: <h\
ttp://purl.obolibrary.org/obo/UBERON_>\nPREFIX xsd: <http://www.w3.org/2001/XMLSchema#>\nPREFIX body: <http://purl.obolibr\
ary.org/obo/UBERON_0013702>\nPREFIX HRA: <https://purl.humanatlas.io/collection/hra-api>\n\nSELECT DISTINCT (?organ_iri AS \
?id) (?organ_label AS ?label)\nFROM HRA:\nFROM HRApop:\nWHERE {\n ?as ccf:has_cell_summary [] .\n ?as rdfs:label ?as_label \
.\n ?as_entity ccf:representation_of ?as ;\n ccf:has_reference_organ ?refOrgan .\n ?refOrgan ccf:representati\
on_of ?refOrganTerm .\n ?organ_iri ccf:ccf_part_of body: .\n ?organ_iri ccf:ccf_pref_label ?organ_label .\n ?refOrganTer\
m ccf:ccf_part_of* ?organ_iri .\n # Remove redundant 'respiratory system' and 'anatomical systems'\n FILTER (?organ_iri \
!= UBERON:0001004 && ?organ_iri != UBERON:0000467)\n}\nORDER BY ?organ_label\n";
// src/library/hra-pop/operations/supported-organs.js
async function getSupportedOrgans(endpoint = "https://lod.humanatlas.io/sparql") {
return select(supported_organs_default, endpoint);
}
// src/library/hra-pop/queries/supported-reference-organs.rq
var supported_reference_organs_default = "PREFIX ccf: <http://purl.org/ccf/>\nPREFIX HRApop: <https://purl.humanatlas.io/\
graph/hra-pop>\nPREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\nPREFIX owl: <http://www.w3.org/2002/07/owl#>\nPREFIX \
UBERON: <http://purl.obolibrary.org/obo/UBERON_>\nPREFIX xsd: <http://www.w3.org/2001/XMLSchema#>\nPREFIX body: <http://pu\
rl.obolibrary.org/obo/UBERON_0013702>\nPREFIX HRA: <https://purl.humanatlas.io/collection/hra-api>\n\nSELECT DISTINCT (?org\
an_iri AS ?id) (?organ_label AS ?label)\nFROM HRA:\nFROM HRApop:\nWHERE {\n ?as ccf:has_cell_summary [] .\n ?as rdfs:label \
?as_label .\n ?as_entity ccf:representation_of ?as ;\n ccf:has_reference_organ ?refOrgan .\n ?refOrgan ccf:re\
presentation_of ?organ_iri .\n ?organ_iri ccf:ccf_pref_label ?organ_label .\n}\nORDER BY ?organ_label\n";
// src/library/hra-pop/operations/supported-reference-organs.js
async function getSupportedReferenceOrgans(endpoint = "https://lod.humanatlas.io/sparql") {
return select(supported_reference_organs_default, endpoint);
}
// src/library/hra-pop/queries/supported-tools.rq
var supported_tools_default = "PREFIX ccf: <http://purl.org/ccf/>\nPREFIX HRApop: <https://purl.humanatlas.io/graph/hra-p\
op>\nPREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\nPREFIX owl: <http://www.w3.org/2002/07/owl#>\nPREFIX UBERON: <ht\
tp://purl.obolibrary.org/obo/UBERON_>\nPREFIX xsd: <http://www.w3.org/2001/XMLSchema#>\nPREFIX body: <http://purl.obolibra\
ry.org/obo/UBERON_0013702>\n\nSELECT DISTINCT (?tool AS ?id) (?tool AS ?label)\nFROM HRApop:\nWHERE {\n [] ccf:has_cell_summ\
ary [ ccf:cell_annotation_method ?tool ] .\n FILTER (?tool != 'sc_proteomics')\n}\nORDER BY ?tool\n";
// src/library/hra-pop/operations/supported-tools.js
async function getSupportedTools(endpoint = "https://lod.humanatlas.io/sparql") {
return select(supported_tools_default, endpoint);
}
export {
getCellSummary,
getSimilarCellSourcesReport,
getSupportedOrgans,
getSupportedReferenceOrgans,
getSupportedTools
};