def main():
    parser = argparse.ArgumentParser(description='Perform chunking in preparation for dynamic undocking')
    parser.add_argument('-p', '--protein', help='Apoprotein in PDB format')
    parser.add_argument('-l', '--ligand', help='Ligand in mol format')
    # parser.add_argument('-o', '--output', help="PDB output")
    parser.add_argument('-c', '--cutoff', type=float, help='Cutoff for chunk calculation')
    parser.add_argument('-b', '--ignore-buffers', action='store_true', help='Do not remove buffers (solvent, ions etc.)')
    parser.add_argument('-i', '--interaction', help='Protein atom to use for ligand interaction.')

    args = parser.parse_args()

    # A couple of file name
    orig_file = prot_file = args.protein
    chunk_protein = "protein_out.pdb"
    chunk_protein_prot = "protein_out_prot.pdb"
    # Do the removal of buffer mols and alt locs
    if not args.ignore_buffers:
        prot_file = remove_prot_buffers_alt_locs(prot_file)
    # Do the chunking and the protonation
    chunk_with_amber(
        args.ligand, prot_file, args.interaction, chunk_protein, args.cutoff, orig_file
    )
    # Protonate
    disulfides = find_disulfides(chunk_protein)
    do_tleap(chunk_protein, chunk_protein_prot, disulfides)
Пример #2
0
    def run(self):
        proasis_hit = ProasisHits.objects.get(crystal_name_id=self.crystal_id, refinement_id=self.refinement_id)

        tmp_file = remove_prot_buffers_alt_locs(self.input().path)
        shutil.move(os.path.join(os.getcwd(), tmp_file), self.output().path)

        proasis_out = ProasisOut.objects.filter(proasis=proasis_hit, ligid=ligid)
        for o in proasis_out:
            o.stripped = self.output().path.split('/')[-1]
            o.save()
Пример #3
0
def main(prot_file, mol_file, interaction, cutoff):
    # A couple of file name
    orig_file = prot_file
    chunk_protein = "protein_out.pdb"
    chunk_protein_prot = "protein_out_prot.pdb"
    # Do the removal of buffer mols and alt locs
    prot_file = remove_prot_buffers_alt_locs(prot_file)
    # Do the chunking and the protonation
    # Chunk
    chunk_with_amber(mol_file, prot_file, interaction, chunk_protein, cutoff,
                     orig_file)
    # Protontate
    disulfides = find_disulfides(chunk_protein)
    do_tleap(chunk_protein, chunk_protein_prot, disulfides)
Пример #4
0
 def run(self):
     proasis_hit = ProasisHits.objects.get(crystal_name_id=self.crystal_id,
                                           refinement_id=self.refinement_id,
                                           altconf=self.altconf)
     proasis_out = ProasisOut.objects.get(proasis=proasis_hit,
                                          crystal=proasis_hit.crystal_name,
                                          ligand=self.ligand,
                                          ligid=self.ligid)
     # remove altconfs and buffers from input and save to a temporary path defined by the function
     tmp_file = remove_prot_buffers_alt_locs(self.input().path)
     # move the tmp file to the output path
     shutil.move(os.path.join(os.getcwd(), tmp_file), self.output().path)
     # save the output file to proasis_out model
     proasis_out.stripped = self.output().path.split('/')[-1]
     proasis_out.save()
Пример #5
0
def test_prep(mol_file, prot_file):
    chunk_protein = "protein_out.pdb"
    chunk_protein_prot = "protein_out_prot.pdb"
    # Now it does the magic
    # Chunk
    removed = remove_prot_buffers_alt_locs(prot_file)
    chunk_with_amber(mol_file, removed, chunk_protein, 12)
    # Protontate
    do_tleap(chunk_protein, chunk_protein_prot)
    protein = parmed.load_file(chunk_protein_prot)
    protein.write_pdb("fixed.pdb")
    protein = parmed.load_file("fixed.pdb")["!(:HOH,NA,CL,SO4,EDO)"]
    forcefield_str = 'amber99sb.xml'
    forcefield = app.ForceField(forcefield_str)
    protein_system = forcefield.createSystem(protein.topology)
    protein_pmd = parmed.openmm.load_topology(protein.topology, protein_system,
                                              protein.positions)
Пример #6
0
def clean_up_prot(pdb_file):
    remove_prot_buffers_alt_locs(pdb_file)
Пример #7
0
def run_simulation(
    prot_file,
    mol_file,
    prot_code,
    prot_int,
    cutoff,
    init_velocity,
    num_smd_cycles,
    gpu_id,
    md_len,
    params,
):
    if not os.path.isfile("equil.chk"):
        # A couple of file name
        orig_file = prot_file
        chunk_protein = "protein_out.pdb"
        chunk_protein_prot = "protein_out_prot.pdb"
        # Do the removal of buffer mols and alt locs
        if params.get("remove_buffers", True):
            prot_file = remove_prot_buffers_alt_locs(prot_file)
        # Do the chunking and the protonation
        if params.get("prep_chunk", True):
            # Chunk
            chunk_with_amber(mol_file, prot_file, prot_int, chunk_protein,
                             cutoff, orig_file)
            # Protontate
            disulfides = find_disulfides(chunk_protein)
            do_tleap(chunk_protein, chunk_protein_prot, disulfides)
        else:
            chunk_protein_prot = prot_file
        # Paramaterize the ligand
        mol2_file = params.get("mol2_file_prepped", None)
        if not mol2_file:
            results = prep_lig(mol_file, prot_code)
            mol2_file = results[0]
        prepare_system(mol2_file, chunk_protein_prot)
        # Now find the interaction and save to a file
        results = find_interaction(prot_int, orig_file)
        startdist = params.get("distance", results[2])
        # Now do the equlibration
        do_equlibrate(gpu_id=gpu_id)
    else:
        # Now find the interaction and save to a file
        results = find_interaction(prot_int, prot_file)
        startdist = params.get("distance", results[2])
    # Open the file and check that the potential is stable and negative
    if not check_if_equlibrated("density.csv", 1):
        print("SYSTEM NOT EQUILIBRATED")
        sys.exit()
    if params.get("just_equilib", False):
        print("SYSTEM FENISHED EQULIBRATING")
        return
    # Now do the MD
    for i in range(num_smd_cycles):
        if i == 0:
            md_start = "equil.chk"
        else:
            md_start = "md_" + str(i - 1) + ".chk"
        log_file = "md_" + str(i) + ".csv"
        perform_md(
            md_start,
            "md_" + str(i) + ".chk",
            log_file,
            "md_" + str(i) + ".pdb",
            md_len=md_len,
            gpu_id=gpu_id,
        )
        # Open the file and check that the potential is stable and negative
        if not check_if_equlibrated(log_file, 3):
            print("SYSTEM NOT EQUILIBRATED")
            sys.exit()
        # Now find the interaction and save to a file
        run_steered_md(
            300,
            "md_" + str(i) + ".chk",
            "smd_" + str(i) + "_300.csv",
            "smd_" + str(i) + "_300.dat",
            "smd_" + str(i) + "_300.pdb",
            "smd_" + str(i) + "_300.dcd",
            startdist,
            init_velocity=init_velocity,
            gpu_id=gpu_id,
        )
        run_steered_md(
            325,
            "md_" + str(i) + ".chk",
            "smd_" + str(i) + "_325.csv",
            "smd_" + str(i) + "_325.dat",
            "smd_" + str(i) + "_325.pdb",
            "smd_" + str(i) + "_325.dcd",
            startdist,
            init_velocity=init_velocity,
            gpu_id=gpu_id,
        )