Skip to content

Commit

Permalink
add upper() to input query
Browse files Browse the repository at this point in the history
  • Loading branch information
luponzo86 committed Mar 2, 2020
1 parent 60281d1 commit 3c68320
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions rhapsody/features/Uniprot.py
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ def seqScanning(Uniprot_coord, sequence=None):
sequence will be downloaded from Uniprot.
'''
assert isinstance(Uniprot_coord, str), "Must be a string."
coord = Uniprot_coord.strip().split()
coord = Uniprot_coord.upper().strip().split()
assert len(coord) < 3, "Invalid format. Examples: 'Q9BW27' or 'Q9BW27 10'."
aa_list = 'ACDEFGHIKLMNPQRSTVWY'
if sequence is None:
Expand Down Expand Up @@ -928,5 +928,5 @@ def printSAVlist(input_SAVs, filename):
m = f'error in SAV {i}: '
assert isinstance(line, str), f'{m} not a string'
assert len(line) < 25, f'{m} too many characters'
print(line, file=f)
print(line.upper(), file=f)
return filename
7 changes: 4 additions & 3 deletions rhapsody/predict/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,18 +193,19 @@ def setSAVs(self, query):
if isfile(query):
# 'query' is a filename, with line format 'P17516 135 G E'
SAVs = np.loadtxt(query, dtype=SAV_dtype)
SAV_list = ['{} {} {} {}'.format(*s) for s in SAVs]
SAV_list = ['{} {} {} {}'.format(*s).upper() for s in SAVs]
elif len(query.split()) < 3:
# single Uniprot acc (+ pos), e.g. 'P17516' or 'P17516 135'
SAV_list = Uniprot.seqScanning(query)
self.saturation_mutagenesis = True
else:
# single SAV
SAV = np.array(query.split(), dtype=SAV_dtype)
SAV = np.array(query.upper().split(), dtype=SAV_dtype)
SAV_list = ['{} {} {} {}'.format(*SAV)]
else:
# 'query' is a list or tuple of SAV coordinates
SAVs = np.array([tuple(s.split()) for s in query], dtype=SAV_dtype)
SAVs = np.array([tuple(s.upper().split()) for s in query],
dtype=SAV_dtype)
SAV_list = ['{} {} {} {}'.format(*s) for s in SAVs]
# store SAV coordinates
numSAVs = len(SAV_list)
Expand Down

0 comments on commit 3c68320

Please sign in to comment.