Skip to content

Commit

Permalink
Merge pull request cBioPortal#10365 from cBioPortal/fix_generic_entit…
Browse files Browse the repository at this point in the history
…y_id

Improve validation of Entity Stable ID
  • Loading branch information
rmadupuri authored Sep 7, 2023
2 parents c8d815c + 56ebf6e commit 5315006
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions core/src/main/scripts/importer/validateData.py
Original file line number Diff line number Diff line change
Expand Up @@ -4456,12 +4456,17 @@ def __init__(self, *args, **kwargs):

def parseFeatureColumns(self, nonsample_col_vals):
"""Check the IDs in the first column."""

allowed_characters = r'[^A-Za-z0-9_.-]'

value = nonsample_col_vals[0].strip()
if ' ' in value:
self.logger.error('Do not use space in the stable id',

# Check if genetic entity is present and contains allowed characters
if re.search(allowed_characters, value) is not None:
self.logger.error('Feature id contains one or more illegal characters',
extra={'line_number': self.line_number,
'column_number': 1,
'cause': nonsample_col_vals[0]})
'cause': 'id was`' + value + '` and only alpha-numeric, _, . and - are allowed.'})

return value

def checkId(self):
Expand Down

0 comments on commit 5315006

Please sign in to comment.