Exemplo n.º 1
0
def test_zinc_finger(tmp_path):

    gmx.show_log()
    ##################################
    # ##   Create the topologie:   ###
    ##################################
    prot = gmx.GmxSys(name='1jd4', coor_file=PDB_1JD4)
    prot.prepare_top(out_folder=os.path.join(tmp_path, 'top_DIAP1'),
                     vsite='hydrogens',
                     ignore_ZN=False)

    top_coor = pdb_manip.Coor(prot.coor_file)
    assert top_coor.num == 3292

    prot.switch_ion_octa_dummy()
    top_coor = pdb_manip.Coor(prot.coor_file)
    assert top_coor.num == 3304

    prot.solvate_add_ions(out_folder=os.path.join(tmp_path, 'top_sys'),
                          maxwarn=3)

    prot.em(out_folder=os.path.join(tmp_path, 'em_DIAP1'),
            nsteps=10,
            constraints='none')
    em_coor = pdb_manip.Coor(prot.coor_file)
    assert em_coor.num == 56366

    ener_pd = prot.get_ener(['Potential'])
    assert ener_pd['Potential'].values[-1] < -155000
Exemplo n.º 2
0
def test_set_protonate_amber(tmp_path):

    gmx.show_log()
    ##########################################
    # ##   Create the topologie at PH 4.0  ###
    ##########################################

    res_prot_dict = {
        'GLH': {
            'res_num': [9, 24, 31, 57]
        },
        'ASH': {
            'res_num': [3, 70]
        },
        'HIP': {
            'res_num': [28, 35]
        },
        'HID': {
            'res_num': [175]
        },
        'HIE': {
            'res_num': [214]
        }
    }

    prot = gmx.GmxSys(name='1RXZ_ph4', coor_file=PDB_1RXZ)
    prot.prepare_top(out_folder=os.path.join(tmp_path, 'top_1RXZ_ph4'),
                     ph=7.0,
                     res_prot_dict=res_prot_dict,
                     ff="amber99sb-ildn")
    top_coor = pdb_manip.Coor(prot.coor_file)
    assert top_coor.num == 4081

    top_1RXZ = gmx.TopSys(prot.top_file)
    assert top_1RXZ.charge() == -4
Exemplo n.º 3
0
def test_cys_bond_charmm(tmp_path):

    gmx.show_log()
    ##################################
    # ##   Create the topologie:   ###
    ##################################
    prot = gmx.GmxSys(name='1dpx', coor_file=PDB_1DPX)
    prot.prepare_top(out_folder=os.path.join(tmp_path, 'top_DISU'),
                     vsite='hydrogens',
                     ignore_ZN=False)

    top_coor = pdb_manip.Coor(prot.coor_file)
    assert top_coor.num == 2096

    prot.solvate_add_ions(out_folder=os.path.join(tmp_path, 'top_sys'),
                          maxwarn=3)

    prot.em(out_folder=os.path.join(tmp_path, 'em_DISU'),
            nsteps=10,
            constraints='none')
    em_coor = pdb_manip.Coor(prot.coor_file)
    assert em_coor.num == 27086

    cystein_s_index = em_coor.get_index_selection({
        'name': ['SG'],
        'res_name': ['CYS']
    })

    distance = pdb_manip.Coor.atom_dist(em_coor.atom_dict[cystein_s_index[0]],
                                        em_coor.atom_dict[cystein_s_index[-1]])
    assert distance < 2.1
Exemplo n.º 4
0
def test_insert_ethanol(tmp_path):

    gmx.show_log()
    ##################################
    # ##   Create the topologie:   ###
    ##################################
    prot = gmx.GmxSys(name='1y0m', coor_file=PDB_1Y0M)
    prot.prepare_top(out_folder=os.path.join(tmp_path, 'top_SH3'))
    top_coor = pdb_manip.Coor(prot.coor_file)
    assert top_coor.num == 996

    prot.solvate_add_ions(out_folder=os.path.join(tmp_path, 'top_sys'))

    prot.em(out_folder=os.path.join(tmp_path, 'em_SH3'),
            nsteps=10,
            constraints='none')
    em_coor = pdb_manip.Coor(prot.coor_file)
    assert em_coor.num == 15383

    ener_pd = prot.get_ener(['Potential'])
    assert ener_pd['Potential'].values[-1] < -155000

    ###################################
    # ###   Create Ethanol system   ###
    ###################################
    smile = 'CCO'
    eth_pdb = os.path.join(tmp_path, 'ethanol.pdb')
    charge = ambertools.smile_to_pdb(smile, eth_pdb, 'ETH')

    assert charge == 0

    eth_sys = gmx.GmxSys(name='ETH', coor_file=eth_pdb)
    eth_sys.prepare_top_ligand(out_folder=os.path.join(tmp_path, 'eth_top'),
                               ff='amber99sb-ildn',
                               include_mol={'ETH': smile})

    eth_sys.create_box(name=None, dist=0.5)

    ####################################################
    # # Insert 4 copy of ethanol in  the SH3 system: ###
    ####################################################

    prot.insert_mol_sys(mol_gromacs=eth_sys,
                        mol_num=10,
                        new_name='SH3_ETH',
                        out_folder=os.path.join(tmp_path, 'top_ETH_SH3'))
    ################################
    # ##   Minimize the system   ###
    ################################
    prot.em_2_steps(out_folder=os.path.join(tmp_path, 'em_ETH_SH3'),
                    no_constr_nsteps=10,
                    constr_nsteps=10)
    prot_lig_coor = pdb_manip.Coor(prot.coor_file)
    assert 15300 < prot_lig_coor.num < 15518

    prot.display_history()
Exemplo n.º 5
0
def test_insert_peptide_vsite(tmp_path):

    gmx.show_log()
    ##################################
    # ##   Create the topologie:   ###
    ##################################
    prot = gmx.GmxSys(name='1y0m', coor_file=PDB_1Y0M)
    prot.prepare_top(out_folder=os.path.join(tmp_path, 'top_SH3'),
                     vsite='hydrogens')
    top_coor = pdb_manip.Coor(prot.coor_file)
    assert top_coor.num == 1064

    prot.solvate_add_ions(out_folder=os.path.join(tmp_path, 'top_sys'))

    prot.em(out_folder=os.path.join(tmp_path, 'em_SH3'),
            nsteps=10,
            constraints='none')
    em_coor = pdb_manip.Coor(prot.coor_file)
    assert em_coor.num == 15337

    ener_pd = prot.get_ener(['Potential'])
    assert ener_pd['Potential'].values[-1] < -155000

    ###################################
    # ##    Create a DD peptide     ###
    ###################################
    pep = gmx.GmxSys(name='DD')
    pep.create_peptide(sequence='DD',
                       out_folder=os.path.join(tmp_path, 'top_DD'),
                       em_nsteps=10,
                       equi_nsteps=0,
                       vsite='hydrogens')

    ####################################################
    # # Insert 4 copy of ethanol in  the SH3 system: ###
    ####################################################

    prot.insert_mol_sys(mol_gromacs=pep,
                        mol_num=10,
                        new_name='SH3_DD',
                        out_folder=os.path.join(tmp_path, 'top_DD_SH3'))
    ################################
    # ##   Minimize the system   ###
    ################################
    prot.em_2_steps(out_folder=os.path.join(tmp_path, 'em_DD_SH3'),
                    no_constr_nsteps=10,
                    constr_nsteps=10)
    prot_lig_coor = pdb_manip.Coor(prot.coor_file)
    assert 15300 < prot_lig_coor.num < 15518

    prot.display_history()
Exemplo n.º 6
0
def test_protonate_ph4_7_amber(tmp_path):

    gmx.show_log()
    ##########################################
    # ##   Create the topologie at PH 4.0  ###
    ##########################################
    prot = gmx.GmxSys(name='1RXZ_ph4', coor_file=PDB_1RXZ)
    prot.prepare_top(out_folder=os.path.join(tmp_path, 'top_1RXZ_ph4'),
                     ph=4.0,
                     ff="amber99sb-ildn")
    top_coor = pdb_manip.Coor(prot.coor_file)
    top_1RXZ = gmx.TopSys(prot.top_file)

    if (version.parse(pdb2pqr.__version__) < version.parse("3.5")):
        assert top_coor.num == 4107
        assert top_1RXZ.charge() == 22
    else:
        assert top_coor.num == 4106
        assert top_1RXZ.charge() == 21

    ##########################################
    # ##   Create the topologie at PH 7.0  ###
    ##########################################
    prot = gmx.GmxSys(name='1RXZ_ph7', coor_file=PDB_1RXZ)
    prot.prepare_top(out_folder=os.path.join(tmp_path, 'top_1RXZ_ph7'),
                     ph=7.0,
                     ff="amber99sb-ildn")
    top_coor = pdb_manip.Coor(prot.coor_file)
    assert top_coor.num == 4073

    top_1RXZ = gmx.TopSys(prot.top_file)
    assert top_1RXZ.charge() == -12

    ##########################################
    # ##   Create the topologie at PH 10.0 ###
    ##########################################
    # Remark: Amber allow lysine unprotonated
    prot = gmx.GmxSys(name='1RXZ_ph10', coor_file=PDB_1RXZ)
    prot.prepare_top(out_folder=os.path.join(tmp_path, 'top_1RXZ_ph10'),
                     ph=10.0,
                     ff="amber99sb-ildn")
    top_coor = pdb_manip.Coor(prot.coor_file)
    assert top_coor.num == 4071

    top_1RXZ = gmx.TopSys(prot.top_file)
    assert top_1RXZ.charge() == -14
Exemplo n.º 7
0
def test_insert_peptide_vsite(tmp_path):
    # Gromacs verions >= 2021 support cyclic peptides

    gmx.show_log()

    cyclic_pep = gmx.GmxSys(name='5vav', coor_file=PDB_5VAV)

    top_coor = pdb_manip.Multi_Coor(cyclic_pep.coor_file)
    assert top_coor.coor_list[0].num == 209

    cyclic_pep.cyclic_peptide_top(
        out_folder=os.path.join(tmp_path, 'cyclic/top'))

    top_coor = pdb_manip.Coor(cyclic_pep.coor_file)
    assert top_coor.num == 209

    cyclic_top = gmx.TopSys(cyclic_pep.top_file)

    assert cyclic_top.prot_res_num() == 14

    cyclic_top.display()

    cyclic_pep.em(out_folder=os.path.join(tmp_path, 'cyclic/em/'),
                  nsteps=10,
                  create_box_flag=True)

    cyclic_amber_pep = gmx.GmxSys(name='5vav_amber', coor_file=PDB_5VAV)

    top_coor = pdb_manip.Coor(cyclic_pep.coor_file)
    assert top_coor.num == 209

    cyclic_amber_pep.cyclic_peptide_top(out_folder=os.path.join(
        tmp_path, 'cyclic/top'),
                                        ff='amber99sb-ildn')

    top_coor = pdb_manip.Coor(cyclic_pep.coor_file)
    assert top_coor.num == 209

    cyclic_amber_top = gmx.TopSys(cyclic_amber_pep.top_file)

    print(cyclic_amber_top.charge())

    cyclic_amber_pep.em(out_folder=os.path.join(tmp_path, 'cyclic/em/'),
                        nsteps=10,
                        create_box_flag=True)
Exemplo n.º 8
0
def test_protonate_ph4_7_12_charmm(tmp_path):

    gmx.show_log()
    ##########################################
    # ##   Create the topologie at PH 4.0  ###
    ##########################################
    prot = gmx.GmxSys(name='1RXZ_ph4', coor_file=PDB_1RXZ)
    prot.prepare_top(out_folder=os.path.join(tmp_path, 'top_1RXZ_ph4'), ph=4.0)
    top_coor = pdb_manip.Coor(prot.coor_file)
    assert top_coor.num == 4108

    top_1RXZ = gmx.TopSys(prot.top_file)
    assert top_1RXZ.charge() == 23

    ##########################################
    # ##   Create the topologie at PH 7.0  ###
    ##########################################
    prot = gmx.GmxSys(name='1RXZ_ph7', coor_file=PDB_1RXZ)
    prot.prepare_top(out_folder=os.path.join(tmp_path, 'top_1RXZ_ph7'), ph=7.0)
    top_coor = pdb_manip.Coor(prot.coor_file)
    assert top_coor.num == 4073

    top_1RXZ = gmx.TopSys(prot.top_file)
    assert top_1RXZ.charge() == -12

    ##########################################
    # ##   Create the topologie at PH 10.0 ###
    ##########################################

    # Remark: Charmm doesn't allow lysine unprotonated
    prot = gmx.GmxSys(name='1RXZ_ph10', coor_file=PDB_1RXZ)
    prot.prepare_top(out_folder=os.path.join(tmp_path, 'top_1RXZ_ph10'),
                     ph=10.0)
    top_coor = pdb_manip.Coor(prot.coor_file)
    assert top_coor.num == 4073

    top_1RXZ = gmx.TopSys(prot.top_file)
    assert top_1RXZ.charge() == -12