Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Klinische Genetica
capture-lumc
hutspot
Commits
bf0c7752
Commit
bf0c7752
authored
Feb 26, 2018
by
Sander Bollen
Browse files
rework input functions
parent
ed71984b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Snakefile
View file @
bf0c7752
import json
from functools import partial
from os.path import join, basename
from os import mkdir
...
...
@@ -82,31 +83,30 @@ except OSError:
pass
def get_r1(wildcards):
def get_r(strand, wildcards):
"""Get fastq files on a single strand for a sample"""
s = SAMPLE_CONFIG['samples'].get(wildcards.sample)
r
1
= []
r
s
= []
for l in sorted(s['libraries'].keys()):
r
1
.append(s['libraries'][l][
'R1'
])
return r
1
r
s
.append(s['libraries'][l][
strand
])
return r
s
def get_r2(wildcards):
s = SAMPLE_CONFIG['samples'].get(wildcards.sample)
r2 = []
for l in sorted(s['libraries'].keys()):
r2.append(s['libraries'][l]['R2'])
return r2
get_r1 = partial(get_r, "R1")
get_r2 = partial(get_r, "R2")
def get_bedpath(wildcards):
return [x for x in BEDS if basename(x) == wildcards.bed][0]
"""Get absolute path of a bed file"""
return next(x for x in BEDS if basename(x) == wildcards.bed)
def get_refflatpath(wildcards):
return [x for x in REFFLATS if basename(x) == wildcards.refflat][0]
"""Get absolute path of a refflat file"""
return next(x for x in REFFLATS if basename(x) == wildcards.refflat)
def sample_gender(wildcards):
"""Get sample gender"""
sam = SAMPLE_CONFIG['samples'].get(wildcards.sample)
return sam.get("gender", "null")
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment