UNPKG

@rcsb/rcsb-saguaro-app

Version:
38 lines (37 loc) 2.5 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.entityGranularityGroupFacetStore = 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 EntityGranularitySearchFacetStore { 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)]; 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)]; 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)]; this.nonPolymerFacet = [(0, lodash_1.cloneDeep)(SingleFacets_1.CHEM_COMP_FACET)]; this.facetLayoutGrid = [ SearchMetadata_1.RcsbSearchMetadata.RcsbEntryInfo.DiffrnResolutionHigh.Value.path, SearchMetadata_1.RcsbSearchMetadata.RcsbEntitySourceOrganism.NcbiScientificName.path, SearchMetadata_1.RcsbSearchMetadata.RcsbEntitySourceOrganism.NcbiParentScientificName.path, SearchMetadata_1.RcsbSearchMetadata.Exptl.Method.path, SearchMetadata_1.RcsbSearchMetadata.RcsbPolymerInstanceAnnotation.AnnotationLineage.Name.path ]; this.returnType = SearchEnums_1.ReturnType.PolymerEntity; } getServices() { return [SearchEnums_1.Service.Text, SearchEnums_1.Service.TextChem]; } getFacetService(service) { switch (service) { case SearchEnums_1.Service.Text: return this.entryFacet.concat(this.instanceFacet).concat(this.entityFacet); case SearchEnums_1.Service.TextChem: return this.nonPolymerFacet; case "all": return this.entryFacet.concat(this.instanceFacet).concat(this.entityFacet).concat(this.nonPolymerFacet); default: return []; } } } exports.entityGranularityGroupFacetStore = new EntityGranularitySearchFacetStore();