GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
PDB(3) User Contributed Perl Documentation PDB(3)

Chemistry::File::PDB - Protein Data Bank file format reader/writer

    use Chemistry::File::PDB;

    # read a PDB file
    my $macro_mol = Chemistry::MacroMol->read("myfile.pdb");

    # write a PDB file
    $macro_mol->write("out.pdb");

    # read all models in a multi-model file
    my @mols = Chemistry::MacroMol->read("models.pdb");

    # read one model at a time
    my $file = Chemistry::MacroMol->file("models.pdb");
    $file->open;
    while (my $mol = $file->read_mol($file->fh)) {
        # do something with $mol
    }

This module reads and writes PDB files. The PDB file format is commonly used to describe proteins, particularly those stored in the Protein Data Bank (<http://www.rcsb.org/pdb/>). The current version of this module only reads the following record types, ignoring everything else:

    ATOM
    HETATM
    ENDMDL 
    END

This module automatically registers the 'pdb' format with Chemistry::Mol, so that PDB files may be identified and read by Chemistry::Mol->read(). For autodetection purpuses, it assumes that files ending in .pdb or having a line matching /^(ATOM |HETATM)/ are PDB files.

The PDB reader and writer is designed for dealing with Chemistry::MacroMol objects, but it can also create and use Chemistry::Mol objects by throwing some information away.

When reading and writing files, this module stores or gets some of the information in the following places:
$domain->type
The residue type, such as "ARG".
$domain->name
The type and sequence number, such as "ARG114".
$domain->attr("pdb/sequence_number")
The residue sequence number as given in the PDB file.
$domain->attr("pdb/chain_id")
The chain to which this residue belongs (one character).
$domain->attr("pdb/insertion_code")
The residue insertion code (see the PDB specification for details).
$atom->name
The PDB atom name, such as "CA".
$atom->attr("pdb/residue_name")
The name of the residue, as discussed above.
$atom->attr("pdb/serial_number")
The serial number for the atom, as given in the PDB file.

If some of this information is not available when writing a PDB file, this module tries to make it up (by counting the atoms or residues, for example). The default residue name for writing is UNK (unknown). Atom names are just the atomic symbols.

If a PDB file has multiple models (separated by END or ENDMDL records), each call to read_mol will return one model.

On writing Chemistry::Mol objects, which don't have macromolecule information and usually don't have atom names, the atom names are made up by concatenating the atomic symbol with a unique ID (up to 1296 atoms are possible). The ID can be disabled by setting the option 'noid':

    $mol->write("out.pdb", noid => 1);

The molecule's name is written as a HEADER record; A REMARK record is added listing the version of Chemistry::File::PDB that was used.

0.23

Chemistry::MacroMol, Chemistry::Mol, Chemistry::File, <http://www.perlmol.org/>.

The PDB format description at <http://www.rcsb.org/pdb/docs/format/pdbguide2.2/guide2.2_frame.html>

There is another PDB reader in Perl, as part of the BioPerl project: Bio::Structure::IO::pdb.

Ivan Tubert-Brohman <itub@cpan.org>

Copyright (c) 2009 Ivan Tubert-Brohman. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
2009-05-10 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.