예제 #1
0
def run_docking(vina_program, vina_conf, receptor, path_ligand_pdbqt, path_struct, path_log):
    name_receptor = get_name_receptor(receptor)

    all_ligands = get_files_pdbqt(path_ligand_pdbqt)
    for ligand in all_ligands:
        name_ligand = pdbqt.get_name_ligand(ligand)
        f_out = os.path.join(path_struct, get_name_out(name_receptor, name_ligand))
        f_log = os.path.join(path_log, get_name_log(name_receptor, name_ligand))
        process = Popen(
            [
                vina_program,
                "--config",
                vina_conf,
                "--receptor",
                receptor,
                "--ligand",
                ligand,
                "--out",
                f_out,
                "--log",
                f_log,
            ],
            stdout=PIPE,
            stderr=PIPE,
        )
        stdout, stderr = process.communicate()
def build_database(database_path_file, pdbqt_path_file):
	line = ""
	f_database = open(database_path_file, 'w')
	line = str(";Ligand\t") + str("Torsion\t") + str("Atoms\t") + str("\n")
	f_database.write(line)
	all_pdbqt = pdbqt.get_files_pdbqt_no_sort(pdbqt_path_file)
	for f_pdbqt in all_pdbqt:
		ligand_name = pdbqt.get_name_ligand(f_pdbqt)
		torsion_angle = int(pdbqt.get_number_torsion_angle(f_pdbqt))
		atom_number = int(pdbqt.get_number_atom(f_pdbqt))
		line = ligand_name + str("\t")+ str(torsion_angle) + str("\t") + str(atom_number) + str("\n")
		f_database.write(line)

	f_database.close()
예제 #3
0
def run_docking(vina_program, vina_conf, receptor, path_ligand_pdbqt,
                path_struct, path_log):
    name_receptor = get_name_receptor(receptor)

    all_ligands = get_files_pdbqt(path_ligand_pdbqt)
    for ligand in all_ligands:
        name_ligand = pdbqt.get_name_ligand(ligand)
        f_out = os.path.join(path_struct,
                             get_name_out(name_receptor, name_ligand))
        f_log = os.path.join(path_log, get_name_log(name_receptor,
                                                    name_ligand))
        process = Popen([
            vina_program, '--config', vina_conf, '--receptor', receptor,
            '--ligand', ligand, '--out', f_out, '--log', f_log
        ],
                        stdout=PIPE,
                        stderr=PIPE)
        stdout, stderr = process.communicate()