Пример #1
0
    def test_create_setup_file(self):
        shutil.copyfile(os.path.join(self.golden_data_path, '2UUY_rec.pdb'), 
                        os.path.join(self.test_path, '2UUY_rec.pdb'))
        shutil.copyfile(os.path.join(self.golden_data_path, '2UUY_lig.pdb'), 
                        os.path.join(self.test_path, '2UUY_lig.pdb'))
        os.chdir(self.test_path)
        parser = SetupCommandLineParser(['2UUY_rec.pdb', '2UUY_lig.pdb', '5', '10', '-anm', '--noxt'])

        create_setup_file(parser.args)

        assert filecmp.cmp(os.path.join(self.test_path, 'setup.json'), 
                           os.path.join(self.golden_data_path, 'setup.json'))
Пример #2
0
                                      get_restraints
from lightdock.constants import DEFAULT_LIGHTDOCK_PREFIX, DEFAULT_ELLIPSOID_DATA_EXTENSION, \
                                DEFAULT_NMODES_REC, DEFAULT_REC_NM_FILE, DEFAULT_NMODES_LIG, DEFAULT_LIG_NM_FILE, DEFAULT_OUTPATH
from lightdock.mathutil.ellipsoid import MinimumVolumeEllipsoid
from lightdock.util.logger import LoggingManager
from lightdock.error.lightdock_errors import LightDockError

log = LoggingManager.get_logger('lightdock_setup')

if __name__ == "__main__":

    try:
        parser = SetupCommandLineParser()
        args = parser.args

        create_setup_file(args)

        # Read input structures
        receptor = read_input_structure(args.receptor_pdb, args.noxt, args.noh,
                                        args.verbose_parser)
        ligand = read_input_structure(args.ligand_pdb, args.noxt, args.noh,
                                      args.verbose_parser)

        # Move structures to origin
        rec_translation = receptor.move_to_origin()
        lig_translation = ligand.move_to_origin()

        # Calculate reference points for receptor
        log.info("Calculating reference points for receptor %s..." %
                 args.receptor_pdb)
        rec_ellipsoid = MinimumVolumeEllipsoid(
Пример #3
0
        lig_restraints = None
        try:
            lig_restraints = ligand_restraints['active'] + ligand_restraints['passive']
        except:
            pass

        # Calculate surface points (swarm centers) over receptor structure
        starting_points_files = calculate_starting_positions(receptor, ligand, 
                                                             args.swarms, args.glowworms, 
                                                             args.starting_points_seed,
                                                             rec_restraints, lig_restraints,
                                                             rec_translation, lig_translation,
                                                             args.ftdock_file, args.use_anm, args.anm_seed,
                                                             args.anm_rec, args.anm_lig, args.membrane)
        if len(starting_points_files) != args.swarms:
            args.swarms = len(starting_points_files)
            log.info('Number of swarms is %d after applying restraints' % args.swarms)

        # Create simulation folders
        prepare_results_environment(args.swarms)

        # Dump to a setup file the actual configuration
        create_setup_file(args)

        log.info("LightDock setup OK")

    except LightDockError, error:
        log.error("LightDock setup failed. Please see:")
        log.error(error)