Skip to content

Commit

Permalink
handle ontology values in RowPath
Browse files Browse the repository at this point in the history
  • Loading branch information
sellth committed Aug 30, 2024
1 parent d5ada10 commit bb9cd79
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions samplesheets/assayapps/generic/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ def _get_col_value(cls, target_col, row, table):
"""
Return value of last matched column.
:param target_col: Column name to look for
:param target_col: Column name string to look for.
:param row: List of dicts (a row returned by SampleSheetTableBuilder)
:param table: Full table with headers (dict returned by
SampleSheetTableBuilder)
:return: String with cell value of last matched column
:return: String with cell value of last matched column.
"""
# Returns last match of row
value = None
Expand All @@ -100,7 +100,13 @@ def _get_col_value(cls, target_col, row, table):
header = table['field_header'][i]
if header['value'].lower() == target_col.lower():
value = row[i]['value']
return value

if isinstance(value, str):
return value
elif isinstance(value, list) and len(value) == 1: # OntologyTermRefs
return value[0]['name']
else:
return None

def get_row_path(self, row, table, assay, assay_path):
"""
Expand Down

0 comments on commit bb9cd79

Please sign in to comment.