diff --git a/RanDepict/randepict.py b/RanDepict/randepict.py index f3a11cd..b6013d9 100644 --- a/RanDepict/randepict.py +++ b/RanDepict/randepict.py @@ -312,7 +312,8 @@ def get_depiction_functions(self, smiles: str) -> List[Callable]: # Remove PIKAChU if there is an isotope if re.search("(\[\d\d\d?[A-Z])|(\[2H\])|(\[3H\])|(D)|(T)", smiles): - depiction_functions.remove(self.pikachu_depict) + if self.pikachu_depict in depiction_functions: + depiction_functions.remove(self.pikachu_depict) if self.has_r_group(smiles): # PIKAChU only accepts \[[RXZ]\d*\] squared_bracket_content = re.findall("\[.+?\]", smiles)