Skip to content

Instantly share code, notes, and snippets.

@samesense
Last active November 24, 2015 21:15
Show Gist options
  • Save samesense/44291ebc1f727462a183 to your computer and use it in GitHub Desktop.
Save samesense/44291ebc1f727462a183 to your computer and use it in GitHub Desktop.
snakemake syntax to make input based on wildcards
# 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