HackaMol

 view release on metacpan or  search on metacpan

examples/MolAdjust/readpdb_select_write.pl  view on Meta::CPAN

#!/usr/bin/env perl
# DMR April 9, 2014
#   
#   perl readpdb_select_write.pl some.pdb   
#
# reads pdb (via shift of @ARGV) 
# prints a selection to STDOUT
#
# useful for overlaying visualizations with general selections in VMD
# or whatever. All accomplished without creating any variables to show
# some object method chaining. 
#

use Modern::Perl;
use HackaMol;

HackaMol::Molecule -> new (
    atoms=>[
            grep {
                   $_->name eq "N"  or
                   $_->name eq "O"  or
                   $_->name eq "C"  or
                   $_->name eq "CA" or
                   $_->bfact > 0.25
                 } HackaMol -> new -> read_file_atoms(shift)
           ]
) -> print_pdb;



( run in 0.582 second using v1.01-cache-2.11-cpan-75ffa21a3d4 )