Chemistry-Mol
view release on metacpan or search on metacpan
Tutorial.pod view on Meta::CPAN
print $atom->attr("pdb/residue_name"); # prints "ALA123"
=head1 Molecule subclasses
You can do lots of interesting thing with plain molecules. However, for some
applications you may want to extend the features of the main Chemistry::Mol
class. There are several subclasses of Chemistry::Mol available already:
=over
=item L<Chemistry::MacroMol>
Used for macromolecules.
=item L<Chemistry::Pattern>
Used for substructure matching.
=item L<Chemistry::Ring>
Used for representing rings (cycles) in molecules.
=item L<Chemistry::Reaction>
Used for representing and applying chemical transformations.
=back
As an example we'll discuss macromolecules. Future versions of this tutorial
may also include a discussion about patterns and rings.
=head1 Macromolecules
So far we have assumed that we are dealing with molecules of the
L<Chemistry::Mol> class. However, one of the interesting things about
object-oriented programming is that classes can be extended. For dealing with
macromolecules, we have the MacroMol class, which extends the L<Chemistry::Mol>
class. This means that in practice you can use a L<Chemistry::MacroMol> object
exactly as you would use a L<Chemistry::Mol> object, but with some added
functionality. In fact, the PDB reader can return L<Chemistry::MacroMol>
instead of L<Chemistry::Mol> objects just by changing the first example like
this:
use Chemistry::MacroMol;
use Chemistry::File::PDB;
my $macromol = Chemistry::MacroMol->read("test.pdb");
Now the question is, what is the "added functionality" that MacroMol objects
have on top of the original Chemistry::Mol object?
=head2 The MacroMol object
For the purposes of this module, a macromolecule is considered to be a big
molecule where atoms are divided in I<Domains>. A domain is just a subset of
the atoms in the molecule; in a protein, a domain would be just a residue.
You can select domains in a molecule in a way similar to that used for atoms
and bonds, in this case through the C<domains> method:
my @all_domains = $macromol->domains;
my $domain = $macromol->domains(57);
Tutorial.pod view on Meta::CPAN
0.38
=head1 SOURCE CODE REPOSITORY
L<https://github.com/perlmol/Chemistry-Mol>
=head1 SEE ALSO
L<Chemistry::Mol>, L<Chemistry::Atom>, L<Chemistry::Bond>, L<Chemistry::File>,
L<Chemistry::MacroMol>, L<Chemistry::Domain>.
=head1 AUTHOR
Ivan Tubert-Brohman E<lt>itub@cpan.orgE<gt>
=head1 COPYRIGHT
Copyright (c) 2005 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.
( run in 0.737 second using v1.01-cache-2.11-cpan-fd5d4e115d8 )