Skip to content

Commit

Permalink
Only proceed with collecting libraries if samplesheet validation pass…
Browse files Browse the repository at this point in the history
…es (#30)
  • Loading branch information
dfornika authored Jan 18, 2024
1 parent 5565ac2 commit 862de9e
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions auto_fastq_symlink/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,19 +317,19 @@ def find_runs(config: dict[str, object]) -> Iterable[Optional[dict[str, object]]
run['parsed_samplesheet'] = samplesheet_to_parse
try:
samplesheet = ss.parse_samplesheet(samplesheet_to_parse, run['instrument_type'])
libraries = find_libraries(run, samplesheet, fastq_extensions)
for library in libraries:
if library['project_id'] in config['project_id_translation']:
samplesheet_project_id = library['project_id']
symlinking_project_id = config['project_id_translation'][samplesheet_project_id]
library['project_id'] = symlinking_project_id
elif library['project_id'] == '':
library['project_id'] = None
run['libraries'] = libraries
yield run
except jsonschema.ValidationError as e:
yield None
libraries = find_libraries(run, samplesheet, fastq_extensions)
for library in libraries:
if library['project_id'] in config['project_id_translation']:
samplesheet_project_id = library['project_id']
symlinking_project_id = config['project_id_translation'][samplesheet_project_id]
library['project_id'] = symlinking_project_id
elif library['project_id'] == '':
library['project_id'] = None
run['libraries'] = libraries

yield run



def find_symlinks(projects):
Expand Down

0 comments on commit 862de9e

Please sign in to comment.