HackaMol::Roles::MolReadRole - Read files with molecular information
version 0.040
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; #
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.
one argument: the name of a file (.xyz, .pdb, .pdbqt, .zmat)
returns a list of HackaMol::Atom objects
two arguments: 1. a string with coordinates properly formatted; 2. format (xyz, pdb, pdbqt, zmat, yaml)
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.
HackaMol
HackaMol::Roles::ReadXyzRole
HackaMol::Roles::ReadPdbRole
HackaMol::Roles::ReadPdbqtRole
HackaMol::Roles::ReadZmatRole
HackaMol::Atom
HackaMol::Molecule
HackaMol::Roles::NERFRole
HackaMol::Roles::ReadYAMLRole
Demian Riccardi <demianriccardi@gmail.com>
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.
To install HackaMol, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HackaMol
CPAN shell
perl -MCPAN -e shell install HackaMol
For more information on module installation, please visit the detailed CPAN module installation guide.