How to use the lightdock.constants.DEFAULT_NMODES_LIG function in lightdock

To help you get started, we’ve selected a few lightdock examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github brianjimenez / lightdock / lightdock / util / parser.py View on Github external
dest="noh", action='store_true', default=False)
        # Verbose PDB parser
        parser.add_argument("--verbose_parser", help="PDB parsing verbose mode",
                            dest="verbose_parser", action='store_true', default=False)
        # Normal modes
        parser.add_argument("-anm", "--anm", help="Activates the use of ANM backbone flexibility",
                            dest="use_anm", action='store_true', default=False)
        # Normal modes extent seed
        parser.add_argument("--seed_anm", help="Random seed used in ANM intial extent",
                            dest="anm_seed", type=int, default=STARTING_NM_SEED)
        parser.add_argument("-anm_rec", "--anm_rec", help="Number of ANM modes for receptor", 
                            type=SetupCommandLineParser.valid_natural_number,
                            dest="anm_rec", default=DEFAULT_NMODES_REC)
        parser.add_argument("-anm_lig", "--anm_lig", help="Number of ANM modes for ligand", 
                            type=SetupCommandLineParser.valid_natural_number,
                            dest="anm_lig", default=DEFAULT_NMODES_LIG)
        # Restraints file
        parser.add_argument("-rst", "--rst", help="Restraints file", 
                            dest="restraints", type=CommandLineParser.valid_file,
                            metavar="restraints", default=None)
        # Membrane setup
        parser.add_argument("-membrane", "--membrane", help="Enables the extra filter for membrane restraints", 
                            dest="membrane", action='store_true', default=False)

        self.args = parser.parse_args()
github brianjimenez / lightdock / bin / post / lgd_local_minimization.py View on Github external
def calculate_scoring(optimization_vector):
    #print optimization_vector
    translation = optimization_vector[:3]
    rotation = optimization_vector[3:7]
    q = Quaternion(rotation[0], rotation[1], rotation[2], rotation[3])
    nm_ext_rec = optimization_vector[7:7+DEFAULT_NMODES_REC]
    nm_ext_lig = optimization_vector[-DEFAULT_NMODES_LIG:]
    receptor_pose, ligand_pose = move_molecules(translation, q, nm_ext_rec, nm_ext_lig)
    energy = -1. * scoring_function(adapters.receptor_model, receptor_pose, adapters.ligand_model, ligand_pose)
    print energy
    return energy
github brianjimenez / lightdock / bin / post / lgd_generate_conformations.py View on Github external
parser.add_argument("lightdock_output", help="lightdock output file",
                        type=CommandLineParser.valid_file, metavar="lightdock_output")
    # Number of glowworms
    parser.add_argument("glowworms", help="number of glowworms", type=CommandLineParser.valid_integer_number)
    # Optional, setup file
    parser.add_argument("--setup", "-setup", "-s", help="Simulation setup file",
                            dest="setup_file", metavar="setup_file", type=CommandLineParser.valid_file, 
                            default=None)

    args = parser.parse_args()

    # Load setup configuration if provided
    setup = get_setup_from_file(args.setup_file) if args.setup_file else None

    num_anm_rec = DEFAULT_NMODES_REC
    num_anm_lig = DEFAULT_NMODES_LIG
    if setup and setup['use_anm']:
        num_anm_rec = setup['anm_rec']
        num_anm_lig = setup['anm_lig']

    # Receptor
    structures = []
    for structure in get_lightdock_structures(args.receptor_structures):
        log.info("Reading %s receptor PDB file..." % structure)
        atoms, residues, chains = parse_complex_from_file(structure)
        structures.append({'atoms': atoms, 'residues': residues, 'chains': chains, 'file_name': structure})
        log.info("%s atoms, %s residues read." % (len(atoms), len(residues)))
    receptor = Complex.from_structures(structures)

    # Ligand
    structures = []
    for structure in get_lightdock_structures(args.ligand_structures):
github brianjimenez / lightdock / bin / post / lgd_generate_trajectory.py View on Github external
rec_extent = np.array([float(x) for x in coord[7:7+num_anm_rec]])
                        lig_extent = np.array([float(x) for x in coord[-num_anm_lig:]])
                    return translation, rotation, rec_extent, lig_extent
                num_glowworms += 1
    return None


if __name__ == "__main__":
    # Parse arguments
    args = parse_command_line()

    # Load setup configuration if provided
    setup = get_setup_from_file(args.setup_file) if args.setup_file else None

    num_anm_rec = DEFAULT_NMODES_REC
    num_anm_lig = DEFAULT_NMODES_LIG
    if setup and setup['use_anm']:
        num_anm_rec = setup['anm_rec']
        num_anm_lig = setup['anm_lig']
    
    # Read receptor
    log.info("Reading %s receptor PDB file..." % args.receptor_pdb)
    atoms, residues, chains = parse_complex_from_file(args.receptor_pdb)
    receptor = Complex(chains, atoms)
    log.info("%s atoms, %s residues read." % (len(atoms), len(residues)))
    
    # Read ligand
    log.info("Reading %s ligand PDB file..." % args.ligand_pdb)
    atoms, residues, chains = parse_complex_from_file(args.ligand_pdb)
    ligand = Complex(chains, atoms)
    log.info("%s atoms, %s residues read." % (len(atoms), len(residues)))
github brianjimenez / lightdock / bin / post / lgd_top.py View on Github external
type=CommandLineParser.valid_file, metavar="lightdock_ranking_file")
    # Number of structures to generate
    parser.add_argument("top", help="number of structures to generate", type=CommandLineParser.valid_integer_number,
                        metavar="top")
    # Optional, setup file
    parser.add_argument("--setup", "-setup", "-s", help="Simulation setup file",
                            dest="setup_file", metavar="setup_file", type=CommandLineParser.valid_file, 
                            default=None)

    args = parser.parse_args()

    # Load setup configuration if provided
    setup = get_setup_from_file(args.setup_file) if args.setup_file else None

    num_anm_rec = DEFAULT_NMODES_REC
    num_anm_lig = DEFAULT_NMODES_LIG
    if setup and setup['use_anm']:
        num_anm_rec = setup['anm_rec']
        num_anm_lig = setup['anm_lig']

    # Receptor
    structures = []
    for structure in get_lightdock_structures(args.receptor_structures):
        log.info("Reading %s receptor PDB file..." % structure)
        atoms, residues, chains = parse_complex_from_file(structure)
        structures.append({'atoms': atoms, 'residues': residues, 'chains': chains, 'file_name': structure})
        log.info("%s atoms, %s residues read." % (len(atoms), len(residues)))
    receptor = Complex.from_structures(structures)

    # Ligand
    structures = []
    for structure in get_lightdock_structures(args.ligand_structures):