def get_length(self): """ Returns the length of the protein. """ length = 0 for residue in self._chain: if is_aa(residue): length += 1 return length
def _get_sequence_from_chain(self, chain): """ Extracts the amino acid sequence from a Bio.PDB chain object """ sequence = "" for residue in chain: if is_aa(residue): sequence += three_to_one(residue.get_resname()) else: break return sequence