Skip to content

Commit 2b59845

Browse files
committed
add option to get ssm library including wt
1 parent 63f8ab7 commit 2b59845

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

aide_predict/utils/data_structures/sequences.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ def align(self, other: 'ProteinSequence') -> 'ProteinSequence':
427427
aligned_self.msa = other
428428
return aligned_self
429429

430-
def saturation_mutagenesis(self, positions: List[int]=None) -> List['ProteinSequence']:
430+
def saturation_mutagenesis(self, positions: List[int]=None, include_wt: bool=False) -> List['ProteinSequence']:
431431
"""
432432
Perform saturation mutagenesis at the specified positions.
433433
@@ -442,10 +442,11 @@ def saturation_mutagenesis(self, positions: List[int]=None) -> List['ProteinSequ
442442
positions = range(len(self))
443443
for i in positions:
444444
for aa in AA_SINGLE:
445-
if aa != self[i]:
446-
mutated = self._mutate(i, aa)
447-
mutated.id = f"{self[i]}{i+1}{aa}"
448-
sequences.append(mutated)
445+
if aa == self[i] and not include_wt:
446+
continue
447+
mutated = self._mutate(i, aa)
448+
mutated.id = f"{self[i]}{i+1}{aa}"
449+
sequences.append(mutated)
449450
return ProteinSequences(sequences)
450451

451452
def upper(self) -> 'ProteinSequence':

0 commit comments

Comments
 (0)