org.strbio.mol.lib.pred2ary
Class TPSet

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector
              extended by org.strbio.mol.PolymerSet
                  extended by org.strbio.mol.ProteinSet
                      extended by org.strbio.mol.ProfileSet
                          extended by org.strbio.mol.lib.pred2ary.PCPSet
                              extended by org.strbio.mol.lib.pred2ary.TPSet
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess
Direct Known Subclasses:
PredictionSet, TrainingSet

public class TPSet
extends PCPSet

Class to represent a set of profiles being used in 2ary structure prediction; this might be either a training or prediction set.

 Version 1.2, 6/7/99 - moved to org.strbio.mol.lib.pred2ary
 Version 1.12, 8/20/98 - moved translateEA() to protein.
 Version 1.11, 8/17/98 - changed some fatal() to exceptions.
 Version 1.1, 5/20/98 - added more ways to getNetworkStats
 Version 1.0, 5/12/98 - adapted from 2ary_set.cpp
 

Version:
1.2, 6/7/99
Author:
JMC
See Also:
PredClassProfile, Serialized Form

Nested Class Summary
static class TPSet.NetVars
          Class with variables used to configure the neural nets.
 
Nested classes/interfaces inherited from class org.strbio.mol.PolymerSet
PolymerSet.PolymerEnumeration
 
Field Summary
static boolean CLASS_2ARY
          turn on the 3 inputs with predicted secondary structure percentages and predicted number of alternations between helix and sheet.
static boolean CLASS_AA
          set these to determine exactly what sort of class network to use note that the "sequence length" input is always on.
static boolean CLASS_STRONG
          turn on the 2 inputs with "strong" secondary structure predictions.
 SimMatrix CSM
           
 CorrectMatrix[] CSM1
           
 double cutoff_2ary
           
 double[] cutoff_class
           
 double cutoff_lvl2
           
 int nstats
           
 SimMatrix r_SM
           
 SimMatrix SM
           
static boolean USE_LENGTH_INFO
          Set this to allow the class prediction algorith to know the length rules without learning them from the training set.
 TPSet.NetVars vars
           
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
TPSet()
           
TPSet(TPSet q)
           
 
Method Summary
 void addSM(TPSet x)
           
 void clear()
          Clear out all information in the set.
 void clearSM()
           
 void compute2arySM(int which, int sample)
          compute SM for a set.
 void computeClassSM()
          compute CSM for a set
 void copyLvl1HE()
          copy lvl1 predictions for all proteins in set
 void copyUnreducedStats(int sample)
          copy unreduced predictions for all proteins in set
 void deleteSM()
           
 void estAccy(IMatrix ea_h, IMatrix ea_e, IMatrix ea_c)
          estimate accuracy, replacing h, e, predStructure, and the SM matrices
 void estAccyCount(IMatrix ea_h, IMatrix ea_e, IMatrix ea_c)
          make count matrices for est_accy
 double fcut2ary(NeuralNet net, int sample, Printf outfile)
          find best 2ary cutoff
 void fcutClass(NeuralNet cnet4, NeuralNet[] cnet1, Printf outfile)
          find cutoff, and compute class stats
 double fcutLvl2(NeuralNet net, int sample, Printf outfile)
          find cutoff, and compute stats on a training set.
 void filterPred()
          filter out short predictions
 void findInputs()
          find class inputs for all proteins in set
 java.lang.String name2ary(int i)
          return name of various types of 2ary str
 void newSM(int x)
          make/delete stats for all proteins in a set
 void predict2ary(NeuralNet net, int sample, Printf outfile)
          do a 2ary prediction
 void predict2aryHE(NeuralNet net)
          Predict level 1 H and E using network.
 void predictClass(NeuralNet cnet4, NeuralNet[] cnet1, Printf outfile)
          do class prediction
 void predictClassDirectly(Printf outfile)
          do class prediction directly from 2ary prediction
 void predictClassRaw(NeuralNet cnet4, NeuralNet[] cnet1)
          predict class using both 4-output and 1-output networks.
 void predictLvl2(NeuralNet net, int sample, Printf outfile)
          do a prediction
 void predictLvl2HE(NeuralNet net)
          do level 2 prediction
 void print2ary(Printf outfile, int sample)
           
 void print2aryByClass(Printf outfile)
           
 void print2aryStats(Printf outfile)
           
 void print2aryUnreduced(Printf outfile)
           
 void printClass(Printf outfile)
           
 void printClassStats(Printf outfile)
           
 void printDirectClassPrediction(Printf outfile)
           
 void printDirectClassStats(Printf outfile)
           
 void smooth(int num)
          smooth h and e
 void translate2ary()
          translate he to predictions
 void translateClass()
          saved net outputs -> class predictions
 void translateEA()
           
 
Methods inherited from class org.strbio.mol.lib.pred2ary.PCPSet
addClassPred, addPred, addPred, addPredToArray, clearClassPred, clearPred, combine, divideClassPred, dividePred, loadClassPred, loadPred, newPolymer, newPolymer, pcp, predDiffs, saveClassPred, savePred
 
Methods inherited from class org.strbio.mol.ProfileSet
blast, blast, write, writeClustal, writeClustal, writeMSF, writeMSF, writeProf, writeProf, writeSAF, writeSAF, writeTDP
 
Methods inherited from class org.strbio.mol.ProteinSet
findDSSP, findPDB, fixDistanceGaps, predictSS, predictSS, protein, residues, thread, thread, writeCASP, writeCASP, writeConv, writeConv, writeEA, writeEA, writePDB, writePDB, writePDB, writePDB, writeVar2, writeVar2
 
Methods inherited from class org.strbio.mol.PolymerSet
add, add, add, addReversedCopies, clearPolymers, clearProperties, clearProperty, ensureNames, findClosest, getNames, getPropertyAll, getPropertyOne, isEqual, keepOnlyChainID, keepOnlyNames, keepOnlyNamesFuzzy, load, n, nMonomers, noSpaceNames, nPolymersInFile, p, polymer, polymers, polymersInFile, polymersInFile, polymersInFile, polymersInFile, printNames, read, read, read, readList, remove, remove, removeRedundantSequences, save, searchByName, searchByNameFuzzy, searchByNameFuzzy, searchByNameFuzzyIndex, searchByNameFuzzyIndex, searchByNameIndex, setPolymerAt, setProperty, stripNoAtoms, writeFasta, writeFasta, writeList, writeList, writePTS, writePTS, writeYAPF, writeYAPF
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Field Detail

USE_LENGTH_INFO

public static final boolean USE_LENGTH_INFO
Set this to allow the class prediction algorith to know the length rules without learning them from the training set.

See Also:
Constant Field Values

CLASS_AA

public static final boolean CLASS_AA
set these to determine exactly what sort of class network to use note that the "sequence length" input is always on. Turn on the 20 inputs with AA percentages.

See Also:
Constant Field Values

CLASS_2ARY

public static final boolean CLASS_2ARY
turn on the 3 inputs with predicted secondary structure percentages and predicted number of alternations between helix and sheet.

See Also:
Constant Field Values

CLASS_STRONG

public static final boolean CLASS_STRONG
turn on the 2 inputs with "strong" secondary structure predictions.

See Also:
Constant Field Values

nstats

public int nstats

r_SM

public SimMatrix r_SM

SM

public SimMatrix SM

CSM

public SimMatrix CSM

CSM1

public CorrectMatrix[] CSM1

cutoff_2ary

public double cutoff_2ary

cutoff_lvl2

public double cutoff_lvl2

cutoff_class

public double[] cutoff_class

vars

public TPSet.NetVars vars
Constructor Detail

TPSet

public TPSet()

TPSet

public TPSet(TPSet q)
Method Detail

clear

public void clear()
Clear out all information in the set.

Specified by:
clear in interface java.util.Collection
Specified by:
clear in interface java.util.List
Overrides:
clear in class PolymerSet

predict2aryHE

public final void predict2aryHE(NeuralNet net)
Predict level 1 H and E using network.


predictLvl2HE

public final void predictLvl2HE(NeuralNet net)
do level 2 prediction


predictClassRaw

public final void predictClassRaw(NeuralNet cnet4,
                                  NeuralNet[] cnet1)
predict class using both 4-output and 1-output networks.


compute2arySM

public final void compute2arySM(int which,
                                int sample)
compute SM for a set.

See Also:
PredClassProfile.compute2arySM(int, int)

computeClassSM

public final void computeClassSM()
compute CSM for a set


predict2ary

public final void predict2ary(NeuralNet net,
                              int sample,
                              Printf outfile)
do a 2ary prediction


predictLvl2

public final void predictLvl2(NeuralNet net,
                              int sample,
                              Printf outfile)
do a prediction


predictClassDirectly

public final void predictClassDirectly(Printf outfile)
do class prediction directly from 2ary prediction


predictClass

public final void predictClass(NeuralNet cnet4,
                               NeuralNet[] cnet1,
                               Printf outfile)
do class prediction


fcut2ary

public final double fcut2ary(NeuralNet net,
                             int sample,
                             Printf outfile)
find best 2ary cutoff


fcutLvl2

public final double fcutLvl2(NeuralNet net,
                             int sample,
                             Printf outfile)
find cutoff, and compute stats on a training set.


fcutClass

public final void fcutClass(NeuralNet cnet4,
                            NeuralNet[] cnet1,
                            Printf outfile)
find cutoff, and compute class stats


smooth

public final void smooth(int num)
smooth h and e


translate2ary

public final void translate2ary()
translate he to predictions


translateEA

public final void translateEA()

translateClass

public final void translateClass()
saved net outputs -> class predictions


filterPred

public final void filterPred()
filter out short predictions


newSM

public void newSM(int x)
make/delete stats for all proteins in a set


deleteSM

public final void deleteSM()

clearSM

public final void clearSM()

addSM

public final void addSM(TPSet x)

copyLvl1HE

public final void copyLvl1HE()
copy lvl1 predictions for all proteins in set


findInputs

public final void findInputs()
find class inputs for all proteins in set


copyUnreducedStats

public final void copyUnreducedStats(int sample)
copy unreduced predictions for all proteins in set


name2ary

public final java.lang.String name2ary(int i)
return name of various types of 2ary str


print2aryStats

public final void print2aryStats(Printf outfile)

print2aryByClass

public final void print2aryByClass(Printf outfile)

print2aryUnreduced

public final void print2aryUnreduced(Printf outfile)

printClassStats

public final void printClassStats(Printf outfile)

printDirectClassStats

public final void printDirectClassStats(Printf outfile)

print2ary

public final void print2ary(Printf outfile,
                            int sample)

printClass

public final void printClass(Printf outfile)

printDirectClassPrediction

public final void printDirectClassPrediction(Printf outfile)

estAccyCount

public final void estAccyCount(IMatrix ea_h,
                               IMatrix ea_e,
                               IMatrix ea_c)
make count matrices for est_accy


estAccy

public final void estAccy(IMatrix ea_h,
                          IMatrix ea_e,
                          IMatrix ea_c)
estimate accuracy, replacing h, e, predStructure, and the SM matrices