Class TargetStructure

java.lang.Object
org.rcsb.strucmotif.domain.result.TargetStructure

public class TargetStructure extends Object
A container keeping track of paths in a target structure. Used to lazily load structures: Basically, wraps Structure instances but oftentimes we don't need to load a structure at all (i.e. if there are no valid paths).

Each instances represents one structure in the archive in which a motif could occur. It builds up all valid paths and omits stale paths as greedily as possible. Realized with help of a TargetAssembler. For efficiency, one target structures handles all potential paths in a structure.

The constructor and consume(InvertedIndexResiduePairIdentifier[], Overlap[]) iteratively builds up paths until all paths are either ruled out or sufficient resemblance of the query motif is observed.

  • Constructor Details

    • TargetStructure

      public TargetStructure(String structureIdentifier, InvertedIndexResiduePairIdentifier[] residuePairIdentifiers)
      Construct a target structure instance.
      Parameters:
      structureIdentifier - its identifier
      residuePairIdentifiers - all first-generation residue pairs
  • Method Details

    • getNumberOfValidPaths

      public int getNumberOfValidPaths()
      Reports the number currently valid paths.
      Returns:
      the number of valid paths in this structure
    • getStructureIdentifier

      public String getStructureIdentifier()
      The identifier of this structure
      Returns:
      a String
    • consume

      public boolean consume(InvertedIndexResiduePairIdentifier[] residuePairIdentifiers, Overlap[] overlapProfile)
      Consumes a new 'generation' of residue pair identifiers which potentially resemble valid extensions to the registered paths.
      Parameters:
      residuePairIdentifiers - all words returned for particular residue pair descriptor
      overlapProfile - query motif overlap profile - needed to ensure compatibility
      Returns:
      true if this target still contains at least one valid path
    • paths

      public Stream<Hit> paths(List<Integer> residueIndexSwaps, Structure structure, HitScorer hitScorer, StateRepository stateRepository)
      Traverses all paths of this structure. A path is ordered collection of residues - they are provided in an order that matches the query motif. This ensures a bidirectional mapping between query and potential hit. Implicitly, this causes the structure to be parsed. Also, this method is supposed to be called once and results to be consumed directly.
      Parameters:
      residueIndexSwaps - how residues were rearranged
      structure - provides assembly information
      hitScorer - the hit scorer
      stateRepository - provides prepared assembly information
      Returns:
      a stream of lists containing residues (in correspondence with the query)