Skip to content

Commit

Permalink
fix: sample sheet processing and run id searching fixes from bigsky t…
Browse files Browse the repository at this point in the history
…esting
  • Loading branch information
rroutsong committed Feb 2, 2024
1 parent 725f091 commit d1d46e1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
4 changes: 4 additions & 0 deletions scripts/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ def get_run_directories(runids, seq_dir=None, sheetname=None):
host = get_current_server()
seq_dirs = Path(seq_dir).absolute() if seq_dir else Path(DIRECTORY_CONFIGS[host]['seqroot'])
seq_contents = [_child for _child in seq_dirs.iterdir()]
for firstchild in seq_dirs.iterdir():
if firstchild.is_dir():
for secondchild in firstchild.iterdir():
seq_contents.append(secondchild)
seq_contents_names = [child for child in map(lambda d: d.name, seq_contents)]

run_paths, invalid_runs = [], []
Expand Down
17 changes: 10 additions & 7 deletions scripts/samplesheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,16 @@ def parse_sheet(self, sheet):
def process_v1_reads_section(self, section):
section = [x for x in section if set(x) != {','}]
r1, r2 = None, None
for i, line in enumerate(section, start=1):
if line.split(',')[0].isnumeric() and i == 1:
r1 = int(line.split(',')[0])
elif line.split(',')[0].isnumeric() and i == 2:
r2 = int(line.split(',')[0])
else:
self.process_simple_section([line])
for line in section:
this_line_name = line.split(',')[0]
this_line_val = line.split(',')[1]
if this_line_name.lower() in ('read01', 'read02') and this_line_val.isnumeric():
if this_line_name.endswith('1') and int(this_line_val) > 0:
r1 = int(this_line_val)
elif this_line_name.endswith('2') and int(this_line_val) > 0:
r2 = int(this_line_val)
else:
self.process_simple_section([line])
if r1:
setattr(self, 'Read01', r1)
if r2:
Expand Down

0 comments on commit d1d46e1

Please sign in to comment.