ProGAL.proteins.belta
Class BetaTopology

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

public class BetaTopology
extends java.lang.Object

Representation of a beta-topology. The pairingMatrix is initialized to a zero-matrix, but can freely be edited using the setPaired-method. The isValid method will tell if the pairing matrix is valid (i.e. no strand paired with itself, no two strands paired both parallel and anti-parallel and all strands paired at least once and at most twice with other strands). To find out which strands are paired either read the pairing matrix or use getSheets to retrieve a list of sheets that can be individually managed.

Author:
R.Fonseca

Field Summary
 int N
          The number of strands in the secondary structure
 Matrix pairingMatrix
          The pairing matrix that indicates which strands are paired.
 SecondaryStructure secondaryStructure
          The secondary structure that the beta-topology is related to
 
Constructor Summary
BetaTopology(SecondaryStructure ss)
          Constructs a beta-topology associated with the specified secondary structure but with no pairings.
BetaTopology(SecondaryStructure ss, boolean[][] pairs)
          Constructs a beta-topology associated with the specified secondary structure and pairings.
 
Method Summary
 java.util.List<SheetTopology> getSheets()
          Construct a list of sheet-topologies from the beta-topology.
 boolean isValid()
          Checks if this beta-topology is valid.
 boolean matches(BetaTopology bTop)
          Determine if this beta-topology matches some other topology.
 boolean pair(int i, int j)
          Returns true if i and j are paired.
 boolean respects(BetaTopology bTop)
          Determine if this beta-topology respects some other topology.
 void setNotPaired(int i, int j)
          Set strands i and j to be unpaired.
 void setPaired(int i, int j)
          Set strands i and j to be paired.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

secondaryStructure

public final SecondaryStructure secondaryStructure
The secondary structure that the beta-topology is related to


pairingMatrix

public final Matrix pairingMatrix
The pairing matrix that indicates which strands are paired. Columns and rows in the pairing matrix correspond to indices in the secondaryStructure.getStrands()-array. If an entry is nonzero in the upper-triangle it indicates an antiparallel pairing and in the lower-triangle it indicates a parallel pairing.


N

public final int N
The number of strands in the secondary structure

Constructor Detail

BetaTopology

public BetaTopology(SecondaryStructure ss)
Constructs a beta-topology associated with the specified secondary structure but with no pairings. All fields are initialized but the pairing matrix has only zero-entries.


BetaTopology

public BetaTopology(SecondaryStructure ss,
                    boolean[][] pairs)
Constructs a beta-topology associated with the specified secondary structure and pairings. All fields are initialized.

Method Detail

pair

public boolean pair(int i,
                    int j)
Returns true if i and j are paired.


setPaired

public void setPaired(int i,
                      int j)
Set strands i and j to be paired.


setNotPaired

public void setNotPaired(int i,
                         int j)
Set strands i and j to be unpaired.


isValid

public boolean isValid()
Checks if this beta-topology is valid. A valid topology has


getSheets

public java.util.List<SheetTopology> getSheets()
Construct a list of sheet-topologies from the beta-topology.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

matches

public boolean matches(BetaTopology bTop)
Determine if this beta-topology matches some other topology. Two topologies, t1 and t2, match each other iff t1 respects t2 and t2 respects t1.


respects

public boolean respects(BetaTopology bTop)
Determine if this beta-topology respects some other topology. A topology, t1, respects another topology, t2, iff t1.secondaryStructure.respects(t2.secondaryStructure) and if a pairing of two strands in t1 implies a pairing of two overlapping strands in t2.