Source for file Atom_PDB.php
Documentation is available at Atom_PDB.php
// +----------------------------------------------------------------------+
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Jesus M. Castagnetto <jmcastagnetto@php.net> |
// +----------------------------------------------------------------------+
require_once "Science/Chemistry/Atom.php" ;
* Represents a PDB atom record
* and contains a reference to the PDB residue to which it belongs
* @author Jesus M. Castagnetto <jmcastagnetto@php.net>
* @package Science_Chemistry
* PDB Atom record type, one of ATOM or HETATM
* PDB Atom alternative location
* PDB Atom's Residue name
* PDB Atom's Residue chain ID
* PDB Atom's Residue sequential numnber
* PDB Atom temperature factor
* PDB Atom segment identifier
* PDB Atom electronic charge
* If the atom object has been initialized
* Reference to the containing Residue object
* @var object Residue_PDB
// reference to containing residue
// process PDB atom record
// no error checking, assumes correct and standard record
$this->ser_num = (int) trim(substr($atomrec,6 ,5 ));
$this->res_seq_num = (int) trim(substr($atomrec,22 ,4 ));
$this->occupancy = (float) trim(substr($atomrec,54 ,6 ));
$this->temp_factor = (float) trim(substr($atomrec,60 ,6 ));
$this->charge = (float) trim(substr($atomrec,78 ,2 ));
// if no element is present, use the atom_name
$this->element = (preg_match('/^[A-Z]{1,2}/', $element)) ? $element : $this->atom_name;
// mapping needed so we follow both the PEAR
// variable naming convention, and the PDB
// standard field naming convention
"AtomName" => "atom_name",
"ResSeqNum" => "res_seq_num",
"Ocuppancy" => "ocuppancy",
"TempFactor" => "temp_factor",
"SegmentID" => "segment_id",
// for coordinates index mapping
$cmap = array ("X"=>0 , "Y"=>1 , "Z"=>2 );
$internal_name = $map[$field];
return $this->$internal_name;
return $this->xyz->coords [$index];
// vim: expandtab: ts=4: sw=4
Documentation generated on Mon, 11 Mar 2019 15:48:15 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|