view release on metacpan or search on metacpan
VERSION 0.011
=============
please see *[HackaMol::X::Vina on MetaCPAN](https://metacpan.org/release/DEMIAN/HackaMol-X-Vina-0.01) for formatted documentation.
SYNOPSIS
============
```perl
use Modern::Perl;
use HackaMol;
use HackaMol::X::Vina;
use Math::Vector::Real;
my $receptor = "receptor.pdbqt";
my $ligand = "lig.pdbqt",
my $rmol = HackaMol -> new( hush_read=>1 ) -> read_file_mol( $receptor );
my $lmol = HackaMol -> new( hush_read=>1 ) -> read_file_mol( $ligand );
my $fh = $lmol->print_pdb("lig_out.pdb");
examples/stage1_setup/centers/FTMAP/deprecated/collect_nodes.pl view on Meta::CPAN
use Modern::Perl;
use HackaMol;
my $root = shift or die "pass root of glob in FTMaps/";
my @pdbs = glob("FTMaps/$root*.pdb");
my $hack = HackaMol->new;
my $mol = HackaMol::Molecule->new;
foreach my $k (0 .. $#pdbs){
system("perl scripts/pull_bs_ftmap.pl $pdbs[$k] > $k.xyz");
examples/stage1_setup/centers/FTMAP/deprecated/pull_bs_ftmap.pl view on Meta::CPAN
#
# This dum script will:
#
# 1. write them all out into temporary xyz files
# 2. read them in and print out the COM of the cluster
# 3. unlink the temporary xyz file
#
# need to use xyz file, because FTMap does not write a proper PDB
# may need a dirty pdb reader
#
use Modern::Perl;
use HackaMol;
use File::Temp qw/ tempfile tempdir mkstemps/;
use File::chdir;
use FileHandle;
use Data::Dumper;
die "pass file (Str) [cluster size cutoff (Int)]\n" unless @ARGV ;
my $file = shift;
my $nclst = shift || 0;
examples/stage1_setup/centers/FTMAP/deprecated/reduce_bs_kirchoff.pl view on Meta::CPAN
#
# the clusters generated using pull_bs_ftmap.pl were often overlapping to
# some degree. This script will collapse them down using a kirchoff matrix:
# 1. load up molecule from xyz file
# 2. calculate the kirchoff
# 3. sort by diagonal (big to small)
# 4. delete biggest cluster (all those connected to the biggest node)
# ... repeat 2 .. 4 until the molecule has no atoms
#
use Modern::Perl;
use HackaMol;
my $hack = HackaMol->new;
my $mol = $hack->read_file_mol(shift);
my $cut = 10;
my $cut2 = $cut*$cut;
my @mols;
while ($mol->count_atoms){
examples/stage1_setup/centers/FTMAP/kmeans_bs_ftmap.pl view on Meta::CPAN
# if you process the ftmap pdbs and lose these separations, you'll have to work up another solution
# to pulling all the FTMAP small molecule binders into a set of Math::Vector::Real.
#
# arguments:
# 1. Str to find pdbs to use
# 2. Num cutoff for separation between sites.
#
# The initial number of clusters is set at 20. This is decremented until all clusters
# are >= cutoff separation.
#
use Modern::Perl;
use HackaMol;
use FileHandle;
use Modern::Perl;
use Math::Vector::Real;
use Math::Vector::Real::kdTree;
use Math::Vector::Real::Neighbors;
use YAML::XS;
die "pass Str cutoff\n" unless @ARGV ;
my $regex = shift;
my $rcut = shift || 7.5;
my @files = glob("$regex*.pdb");
examples/stage1_setup/centers/centers_append.pl view on Meta::CPAN
# Demian Riccardi May 15, 2014
#
# takes centers stored in xyz files and drops them into a yaml
# for more convenient use
use Modern::Perl;
use HackaMol;
use YAML::XS qw(LoadFile DumpFile);
my $hack = new HackaMol;
my $centers = LoadFile('centers.yaml');
foreach my $xyz ( glob ("*.xyz") ){
my ($key) = split ("_", $xyz);
my @centers = map{ [ @{ $_->xyz } ] } $hack->read_file_atoms($xyz);
examples/stage1_setup/centers/centers_gen.pl view on Meta::CPAN
# Demian Riccardi May 15, 2014
#
# takes centers stored in xyz files and drops them into a yaml
# for more convenient use
use Modern::Perl;
use HackaMol;
use YAML::XS qw(DumpFile);
my $hack = new HackaMol;
my %centers;
foreach my $xyz ( glob ("*.xyz") ){
my ($key) = split ("_", $xyz);
my @centers = map{ [ @{ $_->xyz } ] } $hack->read_file_atoms($xyz);
examples/stage1_setup/setup_ligands_sets.pl view on Meta::CPAN
#!/usr/bin/env perl
# wget http://autodock.scripps.edu/local_files/screening/NCI-Diversity-AutoDock-0.2.tar.gz
# setup subsets of json files keyed by ligand for virtual screens of receptors and centers
use Modern::Perl;
use HackaMol;
use Time::HiRes qw(time);
use JSON::XS;
use Array::Split qw(split_by);
my $dockem = HackaMol->new(
hush_read => 1,
data => 'NCI_diversitySet2/pdbqt',
scratch => "some/different/otherpath/ligands/NCI_diversitySet2",
);
examples/stage1_setup/setup_ligands_sets_mce.pl view on Meta::CPAN
#!/usr/bin/env perl
# Demian Riccardi, June 6, 2014
#
# Store the json databases by ligand
# see setup_receptors_sets_mce.pl to store by ligand
#
# pull down some pdbs:
# wget http://autodock.scripps.edu/local_files/screening/NCI-Diversity-AutoDock-0.2.tar.gz
# use MCE to set up the subsets faster
use Modern::Perl;
use HackaMol;
use Time::HiRes qw(time);
use MCE::Loop max_workers => 8, chunk_size => 1;
use MCE::Subs qw( :worker );
use JSON::XS qw(encode_json);
use Array::Split qw(split_by);
my $t1 = time;
my $dockem = HackaMol->new(
hush_read => 1,
examples/stage1_setup/setup_receptors_sets_mce.pl view on Meta::CPAN
# Demian Riccardi, June 6, 2014
#
# Store the json databases by receptor
# see setup_ligands_sets_mce.pl to store by ligand
#
use Modern::Perl;
use HackaMol;
use Time::HiRes qw(time);
use MCE::Loop max_workers => 12, chunk_size => 1;
use MCE::Subs qw( :worker );
use JSON::XS qw(encode_json);
use Array::Split qw(split_by);
my $t1 = time;
my $dockem = HackaMol->new(
hush_read => 1,
examples/stage2_docking/PBS_screens/broadcast.pl view on Meta::CPAN
use Modern::Perl;
use PBS::Client;
use Path::Tiny;
use YAML::XS qw(DumpFile LoadFile Load Dump);
my $yaml = LoadFile(shift);
my $istart = shift || 0;
my $data = path($yaml->{data});
my $scratch = path($yaml->{scratch});
$scratch->mkpath unless ($scratch->exists);
examples/stage2_docking/PBS_screens/ligands_dock.pl view on Meta::CPAN
#
# if using pbs, this information will dump into the .e and .o files (.o todo: dock_accumulator.pl)
#
# JSON: This script will write to a temporary file incremented complete json hash for each ligand.
# this is different than the json file loaded, which is one hash keyed by ligand! The temporary
# file is writted so that if the run is terminated, the data won't be lost. To convert the temp
# file to the out_json file, you have to convert something like {liga}{ligb}{ligc}{ligd} to
# {liga=>{}, ligb=>{}, ...} but be careful if merging with data rich json files (so you don't
# lose data)... i.e. backup.
#
use Modern::Perl;
use HackaMol;
use HackaMol::X::Vina;
use Math::Vector::Real;
use YAML::XS qw(Dump LoadFile);
use Time::HiRes qw(time);
use Path::Tiny;
use File::Slurp;
use JSON::XS;
my $tp1 = time;
examples/stage2_docking/PBS_screens/ssCenters_receptors_dock.pl view on Meta::CPAN
#
# if using pbs, this information will dump into the .e and .o files (.o todo: dock_accumulator.pl)
#
# JSON: This script will write to a temporary file incremented complete json hash for each ligand.
# this is different than the json file loaded, which is one hash keyed by ligand! The temporary
# file is writted so that if the run is terminated, the data won't be lost. To convert the temp
# file to the out_json file, you have to convert something like {liga}{ligb}{ligc}{ligd} to
# {liga=>{}, ligb=>{}, ...} but be careful if merging with data rich json files (so you don't
# lose data)... i.e. backup.
#
use Modern::Perl;
use HackaMol;
use HackaMol::X::Vina;
use Math::Vector::Real;
use YAML::XS qw(Dump LoadFile);
use Time::HiRes qw(time);
use Path::Tiny;
use File::Slurp;
use JSON::XS;
my $tp1 = time;
examples/stage3_analysis/load_json.pl view on Meta::CPAN
use Modern::Perl;
use YAML::XS qw(Load Dump);
use JSON::XS;
use File::Slurp;
my $json_fn = shift;
my $text = read_file( $json_fn, { binmode => ':raw' } );
my $json = new JSON::XS;
$json->incr_parse($text);
my $stor = $json->incr_parse;
examples/stage3_analysis/load_print_pdb.pl view on Meta::CPAN
# Demian Riccardi May 22, 2014
#
# This script prints dumps the results and pdb of receptor+ligand
# from the output generated from ligands_dock.pl.
#
use Modern::Perl;
use HackaMol;
use YAML::XS qw(LoadFile Dump);
use Math::Vector::Real;
my $output = LoadFile(shift);
print Dump $output;
exit unless (exists($output->{Zxyz}));
examples/utilities/json_to_stor.pl view on Meta::CPAN
use Modern::Perl;
use JSON::XS;
use Storable;
use File::Slurp;
die "pass in.json out.stor " unless (@ARGV == 2);
my $json = read_file( shift, { binmode => ':raw' } );
my $db = new JSON::XS;
$db->incr_parse($json);
$db->incr_parse;
examples/utilities/merge_TMPS.pl view on Meta::CPAN
# new struct is appended to file with each loop. It is a little inconvenient
# because the datastructure has to be adjusted slightly (wrap the TMPJSON in {}).
#
# sometimes you have to kill your runs and are left with these TMP files with useful
# stuff in them. This script takes merges them in. I wrote this for a receptor based
# run, but I think it should work for ligand based too.
#
# Back up your stuff when using. please use with care; you have to know your paths to use this.
#
use Modern::Perl;
use YAML::XS qw(Load Dump);
use JSON::XS;
use HackaMol;
use File::Slurp;
use Path::Tiny;
use Hash::Merge qw(merge);
use Math::Vector::Real;
my @jsons = @ARGV;
examples/utilities/merge_dbs.pl view on Meta::CPAN
# Demian Riccardi, June 6, 2014
#
# Here is a script to use to merge the dbs
#
# this one is pretty straightforward. Hash::Merge gives left precendence when merging hashes
# i.e. the left is untouched, and the right is woven into unique entries if free.
#
# Back up your stuff when using. please use with care; you have to know your paths to use this.
#
use Modern::Perl;
use Hash::Merge qw(merge);
use JSON::XS;
use Path::Tiny;
use File::Slurp;
my $path = "/some/path/receptors/dbs/";
foreach my $fn_json (glob("*.json")){
my $fn_orig = $fn_json;
examples/utilities/stor_to_json.pl view on Meta::CPAN
use Modern::Perl;
use JSON::XS;
use Storable;
use File::Slurp;
die "pass in.stor out.json " unless (@ARGV == 2);
my $db = retrieve(shift);
write_file (shift, encode_json $db);
lib/HackaMol/X/Vina.pm view on Meta::CPAN
=head1 NAME
HackaMol::X::Vina - HackaMol extension for running Autodock Vina
=head1 VERSION
version 0.012
=head1 SYNOPSIS
use Modern::Perl;
use HackaMol;
use HackaMol::X::Vina;
use Math::Vector::Real;
my $receptor = "receptor.pdbqt";
my $ligand = "lig.pdbqt",
my $rmol = HackaMol -> new( hush_read=>1 ) -> read_file_mol( $receptor );
my $lmol = HackaMol -> new( hush_read=>1 ) -> read_file_mol( $ligand );
my $fh = $lmol->print_pdb("lig_out.pdb");