Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expanding hints scope #1294

Merged
merged 4 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/model/hint.js
fileoy marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
import _ from 'lodash';
import { ENTITY_TYPE } from './element/entity-type.js';

// Define constants for Hint types, combining ORGANISM with ENTITY_TYPE
const HINT_TYPE = Object.freeze({
ORGANISM: 'organism',
});
const HINT_TYPE = Object.freeze(
_.assign(
{
ORGANISM: 'organism',
DISEASE: 'disease',
CELL_LINE: 'cell_line',
VARIANT: 'variant',
},
ENTITY_TYPE,
),
);

// Flatten the HINT_TYPE object to create an array of all hint types
const HINT_TYPES = _.flatMap(HINT_TYPE);
Expand Down
18 changes: 16 additions & 2 deletions src/server/routes/api/document/hint/pubtator.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,32 @@ function map(bioCDocument) {

// See Table 1 https://www.ncbi.nlm.nih.gov/research/pubtator3/tutorial
const PUBTATOR_ANNOTATION_TYPE = Object.freeze({
GENE: 'Gene',
SPECIES: 'Species',
// could add more types here when scope expands
CHEMICAL: 'Chemical',
DISEASE: 'Disease',
CELL_LINE: 'CellLine',
// VARIANT: 'Variant',
});
const PUBTATOR_DATABASE = Object.freeze({
ncbi_gene: 'ncbi_gene',
ncbi_taxonomy: 'ncbi_taxonomy',
// could add more databases here when scope expands
ncbi_mesh: 'ncbi_mesh',
cvcl: 'cvcl',
litvar: 'litvar',
});
const entityTypes = new Map([
[PUBTATOR_ANNOTATION_TYPE.GENE, HINT_TYPE.GGP],
[PUBTATOR_ANNOTATION_TYPE.SPECIES, HINT_TYPE.ORGANISM],
[PUBTATOR_ANNOTATION_TYPE.CHEMICAL, HINT_TYPE.CHEMICAL],
[PUBTATOR_ANNOTATION_TYPE.DISEASE, HINT_TYPE.DISEASE],
[PUBTATOR_ANNOTATION_TYPE.CELL_LINE, HINT_TYPE.CELL_LINE],
]);
const database2Xref = new Map([
[PUBTATOR_ANNOTATION_TYPE.GENE, COLLECTIONS.NCBI_GENE],
jvwong marked this conversation as resolved.
Show resolved Hide resolved
[PUBTATOR_DATABASE.ncbi_taxonomy, COLLECTIONS.NCBI_TAXONOMY],
[PUBTATOR_DATABASE.ncbi_mesh, COLLECTIONS.MESH],
[PUBTATOR_DATABASE.cvcl, COLLECTIONS.CELLOSAURUS],
]);

/**
Expand Down
45 changes: 32 additions & 13 deletions src/util/registry.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,36 @@
const COLLECTIONS = Object.freeze({
PUBMED: {
dbname: 'PubMed',
dbPrefix: 'pubmed'
},
/**
* The Taxonomy Database is a curated classification and nomenclature for all of the organisms
* in the public sequence databases. This currently represents about 10% of the described species of life on the planet.
*/
NCBI_TAXONOMY: {
dbname: 'NCBI Taxonomy',
dbPrefix: 'NCBITaxon'
}
PUBMED: {
dbname: 'PubMed',
dbPrefix: 'pubmed',
},
NCBI_GENE: {
dbName: 'NCBI Gene',
dbPrefix: 'NCBIGene',
},
/**
* The Taxonomy Database is a curated classification and nomenclature for all of the organisms
* in the public sequence databases. This currently represents about 10% of the described species of life on the planet.
*/
NCBI_TAXONOMY: {
dbname: 'NCBI Taxonomy',
dbPrefix: 'NCBITaxon',
},
MESH: {
dbName: 'MeSH',
dbPrefix: 'mesh',
},
CHEBI: {
dbName: 'ChEBI',
dbPrefix: 'CHEBI',
},
CELLOSAURUS: {
dbName: 'CELLOSAURUS',
dbPrefix: 'cellosaurus',
},
UNIPROT: {
dbName: 'UniProt Knowledgebase',
dbPrefix: 'uniprot',
},
});

export { COLLECTIONS };

Loading