NAME

HackaMol::Dihedral - Dihedral Angle class for HackaMol

VERSION

version 0.030

SYNOPSIS

use HackaMol::Atom;
use HackaMol::Dihedral;

my ($atom1,$atom4) = map {
                       Atom->new(
                          name    => "C".($_+1),
                          charges => [0],
                          coords  => [ V( $_, $_, 0) ],
                          Z       => 6, 
                       )} (-1, 1);

my ($atom2,$atom3) = map {
                       Atom->new(
                          name    => "S".($_+1),
                          charges => [0],
                          coords  => [ V( $_, 0, 0) ],
                          Z       => 16, 
                       )} (-1, 1);

my $dihe = HackaMol::Dihedral->new(name=>'disulfide', 
                                  atoms=>[$atom1,$atom2,$atom3,$atom4]);

my $pdihe = sprintf(
                "Dihedral: %s, angle: %.2f\n"
                $dihe->name, 
                $dihe->dihe_deg, 
);

print $pdihe;

my $COM_atom = HackaMol::Atom->new(
                                name    => "X".$_->name."X",
                                coords  => [ $dihe->COM ],
                                Z       => 1,
);

DESCRIPTION

The HackaMol Dihedral class provides a set of methods and attributes for working with three connections between four atoms. Like the HackaMol::Bond and HackaMol::Angle classes, the Dihedral class consumes the HackaMol::AtomGroupRole providing methods to determine the center of mass, total charge, etc. (see AtomGroupRole). A $dihedral containing (atom1,atom2,atom3,atom4) produces the angle ($dihedral->dihe_deg) between the planes containing (atom1, atom2, atom3) and (atom2, atom3, atom4).

The Dihedral class also provides attributes and methods to set parameters and functions to measure energy. The energy methods call on CodeRef attributes that the user may define. See descriptions below.

METHODS

dihe_deg

no arguments. returns the angle (degrees) between the planes containing (atom1,atom2,atom3) and (atom2, atom3, atom4).

dihe_rad

no arguments. returns the angle (radians) between the planes containing (atom1,atom2,atom3) and (atom2, atom3, atom4).

improper_dihe_energy

arguments, as many as you want. Calculates energy using the improper_dihe_efunc described below, if the attribute, dihe_fc > 0. The improper_dihe_energy method calls the improper_dihe_efunc as follows:

my $energy = &{$self->improper_dihe_efunc}($self,@_);

which will pass $self and that in @_ array to improper_dihe_efunc, which, similar to the Bond and Angle classes, can be redefined. torsion_energy is analogous.

torsion_energy

analogous to improper_dihe_energy

ATTRIBUTES

atoms

isa ArrayRef[Atom] that is lazy with public ARRAY traits provided by the AtomGroupRole (see documentation for more details).

name

isa Str that is lazy and rw. useful for labeling, bookkeeping...

dihe_dphase

isa Num that is lazy and rw. default = 0. phase shift for torsion potentials.

dihe_mult

isa Num that is lazy and rw. default = 0. multiplicity for torsion potentials.

dihe_fc

isa Num that is lazy and rw. default = 0. force constant for harmonic bond potentials.

dihe_eq

isa Num that is lazy and rw. default = 0. Equilibrium dihedral angle.

improper_dihe_efunc

isa CodeRef that is lazy and rw. default uses builder to generate a harmonic potential for the improper_dihedral and a torsion potential.

torsion_efunc

analogous to improper_dihe_efunc

SEE ALSO

EXTENDS

CONSUMES

AUTHOR

Demian Riccardi <demianriccardi@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Demian Riccardi.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.