File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -149,6 +149,8 @@ def _standardize_sequence(self):
149
149
amino acids, raising an error if an unknown character is found.
150
150
"""
151
151
self .sequence = self .sequence .upper ()
152
+ self .sequence = self .sequence .replace (" " , "" )
153
+ self .sequence = self .sequence .strip ("*" )
152
154
if not all ([i in self ._amino_acids for i in set (self .sequence )]):
153
155
log .error (self .sequence )
154
156
raise ValueError ("Unknown character/letter in protein sequence" )
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ def hash_aminos(input, **kwargs):
26
26
# make sure everything is uppercase before hashing
27
27
cleaned = input .upper ()
28
28
# remove all whitespace
29
- cleaned = "" . join ( cleaned .split () )
29
+ cleaned = cleaned .replace ( " " , "" )
30
30
# remove "*" if it's at the beginning or end of the string but not in the middle
31
31
cleaned = cleaned .strip ("*" )
32
32
return hasher (input = cleaned , ** kwargs )
You can’t perform that action at this time.
0 commit comments