ProGAL.proteins.belta
Class SecondaryStructure

java.lang.Object
  extended by ProGAL.proteins.belta.SecondaryStructure

public class SecondaryStructure
extends java.lang.Object

Representation of a secondary structure assignment. The constructor reads a string representation of an assignment and parses it into segments. The start and end-index of a segment, as well as the segments type can be accessed in the following way

 SecondaryStructure ss = new SecondaryStructure("   HHHHHHHH  EEE  EEE   ");
 Segment seg = ss.segments[1];
 System.out.printf("Segment %d: start %d, end %d, type: %s\n", seg.segmentIndex, seg.start, seg.end, seg.type );  
 
Three convenient methods are also supplied to return all helix, strand or coil segments separate from each other.

Author:
R.Fonseca

Nested Class Summary
static class SecondaryStructure.SSSegment
          A secondary structure segment of either helix, coil or strand.
 
Field Summary
 PrimaryStructure primaryStructure
          The primary structure related to this secondary structure.
 SecondaryStructure.SSSegment[] segments
          Secondary structure segments (helix, coil or strand)
 
Constructor Summary
SecondaryStructure(PrimaryStructure ps, java.lang.String ssString)
          Construct a secondary structure object from a string representation.
SecondaryStructure(java.lang.String ssString)
          Construct a secondary structure object from a string representation.
 
Method Summary
 SecondaryStructure.SSSegment[] getCoils()
          Return array containing all segments, s, where s.type==SSType.COIL.
 SecondaryStructure.SSSegment[] getHelices()
          Return array containing all segments, s, where s.type==SSType.HELIX.
 SecondaryStructure.SSSegment getSegmentContainingResidue(int res)
          TODO: Comment and test
 SecondaryStructure.SSSegment[] getStrands()
          Return array containing all segments, s, where s.type==SSType.STRAND.
 SSType getType(int r)
          TODO: Comment and test
 boolean matches(SecondaryStructure ss)
          Determine if this secondary structure matches ss.
 boolean respects(SecondaryStructure ss)
          Determine if this secondary structure respects ss.
 java.lang.String toString()
          TODO: Comment
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

segments

public final SecondaryStructure.SSSegment[] segments
Secondary structure segments (helix, coil or strand)


primaryStructure

public PrimaryStructure primaryStructure
The primary structure related to this secondary structure. Might be null.

Constructor Detail

SecondaryStructure

public SecondaryStructure(PrimaryStructure ps,
                          java.lang.String ssString)
Construct a secondary structure object from a string representation. The primary structure is stored as well.


SecondaryStructure

public SecondaryStructure(java.lang.String ssString)
Construct a secondary structure object from a string representation. The string representation may be both the DSSP (helix: H,G; strand: E; coil: B,I,T,S) or the normal three-class representation (helix: H; strand: E; coil: C or space).

Method Detail

getStrands

public SecondaryStructure.SSSegment[] getStrands()
Return array containing all segments, s, where s.type==SSType.STRAND. These are in sequential order.


getHelices

public SecondaryStructure.SSSegment[] getHelices()
Return array containing all segments, s, where s.type==SSType.HELIX. These are in sequential order.


getCoils

public SecondaryStructure.SSSegment[] getCoils()
Return array containing all segments, s, where s.type==SSType.COIL. These are in sequential order.


matches

public boolean matches(SecondaryStructure ss)
Determine if this secondary structure matches ss. Two secondary structures, s1 and s2, match iff s1 respects s2 and s2 respects s1.


respects

public boolean respects(SecondaryStructure ss)
Determine if this secondary structure respects ss. One secondary structure, s1, respects another, s2, iff there exists a one-to-one pairing of every strand in s1 to a subset of strands in s2 such that each pair of strands overlap.


getSegmentContainingResidue

public SecondaryStructure.SSSegment getSegmentContainingResidue(int res)
TODO: Comment and test


getType

public SSType getType(int r)
TODO: Comment and test


toString

public java.lang.String toString()
TODO: Comment

Overrides:
toString in class java.lang.Object