@rcsb/rcsb-saguaro-app
Version:
RCSB 1D Saguaro Web App
73 lines (72 loc) • 3.65 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.depositionGroupFacetStore = void 0;
const SearchEnums_1 = require("@rcsb/rcsb-api-tools/lib/RcsbSearch/Types/SearchEnums");
const SearchMetadata_1 = require("@rcsb/rcsb-api-tools/lib/RcsbSearch/Types/SearchMetadata");
const SingleFacets_1 = require("./SingleFacets");
const lodash_1 = require("lodash");
class DepositionGroupFacetStore {
constructor() {
this.entryFacet = [
(0, lodash_1.cloneDeep)(SingleFacets_1.EXPERIMENTAL_METHOD_FACET),
(0, lodash_1.cloneDeep)(SingleFacets_1.RESOLUTION_FACET),
(0, lodash_1.cloneDeep)(SingleFacets_1.RELEASE_DATE_FACET),
(0, lodash_1.cloneDeep)(SingleFacets_1.ENZYME_CLASS_FACET)
];
this.instanceFacet = [
(0, lodash_1.cloneDeep)(SingleFacets_1.SCOP_FACET),
(0, lodash_1.cloneDeep)(SingleFacets_1.CATH_FACET),
(0, lodash_1.cloneDeep)(SingleFacets_1.ECOD_FACET),
(0, lodash_1.cloneDeep)(SingleFacets_1.LIGAND_FACET),
(0, lodash_1.cloneDeep)(SingleFacets_1.LIGAND_OF_INTEREST_FACET)
];
this.entityFacet = [
(0, lodash_1.cloneDeep)(SingleFacets_1.ORGANISM_FACET),
(0, lodash_1.cloneDeep)(SingleFacets_1.TAXONOMY_FACET),
(0, lodash_1.cloneDeep)(SingleFacets_1.PFAM_FACET),
(0, lodash_1.cloneDeep)(SingleFacets_1.ENTITY_NAME_FACET),
(0, lodash_1.cloneDeep)(SingleFacets_1.GO_FUNCTION_FACET),
(0, lodash_1.cloneDeep)(SingleFacets_1.GO_PROCESS_FACET),
(0, lodash_1.cloneDeep)(SingleFacets_1.GO_COMPONENT_FACET)
];
this.uniprotFacet = [
(0, lodash_1.cloneDeep)(SingleFacets_1.DISEASE_FACET),
(0, lodash_1.cloneDeep)(SingleFacets_1.PHENOTYPE_FACET),
(0, lodash_1.cloneDeep)(SingleFacets_1.INTERPRO_FACET)
];
this.nonPolymerFacet = [
(0, lodash_1.cloneDeep)(SingleFacets_1.CHEM_COMP_FACET)
];
this.facetLayoutGrid = [
SearchMetadata_1.RcsbSearchMetadata.RcsbAccessionInfo.DepositDate.path,
SearchMetadata_1.RcsbSearchMetadata.RcsbEntryInfo.ResolutionCombined.path, SearchMetadata_1.RcsbSearchMetadata.Exptl.Method.path,
SearchMetadata_1.RcsbSearchMetadata.ChemComp.Type.path,
SearchMetadata_1.RcsbSearchMetadata.RcsbEntitySourceOrganism.NcbiScientificName.path, SearchMetadata_1.RcsbSearchMetadata.RcsbEntitySourceOrganism.NcbiParentScientificName.path,
SearchMetadata_1.RcsbSearchMetadata.RcsbPolymerEntityAnnotation.Name.path, SearchMetadata_1.RcsbSearchMetadata.RcsbPolymerInstanceAnnotation.AnnotationLineage.Name.path
];
this.returnType = SearchEnums_1.ReturnType.PolymerEntity;
}
getServices() {
return [SearchEnums_1.Service.Text];
}
getFacetService(service) {
switch (service) {
case SearchEnums_1.Service.Text:
return this.entryFacet
.concat(this.instanceFacet)
.concat(this.entityFacet)
.concat(this.uniprotFacet);
case SearchEnums_1.Service.TextChem:
return this.nonPolymerFacet;
case "all":
return this.entryFacet
.concat(this.instanceFacet)
.concat(this.entityFacet)
.concat(this.nonPolymerFacet)
.concat(this.uniprotFacet);
default:
return [];
}
}
}
exports.depositionGroupFacetStore = new DepositionGroupFacetStore();