Skip to content

Commit

Permalink
Make samplesheet parser tolerable to underscores in enum names
Browse files Browse the repository at this point in the history
Solves #888
  • Loading branch information
Donaim committed Aug 28, 2023
1 parent 0121ba5 commit 23f01a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion micall/tests/test_sample_sheet_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ def test_extra_commas(self):
self.assertEqual(ss["Experiment Name"], "10-Jul-2014")


@unittest.expectedFailure
# @unittest.expectedFailure
def test_underscores_in_sample_name(self):
"""
Extracts the correct project code having multiple options.
Expand Down
6 changes: 4 additions & 2 deletions micall/utils/sample_sheet_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,11 @@ def sample_sheet_parser(handle):
samp, proj, val = None, None, None
if sample_sheet_version == 1:
sj, val = elem.split(':')
samp, proj = sj.split(project_delimiter_v1)
components = sj.split(project_delimiter_v1)
samp, proj = (project_delimiter_v1.join(components[:-1]), components[-1])
elif sample_sheet_version == 2:
samp, proj, val = elem.split(project_delimiter_v2)
components = elem.split(project_delimiter_v2)
samp, proj, val = (project_delimiter_v2.join(components[:-2]), components[-2], components[-1])

if samp == entry['sample'] and proj == entry['project']:
if name == 'Research':
Expand Down

0 comments on commit 23f01a5

Please sign in to comment.