properties.ts 1020 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /**
  2. * Copyright (c) 2017 mol* contributors, licensed under MIT, See LICENSE file for more info.
  3. *
  4. * @author David Sehnal <david.sehnal@gmail.com>
  5. */
  6. import { Atom } from '../structure'
  7. const constant = {
  8. true: Atom.property(l => true),
  9. false: Atom.property(l => false),
  10. zero: Atom.property(l => 0)
  11. }
  12. const atom = {
  13. type_symbol: Atom.property(l => l.unit.hierarchy.atoms.type_symbol.value(l.atom))
  14. }
  15. const residue = {
  16. key: Atom.property(l => l.unit.hierarchy.residueKey.value(l.unit.residueIndex[l.atom])),
  17. auth_seq_id: Atom.property(l => l.unit.hierarchy.residues.auth_seq_id.value(l.unit.residueIndex[l.atom])),
  18. auth_comp_id: Atom.property(l => l.unit.hierarchy.residues.auth_comp_id.value(l.unit.residueIndex[l.atom]))
  19. }
  20. const chain = {
  21. auth_asym_id: Atom.property(l => l.unit.hierarchy.chains.auth_asym_id.value(l.unit.chainIndex[l.atom]))
  22. }
  23. const Properties = {
  24. constant,
  25. atom,
  26. residue,
  27. chain
  28. }
  29. type Properties = typeof Properties
  30. export default Properties