|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.strbio.mol.Monomer
public class Monomer
Class to represent a single monomer in a linear polymer. Having a monomer that's not part of a polymer doesn't make sense; use Molecule instead.
Version 1.3, 12/15/04 - added molecularWeight Version 1.2, 1/11/00 - added stripAllBut Version 1.14, 12/13/99 - added stripAtomsByName Version 1.13, 2/16/99 - added YAPF support. Changed readPDBAtom to readAtomRecord to avoid confusion with same function under Protein (which does something different), and to be more consistent with other readSomethingRecord functions under Residue. Version 1.12, 11/2/98 - added isGap, isValidType, isValidNonGap functions Version 1.11, 10/26/98 - can read lower case FASTA files Version 1.1, 10/16/98 - added centerOfMass() Version 1.01, 8/7/98 - changed PrintfStream to Printf Version 1.0, 4/16/98 - original version
Atom
,
AtomNode
,
Residue
,
Protein
Field Summary | |
---|---|
DLinkedList |
atoms
pointer to the atoms, if there are any (if not, this is null). |
int |
n
sequence number, which is the number in the file for files (like PDB) that contain this info; otherwise numbering starts at 0. |
char |
type
type of monomer, in a one-letter code |
Constructor Summary | |
---|---|
Monomer()
Constructor makes everything null. |
|
Monomer(char t)
Construct from a character with the monomer type. |
|
Monomer(Monomer q)
copy another monomer, including the atoms. |
|
Monomer(java.lang.String t)
Construct from a string with the monomer type. |
Method Summary | |
---|---|
Atom |
atomSearch(java.lang.String name)
Search the atoms of this monomer for the first atom with a given name. |
DVector |
centerOfMass()
Return a new DVector(3) containing the center of mass for the monomer. |
void |
centerOfMass(DVector cm)
Finds the center of mass for the monomer and puts in in the DVector(3) that you pass it. |
void |
copyAtoms(Monomer q)
copy the atoms from another monomer. |
void |
copyDataFrom(Monomer q)
copy another monomer, including the atoms. |
DLinkedList.Node |
copyNode()
copy contents of a monomer. |
boolean |
isGap()
does this monomer represent a gap? |
boolean |
isValidNonGap()
Is this monomer something which is valid, but not a gap? |
boolean |
isValidType()
is the character in 'type' valid for this monomer? |
double |
molecularWeight()
molecular weight; default zero. |
int |
nAtoms()
How many atoms are there? |
int |
nAtomsWithCoord()
How many atoms are there with known coordinates? |
DLinkedList.Node |
next()
return the next monomer in the polymer. |
DLinkedList.Node |
prev()
return the previous monomer in the polymer. |
void |
readAtomRecord(java.lang.String buffer)
Reads one PDB/YAPF atom record out of a buffer string, and inserts it into the list of atoms. |
boolean |
readFasta(java.io.BufferedReader infile)
Read this monomer out of a Fasta format file. |
void |
readSeqRecord(java.lang.String buffer)
Read this monomer out of a YAPF (sequence profile) format file (JMC's format). |
void |
rotate(DMatrix rot)
rotate all atoms by multiplying by a 3x3 rotation matrix. |
void |
setNext(DLinkedList.Node x)
set the next monomer in the polymer. |
void |
setPrev(DLinkedList.Node x)
set the previous monomer in the polymer. |
void |
stripAllAtoms()
Strip away all atoms from this monomer. |
void |
stripAllBut(java.lang.String[] names)
Strip away all atoms except ones named in an array. |
void |
stripAllButFirstAtom()
Strip all but first atom from this monomer. |
void |
stripAtomsByName(java.lang.String atomName)
Strip away a named atom or atoms. |
void |
transform(DMatrix trans)
transform the position of all atoms. |
void |
translate(DVector trans)
translate all atoms by adding a DVector(3) to their coordinates. |
java.lang.String |
typeName()
Return a long name for this monomer, based on the type. |
void |
writePDBAtom(Printf outfile,
java.lang.String polyname,
char chainid)
Writes out PDB ATOM records for all atoms belonging to this monomer. |
void |
writePts(Printf outfile)
Writes out this monomer in PTS (Jon Blake's) format. |
void |
writeSeqRecord(Printf outfile)
Write this monomer in JMC's YAPF format. |
void |
writeYAPFAtom(Printf outfile,
char chainid)
Writes out YAPF ATOM records for all atoms belonging to this monomer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public char type
public int n
public DLinkedList atoms
Constructor Detail |
---|
public Monomer()
public Monomer(char t)
public Monomer(java.lang.String t)
public Monomer(Monomer q)
Method Detail |
---|
public void copyAtoms(Monomer q)
public DVector centerOfMass()
public void centerOfMass(DVector cm)
public int nAtoms()
public int nAtomsWithCoord()
public void copyDataFrom(Monomer q)
public DLinkedList.Node next()
next
in interface DLinkedList.Node
public DLinkedList.Node prev()
prev
in interface DLinkedList.Node
public void setNext(DLinkedList.Node x)
setNext
in interface DLinkedList.Node
public void setPrev(DLinkedList.Node x)
setPrev
in interface DLinkedList.Node
public DLinkedList.Node copyNode()
copyNode
in interface DLinkedList.Node
public java.lang.String typeName()
public final Atom atomSearch(java.lang.String name)
public final void stripAllAtoms()
public final void stripAllButFirstAtom()
public final void stripAtomsByName(java.lang.String atomName)
public final void stripAllBut(java.lang.String[] names)
public void writePDBAtom(Printf outfile, java.lang.String polyname, char chainid) throws java.io.IOException
outfile
- an open Printfpolyname
- name of the polymer, or null for generic polymer.chainid
- the chain ID, or space if there isn't one.
java.io.IOException
public void writeYAPFAtom(Printf outfile, char chainid) throws java.io.IOException
outfile
- an open Printfchainid
- the chain ID, or space if there isn't one.
java.io.IOException
public void readAtomRecord(java.lang.String buffer)
buffer
- a line from a PDB/YAPF file with an ATOM record belonging
to this monomer.Atom.readPDB(java.lang.String)
public void writeSeqRecord(Printf outfile) throws java.io.IOException
java.io.IOException
public void readSeqRecord(java.lang.String buffer) throws java.io.IOException
java.io.IOException
public void writePts(Printf outfile) throws java.io.IOException
java.io.IOException
Protein.stripAllButCA()
,
Polymer.writePTS(org.strbio.io.Printf)
public boolean readFasta(java.io.BufferedReader infile) throws java.io.IOException
java.io.IOException
Polymer.readFasta(java.io.BufferedReader, org.strbio.io.Printf)
public final void translate(DVector trans)
Atom.translate(org.strbio.math.DVector)
public final void rotate(DMatrix rot)
Atom.rotate(org.strbio.math.DMatrix)
public final void transform(DMatrix trans)
Atom.transform(org.strbio.math.DMatrix)
public boolean isGap()
public boolean isValidType()
public boolean isValidNonGap()
public double molecularWeight()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |