org.strbio.mol
Class ProfRes

java.lang.Object
  extended by org.strbio.mol.Monomer
      extended by org.strbio.mol.Residue
          extended by org.strbio.mol.ProfRes
All Implemented Interfaces:
DLinkedList.Node
Direct Known Subclasses:
ProfResPSI

public class ProfRes
extends Residue

Class to represent a single residue in a protein with profile information. All the standard residue info applies to the main residue in the profile (usually the one for which structure is known); statistical information about possible residue substitutions at each position is also stored.

 Version 1.2, 3/10/00 - changed frequency() vector to contain
   frequencies multiplied by 1000.  Also added nonZeroFrequency
   vector to hold indices of non-zero frequencies.
 Version 1.1, 10/4/99 - increased speed of addSeq, removeSeq
 Version 1.02, 1/19/99 - added removeSeq
 Version 1.01, 8/7/98 - changed PrintfStream to Printf
 Version 1.0, 4/30/98 - original version
 

Version:
1.2, 3/10/00
Author:
JMC
See Also:
Profile

Field Summary
 int[] frequency
          0-100 frequency for each residue in the profile, in alphabetical order by 3-letter code, multiplied by 1000.
 int[] nonZeroFrequency
          Index of non-zero frequencies, if calculated.
static java.lang.String oneLetterHSSP
          one letter code, in the order used in the HSSP.
 char[] seq
          Info on sequences in the profile, if available.
 double weight
          Conservation weight, as defined by Rost & Sander.
 
Fields inherited from class org.strbio.mol.Residue
aaMolecularWeight, cAlpha, cPhi, cPsi, cTau, env, exposedArea, oneLetter, oneLetterBLAST, oneLetterDefay, pctExposed, predE, predH, predStructure, structure, threeLetter
 
Fields inherited from class org.strbio.mol.Monomer
atoms, n, type
 
Constructor Summary
ProfRes()
          Most constructors just call the superclass one.
ProfRes(char t)
           
ProfRes(ProfRes q)
          Constructor to copy another ProfRes.
ProfRes(Residue q)
           
ProfRes(java.lang.String s)
           
 
Method Summary
 void allocSeqs(int n)
          Tell the ProfRes to allocate space for at least N sequences.
 void clearSeqs()
          Tell the ProfRes to forget any sequence information it knows.
 void copyDataFrom(Monomer q)
          Copy another ProfRes.
 DLinkedList.Node copyNode()
          copy contents of a residue
 void findFrequencies()
          Calculate the frequencies for this residue from the seq.
 void findNonZeroFrequencies()
          Index which frequencies are non-zero.
 void frequencies2Consensus()
          Find the consensus residue for this residue from the frequencies.
static int HSSPnum2Num(int x)
          Translate the ordering used in the HSSP code to my numbering.
 void readCWRecord(java.lang.String buffer)
          Read CW record out of YAPF file.
 void readFREQRecord(java.lang.String buffer)
          Read FREQ record out of YAPF file.
 boolean readHSSPSeqs(java.io.BufferedReader infile, int firstAln, int lastAln)
          Read sequence info for this residue out of a HSSP format file.
 boolean readProf(java.io.BufferedReader infile)
          Read this residue out of a Prof (sequence profile) format file (JMC's format).
 void readSeqRecord(java.lang.String buffer)
          Read this residue out of a YAPF (sequence profile) format file (JMC's format).
 void removeSeq(int n)
          Remove one sequence from the ProfRes.
 int sequences()
          Number of sequences in the profile, if known; otherwise, zero.
 void writeCWRecord(Printf outfile)
          Write CW info for this residue in JMC's YAPF format.
 void writeFREQRecord(Printf outfile)
          Write FREQ info for this residue in JMC's YAPF format.
 void writeProf(Printf outfile)
          Write this residue in JMC's .prof format.
 void writeSeqRecord(Printf outfile)
          Write this residue in JMC's YAPF format.
 
Methods inherited from class org.strbio.mol.Residue
alpha, is3Res, isGap, isGap, isRes, isValidType, makeVirtualCB, molecularWeight, num2Res, num2ResDefay, one2Three, phi, psi, readAccess, readAccessRecord, readAngleRecord, readConv, readDSSP, readDSSPRecord, readEA, readJMCSTR, readPredSSRecord, readVar, readVar2, readVarTomRecord, res2Num, res2NumDefay, stripAllButCA, tau, three2One, translateEA, typeName, writeAccessRecord, writeAngleRecord, writeCASP, writeConv, writeDSSPRecord, writeEA, writePDBStr, writePredSSRecord, writeVar2, writeVarTomRecord
 
Methods inherited from class org.strbio.mol.Monomer
atomSearch, centerOfMass, centerOfMass, copyAtoms, isValidNonGap, nAtoms, nAtomsWithCoord, next, prev, readAtomRecord, readFasta, rotate, setNext, setPrev, stripAllAtoms, stripAllBut, stripAllButFirstAtom, stripAtomsByName, transform, translate, writePDBAtom, writePts, writeYAPFAtom
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

oneLetterHSSP

public static final java.lang.String oneLetterHSSP
one letter code, in the order used in the HSSP.

See Also:
Residue.res2Num(char), Residue.res2NumDefay(char), Constant Field Values

frequency

public int[] frequency
0-100 frequency for each residue in the profile, in alphabetical order by 3-letter code, multiplied by 1000. The position for any given AA type is Residue.res2Num(AA type) - 1.


nonZeroFrequency

public int[] nonZeroFrequency
Index of non-zero frequencies, if calculated. Otherwise, null. This will be a vector of up to 20 integers that point to non-zero positions in the frequency[] matrix, indexed from 1. The non-zero positions end at the first 0 in this vector, unless all 20 are non-zero.


weight

public double weight
Conservation weight, as defined by Rost & Sander.


seq

public char[] seq
Info on sequences in the profile, if available. If not, this is null.

Constructor Detail

ProfRes

public ProfRes()
Most constructors just call the superclass one. A new ProfRes has 1.0 weight and 0.0 frequencies.


ProfRes

public ProfRes(char t)

ProfRes

public ProfRes(java.lang.String s)

ProfRes

public ProfRes(Residue q)

ProfRes

public ProfRes(ProfRes q)
Constructor to copy another ProfRes.

Method Detail

HSSPnum2Num

public static final int HSSPnum2Num(int x)
                             throws java.lang.IllegalArgumentException
Translate the ordering used in the HSSP code to my numbering.

Throws:
java.lang.IllegalArgumentException

sequences

public int sequences()
Number of sequences in the profile, if known; otherwise, zero.


copyDataFrom

public void copyDataFrom(Monomer q)
Copy another ProfRes.

Overrides:
copyDataFrom in class Residue

copyNode

public DLinkedList.Node copyNode()
copy contents of a residue

Specified by:
copyNode in interface DLinkedList.Node
Overrides:
copyNode in class Residue

clearSeqs

public void clearSeqs()
Tell the ProfRes to forget any sequence information it knows.


allocSeqs

public void allocSeqs(int n)
Tell the ProfRes to allocate space for at least N sequences. All old information is copied. The default sequence character is '-' (same as the default Monomer type).


removeSeq

public void removeSeq(int n)
Remove one sequence from the ProfRes.


frequencies2Consensus

public final void frequencies2Consensus()
Find the consensus residue for this residue from the frequencies.


findFrequencies

public final void findFrequencies()
Calculate the frequencies for this residue from the seq.


findNonZeroFrequencies

public final void findNonZeroFrequencies()
Index which frequencies are non-zero.


readProf

public final boolean readProf(java.io.BufferedReader infile)
Read this residue out of a Prof (sequence profile) format file (JMC's format). If the next line of input in the file is not in the right format, it resets the file back to before the line, and returns false. If the residue is successfully read in, the line is consumed, and the function returns true.

Overrides:
readProf in class Residue
See Also:
Protein.readProf(java.io.BufferedReader, org.strbio.io.Printf)

readSeqRecord

public final void readSeqRecord(java.lang.String buffer)
                         throws java.io.IOException
Read this residue out of a YAPF (sequence profile) format file (JMC's format). The line must be a SEQ N X XXXXXXX type line, for multi-sequence info. N is a 5 digit field.

Overrides:
readSeqRecord in class Monomer
Throws:
java.io.IOException
See Also:
Polymer.readYAPF(java.io.BufferedReader, org.strbio.io.Printf)

writeProf

public final void writeProf(Printf outfile)
                     throws java.io.IOException
Write this residue in JMC's .prof format.

Throws:
java.io.IOException
See Also:
Profile.writeProf(org.strbio.io.Printf)

writeSeqRecord

public final void writeSeqRecord(Printf outfile)
                          throws java.io.IOException
Write this residue in JMC's YAPF format.

Overrides:
writeSeqRecord in class Monomer
Throws:
java.io.IOException

readCWRecord

public void readCWRecord(java.lang.String buffer)
                  throws java.io.IOException
Read CW record out of YAPF file.

Throws:
java.io.IOException

writeCWRecord

public final void writeCWRecord(Printf outfile)
                         throws java.io.IOException
Write CW info for this residue in JMC's YAPF format.

Throws:
java.io.IOException

readFREQRecord

public void readFREQRecord(java.lang.String buffer)
                    throws java.io.IOException
Read FREQ record out of YAPF file.

Throws:
java.io.IOException

writeFREQRecord

public final void writeFREQRecord(Printf outfile)
                           throws java.io.IOException
Write FREQ info for this residue in JMC's YAPF format.

Throws:
java.io.IOException

readHSSPSeqs

public final boolean readHSSPSeqs(java.io.BufferedReader infile,
                                  int firstAln,
                                  int lastAln)
Read sequence info for this residue out of a HSSP format file. Return Chain ID in predStructure. If the next line of input in the file is not in the right format, it resets the file back to before the line, and returns false. If the residue is successfully read in, the line is consumed, and the function returns true.

See Also:
Profile.readHSSP(java.io.BufferedReader, org.strbio.io.Printf)