-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6697b53
Showing
6 changed files
with
90 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[](https://binder.pangeo.io/v2/gh/ngs-docs/2022-ggg-201b-variant-calling/stable?urlpath=rstudio) |
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,59 @@ | ||
# default rule that tells snakemake to create the .vcf file if | ||
# it is not run with any specific rule or file request. | ||
rule all: | ||
input: | ||
"SRR2584857_1.ecoli-rel606.vcf" | ||
|
||
rule download_data: | ||
conda: "env-wget.yml" | ||
output: "SRR2584857_1.fastq.gz" | ||
shell: """ | ||
wget https://osf.io/4rdza/download -O {output} | ||
""" | ||
|
||
rule download_genome: | ||
conda: "env-wget.yml" | ||
output: "ecoli-rel606.fa.gz" | ||
shell: | ||
"wget https://osf.io/8sm92/download -O {output}" | ||
|
||
rule map_reads: | ||
conda: "env-minimap.yml" | ||
input: ref="ecoli-rel606.fa.gz", reads="SRR2584857_1.fastq.gz" | ||
output: "SRR2584857_1.ecoli-rel606.sam" | ||
shell: """ | ||
minimap2 -ax sr {input.ref} {input.reads} > {output} | ||
""" | ||
|
||
rule sam_to_bam: | ||
conda: "env-minimap.yml" | ||
input: "SRR2584857_1.ecoli-rel606.sam" | ||
output: "SRR2584857_1.ecoli-rel606.bam" | ||
shell: """ | ||
samtools view -b -F 4 {input} > {output} | ||
""" | ||
|
||
rule sort_bam: | ||
conda: "env-minimap.yml" | ||
input: "SRR2584857_1.ecoli-rel606.bam" | ||
output: "SRR2584857_1.ecoli-rel606.bam.sorted" | ||
shell: """ | ||
samtools sort {input} > {output} | ||
""" | ||
|
||
rule call_variants: | ||
conda: "env-bcftools.yml" | ||
input: | ||
ref="ecoli-rel606.fa.gz", | ||
bamsort="SRR2584857_1.ecoli-rel606.bam.sorted" | ||
output: | ||
refout="ecoli-rel606.fa", | ||
pileup="SRR2584857_1.ecoli-rel606.pileup", | ||
bcf="SRR2584857_1.ecoli-rel606.bcf", | ||
vcf="SRR2584857_1.ecoli-rel606.vcf" | ||
shell: """ | ||
gunzip -c {input.ref} > {output.refout} | ||
bcftools mpileup -Ou -f {output.refout} {input.bamsort} > {output.pileup} | ||
bcftools call -mv -Ob {output.pileup} -o {output.bcf} | ||
bcftools view {output.bcf} > {output.vcf} | ||
""" |
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,7 @@ | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
- defaults | ||
dependencies: | ||
- bcftools=1.11 | ||
- samtools |
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,7 @@ | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
- defaults | ||
dependencies: | ||
- minimap2=2.17 | ||
- samtools=1.10 |
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,6 @@ | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
- defaults | ||
dependencies: | ||
- wget |
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,10 @@ | ||
name: vc | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
- defaults | ||
dependencies: | ||
- r-base=3.6 | ||
- snakemake-minimal=5.30.1 | ||
- wget | ||
- samtools=1.10 |