def correct( self, pose: pyrosetta.Pose ) -> pyrosetta.rosetta.core.select.residue_selector.ResidueSelector: """ This is not a great thing to do. So it is best to relax the neighbours of the vector afterwards. If there are valines instead of the intended sequence that is bad. Altering the blueprint is required. :param pose: :return: """ MutateResidue = pyrosetta.rosetta.protocols.simple_moves.MutateResidue one2three = pyrosetta.rosetta.protocols.motifs.name3_from_oneletter ex_seq = self.expected_seq() altered = pyrosetta.rosetta.core.select.residue_selector.ResidueIndexSelector( ) for i, (expected, current) in enumerate(zip(ex_seq, pose.chain_sequence(1))): if expected != current: altered.append_index(i + 1) MutateResidue(target=i + 1, new_res=one2three(expected)).apply(pose) return altered
def from_pose(cls, pose: pyrosetta.Pose): seq = pose.chain_sequence(1) DSSP = pyrosetta.rosetta.protocols.moves.DsspMover() DSSP.apply(pose) ss = pose.secstruct() # for this case, no slicing. return cls(seq, ss)