meshi.applications.corpus
Class LocalFragmentLib

java.lang.Object
  extended by meshi.applications.corpus.LocalFragmentLib
All Implemented Interfaces:
CompositeTorsionsDefinitions, MeshiPotential, KeyWords

public class LocalFragmentLib
extends java.lang.Object
implements CompositeTorsionsDefinitions, MeshiPotential, KeyWords

The purpose of this class is is class is to build a fragment library that is compatible with a certain sequence. The lib is applicable to a corpus instance. The sequence is given to the constructor as an array of integers (in the range: 0-19). The constructor creates a library with at most libSize fragments that are different from each other by at least a certain RMS curoff. The final size of the lib could be smaller than the requested if this cutoff is stringent. In general the RMS (for fragment diversity purposes) is calculated not on the entire sequence, but rather on an inner subsequence. I found out that when you do threading on a long sequence the results are more accurate for the inner subsequences. The ranking of fragments in the lib is currently by propensity energy and pair-wise sequence alignment using BLOSUM62.


Field Summary
private  Corpus corpus
           
private  double[][] fragCoors
           
private  int fragL
           
private  double[] libEnergy
           
private  int[] libOrig
           
private  int libSize
           
private  int manner
           
private  int overlap
           
private  double overlapRMSsimilarity
           
private  Protein prot
           
private  double[][] protCoors
           
private  int residueFragStart
           
private  double rmsCutOff
           
private  int[] seq
           
private  boolean[] similarToLib
           
private  int trueFragEnd
           
private  int trueFragStart
           
 
Fields inherited from interface meshi.energy.simpleEnergyTerms.compositeTorsions.CompositeTorsionsDefinitions
ALL, CHI_1, CHI_2, CHI_3, CHI_4, COIL, HELIX, NUM_SIDECHAIN_TORSIONS, OMG, OMNI, PHI, POLYNOMIAL_CHI_1, POLYNOMIAL_CHI_1_CHI_2, POLYNOMIAL_CHI_1_CHI_2_TORSIONS, POLYNOMIAL_CHI_1_CHI_3, POLYNOMIAL_CHI_1_CHI_3_TORSIONS, POLYNOMIAL_CHI_1_CHI_4, POLYNOMIAL_CHI_1_CHI_4_TORSIONS, POLYNOMIAL_CHI_1_TORSIONS, POLYNOMIAL_PHI_PSI, POLYNOMIAL_PHI_PSI_CHI_1, POLYNOMIAL_PHI_PSI_CHI_1_TORSIONS, POLYNOMIAL_PHI_PSI_TORSIONS, PREPRO, PSI, SHEET, TOTAL_TORSION_ANGLES, UNIDENTIFIED_TORSION_TYPE
 
Fields inherited from interface meshi.parameters.MeshiPotential
ACCESSIBLE, ALPHA_ANGLE_PARAMETERS, ALPHA_TORSION_PARAMETERS, ANGLE_PARAMETERS, ATOMIC_PAIRWISE_PMF_SUMMA_PARAMETERS, BOND_PARAMETERS, BURIED, COIL, COMPOSITE_PROPENSITY_2D_PARAMETERS, COMPOSITE_PROPENSITY_2D_WITH_PP_PARAMETERS, COMPOSITE_PROPENSITY_PARAMETERS, COMPOSITE_TORSIONS_PARAMETERS, CONTACTS_ENVIRONMENT_PARAMETERS, CONTACTS_PARAMETERS, COOPERATIVE_ATOMIC_PAIRWISE_PMF_SUMMA_PARAMETERS, COOPERATIVE_PROPENSITY_PARAMETERS, COOPERATIVE_RAMACHANDRAN_PARAMETERS, ELECTROSTATICS_PARAMETERS, EXCLUDED_VOL_PARAMETERS, FLAT_RAMACH_PARAMETERS, HELIX, HELIX_OR_COIL, HYDROGEN_BONDS_PAIRS_BETA_PARAMETERS, HYDROGEN_BONDS_PAIRS_HELIX_PARAMETERS, HYDROGEN_BONDS_PAIRS_PARAMETERS_SURFACE, LENNARD_JONES_PARAMETERS, LENNARD_JONES_PARAMETERS_BACKBONE, LENNARD_JONES_PARAMETERS_CA, LJ_ENVIRONMENT_PARAMETERS, LJ_ENVIRONMENT_PARAMETERS_BACKBONE, LJ_ENVIRONMENT_PARAMETERS_CA, ONE_ANGLE_PARAMETERS, OUT_OF_PLANE_PARAMETERS, PLANE_PARAMETERS, PROPENSITY_ANGLE_PARAMETERS, PROPENSITY_TORSION_PARAMETERS, SHEET, SHEET_OR_COIL, SOLVATE_LONG_HB_PARAMETERS, SOLVATE_MINIMIZE_HB_PARAMETERS, SOLVATE_NOHB_PARAMETERS, SOLVATE_PARAMETERS, SOLVATE_SC_PARAMETERS, TWO_ANGLES_PARAMETERS, TWO_TORSIONS_PARAMETERS
 
Fields inherited from interface meshi.util.KeyWords
AA_SEQUENCE, ACCESIBILITY_SEQUENCE, ALINMENT_FILE_PATH, ALL_CA, ALPHA_ANGLE_ENERGY, ALPHA_TORSION_ENERGY, ANGLE_ENERGY, ANGLE_X, ANGLE_Z, ATOMIC_PAIRWISE_PMF_SUMMA_ENERGY, BEAUTIFY_PROBLEMATIC_RANGE, BFGS, BOND_ENERGY, BUFFER_SIZE, CA_CLASH_DISTANCE, CA_LONG_DISTANCE, CA_MODEL, CA_SHORT_DISTANCE, CA_TETHER_ENERGY, CALPHA_HYDROGEN_BONDS, CALPHA_HYDROGEN_BONDS_PLANE, CASP_GROUP, CG, CHECK_INTERLOOP_DISTANCE, CLASH_DISTANCE, COMPOSITE_PROPENSITY_ENERGY, CONSENSUS_ENERGY, CONSTRICT, COOPERATIVE_ATOMIC_PAIRWISE_PMF_SUMMA_ENERGY, COOPERATIVE_ATOMIC_PAIRWISE_PMF_SUMMA_FILENAME, COOPERATIVE_PERATOM_SUMMA_ENERGY, COOPERATIVE_PERATOM_SUMMA_FILENAME, COOPERATIVE_PROPENSITY_ENERGY, COOPERATIVE_PROPENSITY_FILENAME, COOPERATIVE_RAMACHANDRAN_ENERGY, COOPERATIVE_RAMACHANDRAN_FILENAME, COOPERATIVE_Z_PROPENSITY_ENERGY, COOPERATIVE_Z_PROPENSITY_FILENAME, COOPERATIVE_Z_RAMACHANDRAN_ENERGY, COOPERATIVE_Z_RAMACHANDRAN_FILENAME, COOPERATIVE_Z_SUMMA_ENERGY, COOPERATIVE_Z_SUMMA_FILENAME, CORPUS_FILE_NAME, CSAonly_FILES_LOCATION_PATH, CUTOFF, CYLINDER_ENERGY, DICTIONARY_KEY, DIELECTRIC_CONSTANT, DISTANCE_CONSTRAINT_PCA, DISTANCE_CONSTRAINTS_ENERGY, DISTANCE_CONSTRAINTS_MASK, DISTANCE_FROM_CENTROID_ENERGY, DRESSER_FRAGMENTS, EDM_ENERGY, EDM_ENERGY_FILE_NAME, ELECTROSTATICS, END, EXCLUDED_VOL, FINAL_TEMPERATURE, FIX_C_TERMINAL, FIX_N_TERMINAL, FLAT_RAMACH_ENERGY, FREE_FINAL_MINIMIZATION, GRID_EDGE, HYDROGEN_BONDS, HYDROGEN_BONDS_ANGLES, HYDROGEN_BONDS_PAIRS, HYDROGEN_BONDS_PLANE, INFLATE_ENERGY, INITIAL_TEMPERATURE, INPUT_FILE, INTER_SEGMENT_FACTOR, INTER_SEGMENT_TOLERANCE, INTRA_SEGMENT_FACTOR, INTRA_SEGMENT_TOLERANCE, ITERATIONS_ALLATOM, ITERATIONS_BACKBONE, ITERATIONS_CA, KEY_KEY, KOEHL_FILE, LBFGS, LENNARD_JONES, LENNARD_JONES_CA, LINEAR_RG, LOOP1, LOOP2, LOOSEN_EDGE_LENGTH, MAX_ANGLE, MAX_CLASHES, MAX_DISTANCE, MAX_RUN_TIME, MAX_STEPS, MAX_WIDTH_OF_HAIRPIN, MCM, MCM_PERTURBATION, MESHILOG_KEY, METHOD, MIN_WIDTH_OF_HAIRPIN, MINIMIZATION_LOOP, MINIMIZE, MODE, MODEL, MODEL_DSSP, MODEL_NUMBER, N_ATOMS, N_TRIES, NON_FROZEN_BOND_DEPTH, NON_FROZEN_RADIUS, NONE, NUMBER, NUMBER_OF_CA_ITERATIONS, NUMBER_OF_CHAINS, NUMBER_OF_MODELS, NUMBER_OF_RUNS, OFF, ON, OPTIMIZER, OUT_OFPLANE_ENERGY, OUTPUT_FILE_NAME, OUTPUT_FILE_PATH, PARAMETERS_DIRECTORY, PDB_FILE, PLANE_ENERGY, PROPENSITY_TORSION_ENERGY, R_MAX, RAMACHANDRAN_SIDECHAIN_ENERGY, REFERENCE, RELAX, REPORT_EVERY, RESTART_EVERY, RMS_TARGET, ROTAMER_LIBRARY, SATURATION, SECONDARY_STRUCTURE, SEED, SEQUENCE, SHOTGUN_MODEL, SMOOTH_ROTAMER_LIBRARY_ENERGY, SOLVATE_ENERGY, SS_NAME, SS_SEQUENCE, STEEPEST_DECENT, STEPS, STRICT_CLASHES, STRUCTURE_NAMES, SUPERIMPOSE, SYMMETRY_ENERGY, TARGET_FILE_PATH, TARGET_NAME, TARGET_SEQUENCE, TEMPLATE_DISTANCE_CONSTRAINTS, TEMPLATE_DSSP, TEMPLATE_ENERGY, TEMPLATE_FILE_PATH, TEMPLATE_NAME, TEMPLATE_STRUCTURE, TEMPLATE_TARGET_ALIGNMENT, TETHER_ENERGY, TOLERANCE, TOPOLOGY_MAP, TWO_TORSIONS_ENERGY, UN_WARP_ENERGY, UNSATISFIED_CUTTOF, UP_TO_CUTOFF, USE_FAST_ARCCOS, VALUE_KEY, VOLUME_CONSTRAINT, WARP_ENERGY, WARP_STEP_SIZE, WARP_THRESHOLD, WEIGHT, WIDTH_OF_HAIRPIN
 
Constructor Summary
LocalFragmentLib(Corpus corpus, int[] seq, int libSize, double rmsCutoff, int fragStartInSeq, int fragEndInSeq)
           
LocalFragmentLib(Corpus corpus, int[] seq, int libSize, double rmsCutoff, int fragStartInSeq, int fragEndInSeq, Protein prot, int residueFragStart, int overlap, int manner, double overlapRMSsimilarity)
           
 
Method Summary
private  void buildLib(double[] energies, int fragStartInSeq, boolean filterStalks)
           
private  double[] calculateThreadingEnergy()
           
private  boolean checkSimilarity(int ind, int[] tmpIndices, int fragStartInSeq, boolean filterStalks)
          This method checks if the fragment 'ind' (given in the ungapped indexing) is similar to a fragment already in the lib.
private  int findLowestEnergy(int[] tmpIndices, double[] energies, boolean filterStalks, int fragStartInSeq)
          This method finds the lowest energy fragment that is not too similar to the rest of the lib
 void insertFragToProt(DunbrackLib rotLib, int indInLib)
          It is assumed that isFragCompatible was run before this method was called, so that fragCoors is updated.
 void insertFragToProt(DunbrackLib rotLib, int indInLib, Protein prot, int residueFragStart, int overlap, int manner)
          It is assumed that isFragCompatible was run before this method was called, so that fragCoors is updated.
 boolean isFragCompatible(int indInLib, double overlapRMSsimilarity)
          The 'prot', 'overlap', 'manner' and 'residueFragStart' are from the class's fields.
 boolean isFragCompatible(int indInLib, Protein prot, int residueFragStart, int overlap, int manner, double overlapRMSsimilarity)
          This method check whether the fragment 'indInLib' in the lib can overlap the given coordinates bellow a certain RMS cut off.
private  boolean isFragCompatibleForConstruction(int indInCorpus, double overlapRMSsimilarity)
          This method is used only during the construction when 'libOrig' is not yet ready.
 int libOrig(int ind)
           
 int libSize()
           
 java.lang.String printLib()
           
 java.lang.String printLib(int i)
           
 int residueFragStart()
           
 double superimposeFrag(int indInCorpus, Protein prot, int residueFragStart, int overlap, int manner)
          Superimposing fragment 'indInCorpus' in the corpus to a given portion in a protein.
 int trueFragEnd()
           
 int trueFragStart()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

corpus

private Corpus corpus

fragL

private int fragL

libSize

private int libSize

rmsCutOff

private double rmsCutOff

seq

private int[] seq

libOrig

private int[] libOrig

libEnergy

private double[] libEnergy

similarToLib

private boolean[] similarToLib

trueFragStart

private int trueFragStart

trueFragEnd

private int trueFragEnd

prot

private Protein prot

residueFragStart

private int residueFragStart

overlap

private int overlap

manner

private int manner

overlapRMSsimilarity

private double overlapRMSsimilarity

fragCoors

private double[][] fragCoors

protCoors

private double[][] protCoors
Constructor Detail

LocalFragmentLib

public LocalFragmentLib(Corpus corpus,
                        int[] seq,
                        int libSize,
                        double rmsCutoff,
                        int fragStartInSeq,
                        int fragEndInSeq,
                        Protein prot,
                        int residueFragStart,
                        int overlap,
                        int manner,
                        double overlapRMSsimilarity)

LocalFragmentLib

public LocalFragmentLib(Corpus corpus,
                        int[] seq,
                        int libSize,
                        double rmsCutoff,
                        int fragStartInSeq,
                        int fragEndInSeq)
Method Detail

calculateThreadingEnergy

private double[] calculateThreadingEnergy()

buildLib

private void buildLib(double[] energies,
                      int fragStartInSeq,
                      boolean filterStalks)

printLib

public java.lang.String printLib()

printLib

public java.lang.String printLib(int i)

checkSimilarity

private boolean checkSimilarity(int ind,
                                int[] tmpIndices,
                                int fragStartInSeq,
                                boolean filterStalks)
This method checks if the fragment 'ind' (given in the ungapped indexing) is similar to a fragment already in the lib. The array similarInLib is updated if a similarity is present.


findLowestEnergy

private int findLowestEnergy(int[] tmpIndices,
                             double[] energies,
                             boolean filterStalks,
                             int fragStartInSeq)
This method finds the lowest energy fragment that is not too similar to the rest of the lib


isFragCompatible

public boolean isFragCompatible(int indInLib,
                                Protein prot,
                                int residueFragStart,
                                int overlap,
                                int manner,
                                double overlapRMSsimilarity)
This method check whether the fragment 'indInLib' in the lib can overlap the given coordinates bellow a certain RMS cut off. The fragment correspond to a protein fragment starting in residue 'residueFragStart'. 'overlap' is the number of residues that are used for superposition. 'manner' means: -1 - overlap of the N-terminus 0 - two overlap regions in both termini (each of length overlap) 1 - overlap of the C-terminus This method affects (and updates) the protCoors and fragCoors arrays. 'prot' neednot be the protein from which the sequence for the library was taken.


isFragCompatible

public boolean isFragCompatible(int indInLib,
                                double overlapRMSsimilarity)
The 'prot', 'overlap', 'manner' and 'residueFragStart' are from the class's fields.


isFragCompatibleForConstruction

private boolean isFragCompatibleForConstruction(int indInCorpus,
                                                double overlapRMSsimilarity)
This method is used only during the construction when 'libOrig' is not yet ready.


superimposeFrag

public double superimposeFrag(int indInCorpus,
                              Protein prot,
                              int residueFragStart,
                              int overlap,
                              int manner)
Superimposing fragment 'indInCorpus' in the corpus to a given portion in a protein. The fragment correspond to a protein fragment starting in residue 'residueFragStart'. 'overlap' is the number of residues that are used for superposition. 'manner' means: -1 - overlap of the N-terminus 0 - two overlap regions in both termini (each of length overlap) 1 - overlap of the C-terminus The RMS is calculated only on the overlap region. This method affects (and updates) the protCoors and fragCoors arrays.


insertFragToProt

public void insertFragToProt(DunbrackLib rotLib,
                             int indInLib)
It is assumed that isFragCompatible was run before this method was called, so that fragCoors is updated. The 'prot', 'overlap', 'manner' and 'residueFragStart' are from the class's fields.


insertFragToProt

public void insertFragToProt(DunbrackLib rotLib,
                             int indInLib,
                             Protein prot,
                             int residueFragStart,
                             int overlap,
                             int manner)
It is assumed that isFragCompatible was run before this method was called, so that fragCoors is updated. 'prot' neednot be the protein from which the sequence for the library was taken.


libSize

public int libSize()

libOrig

public int libOrig(int ind)

trueFragStart

public int trueFragStart()

trueFragEnd

public int trueFragEnd()

residueFragStart

public int residueFragStart()