Science_Chemistry
[ class tree: Science_Chemistry ] [ index: Science_Chemistry ] [ all elements ]

Source for file Residue_PDB.php

Documentation is available at Residue_PDB.php

  1. <?php
  2. //
  3. // +----------------------------------------------------------------------+
  4. // | PHP Version 4                                                        |
  5. // +----------------------------------------------------------------------+
  6. // | Copyright (c) 1997-2003 The PHP Group                                |
  7. // +----------------------------------------------------------------------+
  8. // | This source file is subject to version 2.0 of the PHP license,       |
  9. // | that is bundled with this package in the file LICENSE, and is        |
  10. // | available at through the world-wide-web at                           |
  11. // | http://www.php.net/license/2_02.txt.                                 |
  12. // | If you did not receive a copy of the PHP license and are unable to   |
  13. // | obtain it through the world-wide-web, please send a note to          |
  14. // | license@php.net so we can mail you a copy immediately.               |
  15. // +----------------------------------------------------------------------+
  16. // | Authors: Jesus M. Castagnetto <jmcastagnetto@php.net>                |
  17. // +----------------------------------------------------------------------+
  18. //
  19. // $Id$
  20. //
  21.  
  22. require_once "Science/Chemistry.php";
  23. require_once "Science/Chemistry/Atom_PDB.php";
  24. require_once "Science/Chemistry/Molecule.php";
  25.  
  26. /**
  27.  * Represents a PDB residue
  28.  *
  29.  * @author  Jesus M. Castagnetto <jmcastagnetto@php.net>
  30.  * @version 1.0
  31.  * @access  public
  32.  * @package Science_Chemistry
  33.  */
  34.  
  35.     /**
  36.      * PDB Residue sequence number
  37.      *
  38.      * @var     integer 
  39.      * @access   private
  40.      */
  41.     var $seq_num;
  42.  
  43.     /**
  44.      * PDB Residue chain
  45.      *
  46.      * @var     string 
  47.      * @access  private
  48.      */
  49.     var $chain;
  50.  
  51.     /**
  52.      * PDB Residue ID
  53.      * $id = "$name:$seq_num:$chain"
  54.      *
  55.      * @var     string 
  56.      * @access  private
  57.      */
  58.     var $id;
  59.  
  60.     /**
  61.      * PDB ID for the protein that contains
  62.      * this residue
  63.      *
  64.      * @var     string 
  65.      * @access  private
  66.      */
  67.     var $pdb;
  68.  
  69.     /**
  70.      * If the PDB residue object has been initialized
  71.      *
  72.      * @var     boolean 
  73.      * @access  public
  74.      */
  75.     var $VALID = false;
  76.  
  77.  
  78.     /**
  79.      * Reference to the protein
  80.      * to which this residue belongs
  81.      *
  82.      * @var      object  Science_Chemistry_Macromolecule_PDB 
  83.      * @access   public
  84.      */
  85.     var $macromol;
  86.     
  87.     /**
  88.      * Constructor for the class
  89.      *
  90.      * @param   string  $pdb    PDB if of the protein/nucleic acid/etc.
  91.      * @param   array   $atomrec_arr    Array of PDB atom record lines
  92.      * @param   object  Science_Chemistry_Macromolecule_PDB  $macromol   reference to the containing macromolecule
  93.      * @return  object  Science_Chemistry_Residue_PDB 
  94.      * @access  public
  95.      */
  96.     function Science_Chemistry_Residue_PDB($pdb$atomrec_arr$macromol=""{
  97.         for ($i=0; $i count($atomrec_arr)$i++{
  98.             $this->atoms[= new Science_Chemistry_Atom_PDB($atomrec_arr[$i]$this);
  99.         }
  100.  
  101.         if (!empty($this->atoms)) {
  102.             $this->VALID = true;
  103.             $this->macromol =$macromol;
  104.             $this->pdb =$pdb;
  105.             $this->num_atoms = count($this->atoms);
  106.             $line =$atomrec_arr[0];
  107.             $this->name = trim(substr($line,17,3));
  108.             $this->chain trim(substr($line,21,1));
  109.             $this->seq_num = (int) trim(substr($line,22,4));
  110.             $this->id $this->name.":".$this->seq_num.":".$this->chain;
  111.         else {
  112.             return null;
  113.         }
  114.     }
  115.  
  116.  
  117.     /**
  118.      * Calculates geometrical parameters for the residue
  119.      * Backbone bond distances, angles and torsions
  120.      * Sidechain Chi angles
  121.      * TODO
  122.      *
  123.      * @return  boolean 
  124.      * @access  public
  125.      */
  126.     /*
  127.     function calcGeomParams() {
  128.         // TODO
  129.         return true;
  130.     }
  131.     */
  132.  
  133.     /**
  134.      * Returns geometrical parameter for the residue
  135.      * One of: bonds, angles, torsions, or chis
  136.      * TODO
  137.      *
  138.      * @return  array 
  139.      * @access  public
  140.      */
  141.     /*
  142.     function getGeomParams($param) {
  143.         // TODO
  144.         return array();
  145.     }
  146.     */
  147.  
  148. // end of Science_Chemistry_Residue_PDB class
  149.  
  150. // vim: expandtab: ts=4: sw=4
  151. ?>

Documentation generated on Mon, 11 Mar 2019 15:48:16 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.