def get_local_omega_altlocs(twores): #in conformer world, where threes come from, altlocs are most accurately # stored at the atom level, in the .id_str() #look at all atoms in the main residues, plus the atoms used in calculations # from adjacent residues to find if any have altlocs prevres_alt = '' mainres_alt = '' for atom in twores[1].atoms(): if atom.name not in [" N ", " CA "]: continue altchar = atom.id_str()[9:10] if altchar != ' ': mainres_alt = altchar break for atom in twores[0].atoms(): if atom.name not in [" CA ", " C "]: continue altchar = atom.id_str()[9:10] if altchar != ' ': prevres_alt = altchar break return prevres_alt, mainres_alt
def get_altloc_from_three(three): #in conformer world, where threes come from, altlocs are most accurately # stored at the atom level, in the .id_str() #look at all atoms in the main residues, plus the atoms used in calculations # from adjacent residues to find if any have altlocs ##mc_atoms = (" N ", " CA ", " C ", " O ") for atom in three[1].atoms(): altchar = atom.id_str()[9:10] if altchar != ' ': return altchar for atom in three[0].atoms(): if atom.name != ' C ': continue altchar = atom.id_str()[9:10] if altchar != ' ': return altchar for atom in three[2].atoms(): if atom.name != ' N ': continue altchar = atom.id_str()[9:10] if altchar != ' ': return altchar return ''