Last active
November 24, 2015 21:15
-
-
Save samesense/44291ebc1f727462a183 to your computer and use it in GitHub Desktop.
snakemake syntax to make input based on wildcards
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# broken, but expresses idea | |
rule parseMvar: | |
input: DATA + 'collapseCalls_snvs/{sample}.tab', | |
expand(DATA + 'bedIntr/{{sample}}_{sample2}.bed', \ | |
sample2 = n2t['{wildcards.sample}']) | |
output: DATA + 'snv_tumorStatus/{sample}.tab' | |
shell: 'python parseTumorStatus.py {input} {output}' | |
# correct syntax | |
def getTumor(wc): | |
return [ DATA + 'collapseCalls_snvs/' + wc.sample + '.tab', | |
DATA + 'bedIntr/' + wc.sample + '_' + n2t[wc.sample] + '.bed'] | |
rule parseMvar: | |
input: getTumor | |
output: DATA + 'snv_tumorStatus/{sample}.tab' | |
shell: 'python parseTumorStatus.py {input} {output}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment