-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #777 from dfm/snakemake
Adding support for Snakemake, #777
- Loading branch information
Showing
4 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
""" | ||
A sample Snakefile for testing line counting | ||
""" | ||
|
||
SAMPLES = ["A", "B"] | ||
|
||
|
||
# This is a | ||
# multiline | ||
# comment | ||
rule all: | ||
input: | ||
"plots/quals.svg" | ||
|
||
|
||
rule bwa_map: | ||
input: | ||
"data/genome.fa", # Inline comments are also supported | ||
"data/samples/{sample}.fastq" | ||
output: | ||
"mapped_reads/{sample}.bam" | ||
shell: | ||
"bwa mem {input} | samtools view -Sb - > {output}" | ||
|
||
|
||
rule samtools_sort: | ||
input: | ||
"mapped_reads/{sample}.bam" | ||
output: | ||
"sorted_reads/{sample}.bam" | ||
shell: | ||
"samtools sort -T sorted_reads/{wildcards.sample} " | ||
"-O bam {input} > {output}" | ||
|
||
|
||
rule samtools_index: | ||
input: | ||
"sorted_reads/{sample}.bam" | ||
output: | ||
"sorted_reads/{sample}.bam.bai" | ||
shell: | ||
"samtools index {input}" | ||
|
||
|
||
rule bcftools_call: | ||
input: | ||
fa="data/genome.fa", | ||
bam=expand("sorted_reads/{sample}.bam", sample=SAMPLES), | ||
bai=expand("sorted_reads/{sample}.bam.bai", sample=SAMPLES) | ||
output: | ||
"calls/all.vcf" | ||
shell: | ||
"bcftools mpileup -f {input.fa} {input.bam} | " | ||
"bcftools call -mv - > {output}" | ||
|
||
|
||
rule plot_quals: | ||
input: | ||
"calls/all.vcf" | ||
output: | ||
"plots/quals.svg" | ||
script: | ||
"scripts/plot-quals.py" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# github.com/AlDanial/cloc | ||
header : | ||
cloc_url : github.com/AlDanial/cloc | ||
cloc_version : 1.99 | ||
elapsed_seconds : 0.039093017578125 | ||
n_files : 1 | ||
n_lines : 63 | ||
files_per_second : 25.5800156128025 | ||
lines_per_second : 1611.54098360656 | ||
'Snakemake' : | ||
nFiles: 1 | ||
blank: 13 | ||
comment: 6 | ||
code: 44 | ||
SUM: | ||
blank: 13 | ||
comment: 6 | ||
code: 44 | ||
nFiles: 1 |