Skip to content

Commit

Permalink
Sample location (#31)
Browse files Browse the repository at this point in the history
* Manually merged master and sample_location branch.

* Fixed a bug causing pipelines without samples to fail.
  • Loading branch information
wernerkrampl authored Jul 15, 2019
1 parent 152ae62 commit 57c8cbf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# The short X.Y version
version = u''
# The full version, including alpha/beta/rc tags
release = u'0.9.1'
release = u'0.9.2'


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion snakelines.snake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SNAKELINES_VERSION = '0.9.1'
SNAKELINES_VERSION = '0.9.2'

import os
import sys
Expand Down
16 changes: 10 additions & 6 deletions src/common.snake
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,19 @@ for sample_configuration in sample_configurations:
# Filter samples according to the user configuration
samples = []
if 'name' in sample_configuration:
wildcards = glob_wildcards('reads/original/{sample, %s}_R1.fastq.gz' % sample_configuration['name'])
assert len(wildcards.sample) > 0, 'No samples in reads/original/ match configured pattern {}'.format(sample_configuration['name'])
location = sample_configuration.get('location', DEFAULT_SAMPLE_LOCATION)
location = location.replace('{}', '{sample, %s}' % sample_configuration['name'])
wildcards = glob_wildcards(location)
samples = wildcards.sample
assert len(wildcards.sample) > 0, 'No samples in {} match configured pattern {}'.format(location, sample_configuration['name'])


reference = sample_configuration.get('reference', None)
pipeline.add(samples, reference,
sample_configuration.get('panel', None),
sample_configuration.get('prebuilt', False),
bool(extract_from_config(config, ['reference', 'download', reference], [])))
pipeline.add(samples,
reference,
sample_configuration.get('panel', None),
sample_configuration.get('prebuilt', False),
bool(extract_from_config(config, ['reference', 'download', reference], [])))

if pipeline.is_empty():
print('No samples to analyse', file=sys.stderr)
Expand Down

0 comments on commit 57c8cbf

Please sign in to comment.