NAME
HackaMol::Roles::MolReadRole - Read files with molecular information
VERSION
version 0.042
SYNOPSIS
use HackaMol;
my $hack = HackaMol->new( name => "hackitup" );
# build array of carbon atoms from pdb [xyz,pdbqt] file
my @carbons = grep {
$_->symbol eq "C"
} $hack->read_file_atoms("t/lib/1L2Y.pdb");
my $Cmol = HackaMol::Molecule->new(
name => "carbonprotein",
atoms => [ @carbons ]
);
$Cmol->print_pdb;
$Cmol->print_xyz;
# build molecule from xyz [pdb,pdbqt] file
my $mol = $hack->read_file_mol("some.xyz");
$mol->print_pdb; #
DESCRIPTION
The HackaMol::Role::MolReadRole role provides methods for reading common structural files. Currently, pdb, pdbqt, Z-matrix, and xyz are provided. The methods are all provided in separate roles. Adding additional formats is straightforward:
1. Add a Role that parses the file and returns a list of HackaMol::Atoms.
2. Add the code here to consume the role and call the method based on the file ending.
METHODS
read_file_atoms
one argument: the name of a file (.xyz, .pdb, .pdbqt, .zmat)
returns a list of HackaMol::Atom objects
read_string_atoms
two arguments: 1. a string with coordinates properly formatted; 2. format (xyz, pdb, pdbqt, zmat, yaml)
returns a list of HackaMol::Atom objects
ATTRIBUTES
hush_read
isa Int that is lazy (default 0). $hack->hush_read(1) will quiet some warnings that may be ignored under some instances. $hack->hush_read(-1) will increase info printed out for some warnings.
SEE ALSO
CONSUMES
AUTHOR
Demian Riccardi <demianriccardi@gmail.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2017 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.