Пример #1
0
def parse_propka_output(file):
    while next(file) != "SUMMARY OF THIS PREDICTION\n":
        pass
    next(file)
    return {
        pdb_utils.residue_hash(entry): entry
        for entry in map(line_to_pka_entry, file) if entry is not None
    }
Пример #2
0
def get_renamed_histidines(pdb):

    RENAME_DICT = {'no HE2': 'HID', 'no HD1': 'HIE', 'bothHN': 'HIP'}
    renamed_histidines = {}  # dict of residue_hash: new_name pairs

    for line in pdb.other:
        if line[:9] != 'USER  MOD' or line[25:28] != 'HIS':
            continue

        his_name = RENAME_DICT.get(line[39:45])
        if his_name is None:
            continue

        his_hash = pdb_utils.residue_hash({
            'chainID': line[19],
            'resSeq': int(line[20:24]),
            'resName': "HIS"
        })
        renamed_histidines[his_hash] = his_name

    return renamed_histidines
Пример #3
0
 def test_residue_hash(self):
     self.assertEqual(pdb_utils.residue_hash(self.parsed_atom), "A_36_ARG")