Exemple #1
0
        def __call__(self, pars, namespace, values, option_string=None):

            pro = Protein(values)
            # print the QUBE general FF to use in the parametrisation
            qube_general()
            # now we want to add the connections and parametrise the protein
            XMLProtein(pro)

            # finally we need the non-bonded parameters from onetep
            # TODO should we also have the ability to get DDEC6 charges from the cube file?
            pro.charge = 0
            pro.charges_engine = "onetep"
            pro.density_engine = "onetep"

            ExtractChargeData(pro).extract_charge_data()
            LennardJones(pro).calculate_non_bonded_force()

            # Write out the final parameters
            printf("Writing pdb file with connections...")
            pro.write_pdb(name=f"QUBE_pro_{pro.name}")
            printf("Writing XML file for the system...")
            pro.write_parameters(name=f"QUBE_pro_{pro.name}")
            # now remove the qube general file
            os.remove("QUBE_general_pi.xml")
            printf("Done")
            sys.exit()
Exemple #2
0
        def __call__(self, pars, namespace, values, option_string=None):
            """This function is executed when build is called."""

            pro = Protein(values)
            # print the QUBE general FF to use in the parametrisation
            qube_general()
            # now we want to add the connections and parametrise the protein
            XMLProtein(pro)
            # this updates the bonded info that is now in the object

            # finally we need the non-bonded parameters from onetep
            # fake configs as this will always be true
            # TODO should we also have the ability to get DDEC6 charges from the cube file?
            configs = [{'charge': 0}, {'charges_engine': 'onetep', 'density_engine': 'onetep'}, {}, {}]
            lj = LennardJones(pro, config_dict=configs)
            pro.NonbondedForce = lj.calculate_non_bonded_force()

            # now we write out the final parameters
            # we should also calculate the charges and lj at this point!
            printf('Writing pdb file with connections...')
            pro.write_pdb(name='QUBE_pro')
            printf('Writing XML file for the system...')
            pro.write_parameters(name='QUBE_pro', protein=True)
            # now remove the qube general file
            os.remove('QUBE_general_pi.xml')
            printf('Done')
            sys.exit()
Exemple #3
0
def test_protein_params(tmpdir):
    """
    Load up the small protein and make sure it is parametrised with the general qube forcefield.
    """
    with tmpdir.as_cwd():
        pro = Protein.from_file(file_name=get_data("capped_leu.pdb"))
        shutil.copy(get_data("capped_leu.pdb"), "capped_leu.pdb")
        XMLProtein(protein=pro)