Class Structure

java.lang.Object
org.rcsb.strucmotif.domain.structure.Structure

public class Structure extends Object
The structure object wraps categories of a mmCIF file and allows access via some utility methods.
  • Constructor Details

    • Structure

      public Structure(String structureIdentifier, Map<String,int[]> chainOffsets, int[] labelSeqId, int[] residueOffsets, byte[] residueTypes, byte[] labelAtomId, short[] x, short[] y, short[] z, Map<String,List<String>> assemblies, Map<String,Transformation> transformations)
      Create a structure view.
      Parameters:
      structureIdentifier - the identifier
      chainOffsets - residue indices where label_asym_id changes
      labelSeqId - array of all label_seq_id
      residueOffsets - the offset of each residue in the atom_site category
      residueTypes - the type of each residue
      labelAtomId - the type of each atom
      x - the x coords of each atom
      y - the y coords of each atom
      z - the z coords of each atom
      assemblies - all assemblies
      transformations - all transformations
  • Method Details

    • getStructureIdentifier

      public String getStructureIdentifier()
      This structure's identifier.
      Returns:
      a String
    • getLabelSelections

      public List<LabelSelection> getLabelSelections()
      Access to all unique (label_asym_id, label_seq_id) pairs that exist in this structure. This call is expensive and will traverse all internally registered chains and sequence positions and create a collection of associated LabelSelection instances.

      Make sure to reuse the result returned by this call. Never call in a loop!

      Returns:
      a sorted list of all LabelSelection instances that exist for this structure
    • getResidueIndex

      public int getResidueIndex(String labelAsymId, int labelSeqId)
      Look up the index of a residue.
      Parameters:
      labelAsymId - the chain-ID of the residue
      labelSeqId - the sequence position of the residue
      Returns:
      the index of the residue
      Throws:
      NoSuchElementException - if the chain/residue cannot be found
    • getLabelSelection

      public LabelSelection getLabelSelection(int residueIndex)
    • getChainCount

      public int getChainCount()
      Count of all chains in the source CIF file.
      Returns:
      an int
    • getResidueCount

      public int getResidueCount()
      Count of all residues in the source CIF file.
      Returns:
      an int
    • getAtomCount

      public int getAtomCount()
      Count of all atoms/rows in the source CIF file.
      Returns:
      an int
    • getResidueType

      public ResidueType getResidueType(int residueIndex)
      Reports the residue type/amino acid at a certain index.
      Parameters:
      residueIndex - the index of the residue
      Returns:
      a ResidueType instance
    • getAssemblies

      public Map<String,List<String>> getAssemblies()
      Access to assembly information.
      Returns:
      Map of all assemblies [assemblyId, (label_asym_id x struct_oper_id)[]]
    • getTransformations

      public Map<String,Transformation> getTransformations()
      Access to all transformations.
      Returns:
      Map of transformations [struct_oper_id, Transformation]
    • getTransformation

      public Transformation getTransformation(String structOperIdentifier)
      Access to a specific transformation.
      Parameters:
      structOperIdentifier - the struct_oper_id expression
      Returns:
      a Transformation object
    • manifestResidue

      public Map<LabelAtomId,float[]> manifestResidue(LabelSelection labelSelection)
      Manifest a residue by its LabelSelection.
      Parameters:
      labelSelection - the residue identifier
      Returns:
      a residue
    • manifestResidues

      public List<Map<LabelAtomId,float[]>> manifestResidues(List<LabelSelection> labelSelections)
      Manifest a collection of residues by their LabelSelection.
      Parameters:
      labelSelections - a collection of residue identifiers
      Returns:
      a collection of residues
    • manifestResidue

      public Map<LabelAtomId,float[]> manifestResidue(int residueIndex)
      Manifest a residue by its index.
      Parameters:
      residueIndex - the index of the residue
      Returns:
      a residue
    • manifestResidue

      public Map<LabelAtomId,float[]> manifestResidue(int residueIndex, String structOperIdentifier)
      'Manifests' a residue, i.e. extract all relevant atom_site rows and move coordinates of all atoms to a map. Atoms are identified by their label_comp_id, coordinates given as float[3]. The requested transformation will be applied to the coordinates.
      Parameters:
      residueIndex - the index of the residue
      structOperIdentifier - the operator to apply to these coordinates
      Returns:
      a Map [label_atom_id, [x, y, z]]