コード例 #1
0
def test_chain_guessing():
    traj, ref = _random_trajs()
    feat = LigandContactFeaturizer(reference_frame=ref)
    contacts = feat.transform(traj)

    assert feat.protein_chain == 0
    assert feat.ligand_chain == 1
    assert len(contacts) == 100
    assert contacts[0].shape[1] == 3
コード例 #2
0
def test_chain_guessing():
    traj, ref = _random_trajs()
    feat = LigandContactFeaturizer(reference_frame=ref)
    contacts = feat.transform(traj)

    assert feat.protein_chain == 0
    assert feat.ligand_chain == 1
    assert len(contacts) == 100
    assert contacts[0].shape[1] == 3
コード例 #3
0
def test_binding_pocket():
    traj, ref = _random_trajs()
    feat = LigandContactFeaturizer(reference_frame=ref)
    pocket_ref = feat.transform([ref])
    limit = (max(pocket_ref[0][0]) + min(pocket_ref[0][0]))/2.0
    number_included = sum(pocket_ref[0][0] < limit)


    pocket_feat = LigandContactFeaturizer(reference_frame=ref,
                                          binding_pocket=limit)
    pocket_contacts = pocket_feat.transform(traj)

    assert len(pocket_contacts[0][0]) == number_included
コード例 #4
0
def test_binaries_binding_pocket():
    traj, ref = _random_trajs()
    feat = LigandContactFeaturizer(reference_frame=ref)
    pocket_ref = feat.transform([ref])
    limit = (max(pocket_ref[0][0]) + min(pocket_ref[0][0]))/2.0
    cutoff = limit*0.8
    number_included = sum(pocket_ref[0][0] < limit)

    pocket_feat = BinaryLigandContactFeaturizer(reference_frame=ref,
                                                cutoff=cutoff,
                                                binding_pocket=limit)
    pocket_binaries = pocket_feat.transform(traj)

    assert len(pocket_binaries[0][0]) == number_included
    assert (np.sum(pocket_binaries[:]) <=
            len(pocket_binaries)*pocket_binaries[0].shape[1])
コード例 #5
0
def test_binaries_binding_pocket():
    traj, ref = _random_trajs()
    feat = LigandContactFeaturizer(reference_frame=ref)
    pocket_ref = feat.transform([ref])
    limit = (max(pocket_ref[0][0]) + min(pocket_ref[0][0]))/2.0
    cutoff = limit*0.8
    number_included = sum(pocket_ref[0][0] < limit)

    pocket_feat = BinaryLigandContactFeaturizer(reference_frame=ref,
                                                cutoff=cutoff,
                                                binding_pocket=limit)
    pocket_binaries = pocket_feat.transform(traj)

    assert len(pocket_binaries[0][0]) == number_included
    assert (np.sum(pocket_binaries[:]) <=
            len(pocket_binaries)*pocket_binaries[0].shape[1])
コード例 #6
0
def test_binding_pocket():
    traj, ref = _random_trajs()
    feat = LigandContactFeaturizer(reference_frame=ref)
    pocket_ref = feat.transform([ref])
    limit = (max(pocket_ref[0][0]) + min(pocket_ref[0][0])) / 2.0
    number_included = sum(pocket_ref[0][0] < limit)

    pocket_feat = LigandContactFeaturizer(reference_frame=ref,
                                          binding_pocket=limit)
    pocket_contacts = pocket_feat.transform(traj)

    assert len(pocket_contacts[0][0]) == number_included