def test_protor_radii_invalid(): with pytest.raises(ValueError): # Expect raised exception for hydrogen atoms strucinfo.vdw_radius_protor("FOO", "H1") with pytest.raises(KeyError): # Expect raised exception when a residue does not contain an atom strucinfo.vdw_radius_protor("ALA", "K") # For all other unknown radii expect None assert strucinfo.vdw_radius_protor("HOH", "O") == None
def test_protOr_radii(): """ Assert that ProtOr VdW radii (except hydrogen) can be calculated for all atoms in the given structure, since the structure (1GYA) does only contain standard amino acids after the removal of glycosylation. This means, that none of the resulting radii should be the None. """ array = load_structure(join(data_dir("structure"), "1gya.mmtf")) array = array[..., array.element != "H"] array = array[..., struc.filter_amino_acids(array)] for res_name, atom_name in zip(array.res_name, array.atom_name): radius = strucinfo.vdw_radius_protor(res_name, atom_name) assert isinstance(radius, float) assert radius != None