schemas.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /**
  2. * Copyright (c) 2019 mol* contributors, licensed under MIT, See LICENSE file for more info.
  3. *
  4. * @author David Sehnal <david.sehnal@gmail.com>
  5. */
  6. import { CifWriter } from '../../../mol-io/writer/cif';
  7. const InteractionCategories = new Set([
  8. 'entry',
  9. 'entity',
  10. 'exptl',
  11. 'cell',
  12. 'symmetry',
  13. 'struct_conf',
  14. 'struct_sheet_range',
  15. 'entity_poly',
  16. 'struct_asym',
  17. 'struct_conn',
  18. 'struct_conn_type',
  19. 'pdbx_struct_mod_residue',
  20. 'chem_comp_bond',
  21. 'atom_sites'
  22. ]);
  23. const AssemblyCategories = new Set([
  24. 'entry',
  25. 'entity',
  26. 'exptl',
  27. 'cell',
  28. 'symmetry',
  29. 'struct_conf',
  30. 'struct_sheet_range',
  31. 'entity_poly',
  32. 'entity_poly_seq',
  33. 'pdbx_nonpoly_scheme',
  34. 'struct_asym',
  35. 'struct_conn',
  36. 'struct_conn_type',
  37. 'pdbx_struct_mod_residue',
  38. 'chem_comp_bond',
  39. 'atom_sites'
  40. ]);
  41. export const QuerySchemas = {
  42. interaction: <CifWriter.Category.Filter>{
  43. includeCategory(name) { return InteractionCategories.has(name); },
  44. includeField(cat, field) { return true; }
  45. },
  46. assembly: <CifWriter.Category.Filter>{
  47. includeCategory(name) { return AssemblyCategories.has(name); },
  48. includeField(cat, field) { return true; }
  49. }
  50. }