Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make samplesheet parser tolerable to underscores in enum names #1006

Merged
merged 2 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Donaim marked this conversation as resolved.
Show resolved Hide resolved
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
Loading