Documentation ¶
Index ¶
Examples ¶
Constants ¶
const ( SeqProtein = iota SeqDeoxy SeqRibo )
Variables ¶
This section is empty.
Functions ¶
func RMSD ¶
func RMSD(entry1 *Entry, chainId1 byte, start1, end1 int, entry2 *Entry, chainId2 byte, start2, end2 int) (float64, error)
RMSD is a convenience function for computing the RMSD between two sets of residues, where each set is take from a chain of a PDB entry. Note that RMSD is only computed using carbon-alpha atoms.
Each set of atoms to be used is specified by a four-tuple: a PDB entry file, a chain identifier, and the start and end residue numbers to use as a range. (Where the range is inclusive.)
An error will be returned if: chainId{1,2} does not correspond to a chain in entry{1,2}. The ranges specified by start{1,2}-end{1,2} are not valid. The ranges specified by start{1,2}-end{1,2} do not correspond to precisely the same number of carbon-alpha atoms.
Types ¶
type Chain ¶
type Chain struct { Entry *Entry Ident byte SeqType SequenceType Sequence []seq.Residue Models []*Model Missing []*Residue }
func (*Chain) AsSequence ¶
AsSequence returns the chain as a sequence with an appropriate name. (e.g., 1tcfA)
func (Chain) CaAtoms ¶
CaAtoms returns all alpha-carbon atoms in the chain. If there is more than one model, only the first model is used.
func (Chain) IsProtein ¶
IsProtein returns true if the chain consists of amino acids.
IsProtein also returns true if there are no SEQRES records.
func (Chain) SequenceAtoms ¶
SequenceAtoms returns a slice of all residues for the chain in correspondence with the sequence in SEQRES (automatically using the first model). Namely, the mapping is sparse, since not all SEQRES residues have an ATOM record.
See Model.SequenceCaAtoms for the deets.
func (Chain) SequenceCaAtomSlice ¶
SequenceCaAtomSlice attempts to extract a contiguous slice of alpha-carbon ATOM records based on *residue* index. Namely, if a contiguous slice cannot be found, nil is returned. If there is more than one model, the first model is used.
func (Chain) SequenceCaAtoms ¶
SequenceCaAtoms returns a slice of all Ca atoms for the chain in correspondence with the sequence in SEQRES (automatically using the first model).
See Model.SequenceCaAtoms for the deets.
type Entry ¶
type Entry struct { Path string IdCode string Chains []*Chain // SCOP is set whenever we see an identifier that looks like a // SCOP id. We use this to determine how to satisfy the Bower interface, // so that each entry has a unique ID. // Similarly for CATH. Scop string Cath string }
func ReadPDB ¶
Example ¶
entry := readPDB() fmt.Printf("%s\n", entry.Chains[1].Sequence) res := entry.Chains[0].Models[1].Residues[0] atom := res.Atoms[1] fmt.Printf("%s %c %0.3f %0.3f %0.3f\n", atom.Name, res.Name, atom.X, atom.Y, atom.Z)
Output: AYIGPYL CA S -18.866 9.770 -5.303
type Model ¶
func (Model) CaAtoms ¶
CaAtoms returns all alpha-carbon atoms in the model. This includes multiple alpha-carbon atoms belonging to the same residue. It does not include HETATMs.
func (Model) SequenceAtoms ¶
SequenceAtoms is just like SequenceCaAtoms, except it returns the residues instead of the alpha-carbon coordinates directly. The advantage here is to get a mapping that isn't limited by the presence of alpha-carbon atoms.
See SequenceCaAtoms for the deets.
func (Model) SequenceCaAtomSlice ¶
SequenceCaAtomSlice attempts to extract a contiguous slice of alpha-carbon ATOM records based on *residue* index. Namely, if a contiguous slice cannot be found, nil is returned.
func (Model) SequenceCaAtoms ¶
SequenceCaAtoms returns a slice of all Ca atoms for the model in correspondence with the sequence in SEQRES. Note that a slice of pointers is returned, since not all residues necessarily correspond to a alpha-carbon ATOM.
This method can proceed in one of two ways. First, if "REMARK 465" is present in the PDB file, it will be used to determine the positions of the holes in the sequence (i.e., residues in SEQRES without an ATOM record). This method is generally reliable, since REMARK 465 lists all residues in SEQRES that don't have an ATOM record. This will fail if there are any unreported missing residues.
If "REMARK 465" is absent, then we have to rely on the order of ATOM records to correspond to a residue index in the SEQRES sequence. This will fail with an error if there are any unreported missing residues.
Generally, false positives are limited by returning errors if corruption is detected. However, false positives can be returned in pathological cases (like long strings of low complexity regions or UNKNOWN amino acids), but they are rare. Probably on the order of a handful in the entire PDB.
In sum, a list of atom pointers is returned with length equal to the number of residues in the SEQRES record for this model. Some pointers may be nil.
type SequenceType ¶
type SequenceType int
func (SequenceType) String ¶
func (typ SequenceType) String() string