Last active
July 7, 2019 12:02
-
-
Save johanneskoester/fb32ea875d6e80677b0c14e54dc7eba5 to your computer and use it in GitHub Desktop.
One way to possibly include type annotations to Snakemake workflow definitions. One could for example use ontologies like edam, as well as mime types.
This file contains hidden or 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
filetypes: | |
# this directive automatically generates flags for each type that can be used in the rules below | |
fq="edam:format_1929" | |
fa="edam:format_1930" | |
bam="edam:format_2572" | |
rule bwa: | |
input: | |
fq("genome.fa"), | |
fa("reads/{sample}.fq") | |
output: | |
bam("mapped/{sample}.bam") | |
conda: | |
"envs/mapping.yaml" | |
shell: | |
"bwa mem -f {input} | samtools view -Sb - > {output}" | |
rule sort: | |
input: | |
# Snakemake would display an error message if the rule creating this input file has not flagged it as bam. | |
bam("mapped/{sample}.bam") | |
output: | |
bam("mapped/{sample}.sorted.bam") | |
conda: | |
"envs/mapping.yaml" | |
shell: | |
"samtools sort {input} > {output}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment