HackaMol-X-Vina

 view release on metacpan or  search on metacpan

examples/stage1_setup/setup_ligands_sets.pl  view on Meta::CPAN

    my $fname = sprintf("set_%03d.json",$i);
    my $json = $dockem->scratch->child($fname);
    my $fh = $json->openw_raw;
    my $stor;
    foreach my $lig ( @{ $jobs[$i] } ){
  
      my $mol = $dockem->read_file_mol($lig);
      $stor->{$lig->basename('.pdbqt')} = {
                                                BEST    => { BE => 0 },
                                                TMass   => $mol->total_mass,
                                                formula => $mol->bin_atoms_name, 
                                                lpath   => $lig->stringify,
      };
    }
    print $fh encode_json $stor; 

}

examples/stage1_setup/setup_ligands_sets_mce.pl  view on Meta::CPAN

  my $i   = $_;
  my $fname = sprintf("set_%03d.json",$i); 
  my $json = $dockem->scratch->child($fname);
  my $fh = $json->openw_raw;
  my $stor;
  foreach my $lig (@{$jobs[$i]}){
    my $mol = $dockem->read_file_mol($lig);
    $stor->{$lig->basename('.pdbqt')} = {
                                          BEST    => { BE => 0 },
                                          TMass   => $mol->total_mass,
                                          formula => $mol->bin_atoms_name, 
                                          lpath   => $lig->stringify,
    };
  } 
  print $fh encode_json $stor;
} 0, $#jobs;

my $t2 = time;
printf ("%5.4f\n", $t2-$t1);

examples/stage1_setup/setup_receptors_sets_mce.pl  view on Meta::CPAN

  my $i   = $_;
  my $fname = sprintf("set_%03d.json",$i); 
  my $json = $dockem->scratch->child($fname);
  my $fh = $json->openw_raw;
  my $stor;
  foreach my $rec (@{$jobs[$i]}){
    my $mol = $dockem->read_file_mol($rec);
    $stor->{$rec->basename('.pdbqt')} = {
                                          BEST    => { BE => 0 },
                                          TMass   => $mol->total_mass/1000,
                                          formula => $mol->bin_atoms_name, 
                                          rpath   => $rec->stringify,
    };
  } 
  print $fh encode_json $stor;
} 0, $#jobs;

my $t2 = time;
printf ("%5.4f\n", $t2-$t1);

examples/stage2_docking/PBS_screens/ligands_dock.pl  view on Meta::CPAN

# Demian Riccardi May 20, 2014
#
# This script is for running virtual screens using Autodock Vina.  This is a work in
# progress...  Eventually, the functionality will be encapsulated in a class for screening.
# Obviously, this needs to be reworked to use a proper database!
#
# INPUT:
#   this script reads in a YAML configuration file passed on commandline:
#   $yaml->{in_json} is the path to the json file containing independent data
#   for each ligand. The first run, there will be no docking information present.
#   The json file will contain the ligand information (TMass, formula, BEST => {BE = 0},
#   etc. ). This script iterates (see JSON::XS on metacpan) through this json loaded by 
#   ligand and running the centers and receptors from the YAML configuration file.  
#
#   You are encouraged load the json file and then dump it with YAML early and often
#   to get oriented with the datastructure.
#
#   The set of centers are assumed to correspond to the set of receptors! 
#   e.g. two receptors with very different coordinates (translation) should have two
#        different sets of centers.
#

examples/stage2_docking/PBS_screens/ligands_dock.pl  view on Meta::CPAN

        }
    }
    #best overall
    if ( $stor->{BEST}{BE} > $stor->{$lig}{BEST}{BE} ) {
         $stor->{BEST}{BE}       = $stor->{$lig}{BEST}{BE};
         $stor->{BEST}{COM}      = $stor->{$lig}{BEST}{COM};
         $stor->{BEST}{Zxyz}     = $stor->{$lig}{BEST}{Zxyz}     if (exists($stor->{$lig}{BEST}{Zxyz})); 
         $stor->{BEST}{NeighRes} = $stor->{$lig}{BEST}{NeighRes} if (exists($stor->{$lig}{BEST}{NeighRes})); 
         $stor->{BEST}{ligand}   = $lig;
         $stor->{BEST}{TMass}    = $stor->{$lig}{TMass};
         $stor->{BEST}{formula}  = $stor->{$lig}{formula};
         $stor->{BEST}{receptor} = $stor->{$lig}{BEST}{receptor};
         $stor->{BEST}{center}   = $stor->{$lig}{BEST}{center};
         $stor->{BEST}{lpath}    = $stor->{$lig}{BEST}{lpath};
         $stor->{BEST}{rpath}    = $stor->{$lig}{BEST}{rpath};
    }
    print $fh encode_json { $lig => $stor->{$lig} };
    printf STDERR ("BEST this run for %15s = %5.1f\n", $lig, $best_today);
    #$hack->log_fn->append( encode_json $stor );
}

examples/stage2_docking/PBS_screens/ssCenters_receptors_dock.pl  view on Meta::CPAN

# Demian Riccardi May 20, 2014
#
# This script is for running virtual screens using Autodock Vina.  This is a work in
# progress...  Eventually, the functionality will be encapsulated in a class for screening.
# Obviously, this needs to be reworked to use a proper database!
#
# INPUT:
#   this script reads in a YAML configuration file passed on commandline:
#   $yaml->{in_json} is the path to the json file containing independent data
#   for each receptor. The first run, there will be no docking information present.
#   The json file will contain the receptor information (TMass(kD), formula, BEST => {BE = 0},
#   etc. ). This script iterates (see JSON::XS on metacpan) through this json loaded by 
#   receptor and running the ligands from the YAML configuration file. The centers are   
#   determined on the fly!  the script below uses disulfid bonds, which was relevant for the 
#   HackaMol paper.
#
#   You are encouraged load the json file and then dump it with YAML early and often
#   to get oriented with the datastructure.
#
#   The num_modes will always be 1 for screens; i don't see the point (yet) of additional 
#   configs for virtual screens.  Need a different script to run with num_modes>1 

examples/stage2_docking/PBS_screens/ssCenters_receptors_dock.pl  view on Meta::CPAN

        }
    }
    #best overall
    if ( $stor->{BEST}{BE} > $stor->{$rec}{BEST}{BE} ) {
         $stor->{BEST}{BE}       = $stor->{$rec}{BEST}{BE};
         $stor->{BEST}{COM}      = $stor->{$rec}{BEST}{COM};
         $stor->{BEST}{Zxyz}     = $stor->{$rec}{BEST}{Zxyz}     if (exists($stor->{$rec}{BEST}{Zxyz})); 
         $stor->{BEST}{NeighRes} = $stor->{$rec}{BEST}{NeighRes} if (exists($stor->{$rec}{BEST}{NeighRes})); 
         $stor->{BEST}{receptor}   = $rec;
         $stor->{BEST}{TMass}    = $stor->{$rec}{TMass};
         $stor->{BEST}{formula}  = $stor->{$rec}{formula};
         $stor->{BEST}{ligand} = $stor->{$rec}{BEST}{ligand};
         $stor->{BEST}{center}   = $stor->{$rec}{BEST}{center};
         $stor->{BEST}{lpath}    = $stor->{$rec}{BEST}{lpath};
         $stor->{BEST}{rpath}    = $stor->{$rec}{BEST}{rpath};
    }
    print $fh encode_json { $rec => $stor->{$rec} };
    printf STDERR ("BEST this run for %15s = %5.1f\n", $rec, $best_today);
    #$hack->log_fn->append( encode_json $stor );
}



( run in 0.281 second using v1.01-cache-2.11-cpan-26ccb49234f )