-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
14 changed files
with
161 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
name: acanthophis | ||
channels: | ||
- defaults | ||
- conda-forge | ||
- bioconda | ||
- kdm801 | ||
dependencies: | ||
- snakemake | ||
- snakemake=8 | ||
- singularity | ||
- natsort |
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
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,110 @@ | ||
|
||
rule deepvariant_gvcf: | ||
input: | ||
bam=T("alignments/samples/{aligner}~{ref}~{sample}.bam"), | ||
bai=T("alignments/samples/{aligner}~{ref}~{sample}.bam.bai"), | ||
ref=lambda wc: R(config["data_paths"]["references"][wc.ref]["fasta"], keep_local=True), | ||
output: | ||
vcf=T("deepvariant/{aligner}~{ref}~{sampleset}/{sample}.vcf.gz"), | ||
gvcf=T("deepvariant/{aligner}~{ref}~{sampleset}/{sample}.g.vcf.gz"), | ||
log: | ||
T("deepvariant/{aligner}~{ref}~{sampleset}/{sample}_examples.log"), | ||
#conda: | ||
# "envs/deepvariant.yml", | ||
container: | ||
"docker://google/deepvariant:1.6.0" | ||
params: | ||
model=lambda wc: config["samplesets"][wc.sampleset]["varcall"].get("deepvariant_model", "WGS"), | ||
extra="", | ||
tmp_dir=lambda wc: T(f"deepvariant/{wc.aligner}~{wc.ref}~{wc.sampleset}/{wc.sample}.workdir"), | ||
threads: 32 | ||
shadow: "shallow" | ||
resources: **rule_resources(config, "deepvariant_gvcf", runtime=180, mem_gb=64, cores=32) | ||
shell: | ||
"( mkdir -p {params.tmp_dir}" | ||
" && /opt/deepvariant/bin/run_deepvariant" | ||
" --model_type={params.model}" | ||
" --ref={input.ref}" | ||
" --make_examples_extra_args 'normalize_reads=true'" | ||
" --reads={input.bam}" | ||
" --output_vcf={output.vcf}" | ||
" --output_gvcf={output.gvcf}" | ||
" --intermediate_results_dir={params.tmp_dir}" | ||
" --num_shards={threads}" | ||
") &> {log}" | ||
#"( mkdir -p {params.tmp_dir}" | ||
#" && dv_make_examples.py" | ||
#" --cores {threads}" | ||
#" --ref {input.ref}" | ||
#" --reads {input.bam}" | ||
#" --sample {wildcards.sample}" | ||
#" --examples {params.tmp_dir}" | ||
#" --logdir {params.tmp_dir}" | ||
#" --gvcf {params.tmp_dir}" | ||
#" {params.extra}" | ||
#" && dv_call_variants.py" | ||
#" --cores {threads}" | ||
#" --outfile {params.tmp_dir}/{wc.sample}.calls" | ||
#" --sample {wildcards.sample} " | ||
#" --examples {params.tmp_dir}" | ||
#" --model {params.model}" | ||
#"&& dv_postprocess_variants.py " | ||
#" --ref {input.ref} " | ||
#" --gvcf_infile {params.tmp_dir}/{wc.sample}.gvcf.tfrecord@{threads}.gz" | ||
#" --gvcf_outfile {output.gvcf} " | ||
#" --infile {params.tmp_dir}/{wc.sample}.calls" | ||
#" --outfile {output.vcf}" | ||
#") &> {log}" | ||
|
||
|
||
localrules: glnexus_fofn | ||
rule glnexus_fofn: | ||
input: | ||
gvcf=lambda wc: T(expand("deepvariant/{aligner}~{ref}~{sampleset}/{sample}.g.vcf.gz", | ||
aligner=wc.aligner, ref=wc.ref, sampleset=wc.sampleset, | ||
sample=config["SAMPLESETS"][wc.sampleset])), | ||
output: | ||
T("deepvariant/{aligner}~{ref}~{sampleset}.gvcf_fofn.txt"), | ||
run: | ||
with open(output[0], "w") as fh: | ||
for gvcf in input: | ||
print(gvcf, file=fh) | ||
|
||
rule glnexus_call: | ||
input: | ||
gvcf=lambda wc: T(expand("deepvariant/{aligner}~{ref}~{sampleset}/{sample}.g.vcf.gz", | ||
aligner=wc.aligner, ref=wc.ref, sampleset=wc.sampleset, | ||
sample=config["SAMPLESETS"][wc.sampleset])), | ||
fofn=T("deepvariant/{aligner}~{ref}~{sampleset}.gvcf_fofn.txt"), | ||
output: | ||
vcf=T("deepvariant/{aligner}~{ref}~{sampleset}.vcf.gz"), | ||
log: | ||
T("deepvariant/{aligner}~{ref}~{sampleset}.vcf.gz.log"), | ||
conda: | ||
"envs/glnexus.yml", | ||
#container: | ||
# "docker://ghcr.io/dnanexus-rnd/glnexus:v1.4.1" | ||
shadow: "shallow" | ||
resources: **rule_resources(config, "glnexus_call", runtime=180, mem_gb=128, cores=128) | ||
shell: | ||
"( glnexus_cli" | ||
" --config DeepVariant" | ||
" --list" | ||
" {input.fofn}" | ||
" | bcftools view -Oz8 --threads {threads} -o {output.vcf}" | ||
") &> {log}" | ||
|
||
|
||
|
||
####################################################################### | ||
# Target Rules # | ||
####################################################################### | ||
rule all_deepvariant: | ||
input: | ||
[T(expand("deepvariant/{aligner}~{ref}~{sampleset}.vcf.gz", | ||
aligner=config["samplesets"][sampleset]["varcall"]["aligners"], | ||
ref=config["samplesets"][sampleset]["varcall"]["refs"], | ||
sampleset=sampleset)) | ||
for sampleset in config["samplesets"] | ||
if "deepvariant" in config["samplesets"][sampleset].get("varcall", {}).get("callers", []) | ||
], |
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: | ||
- defaults | ||
- conda-forge | ||
- bioconda | ||
dependencies: | ||
- deepvariant=1.5 |
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 | ||
dependencies: | ||
- glnexus=1.4 | ||
- bcftools | ||
|
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
Empty file.
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 |
---|---|---|
@@ -1,9 +1,13 @@ | ||
#!/bin/bash | ||
conda activate acanthophis-tests | ||
set -xeuo pipefail | ||
python3 -m pip install .. | ||
set -euo pipefail | ||
mamba activate acanthophis-tests | ||
python3 -m pip uninstall --yes acanthophis | ||
python3 -m pip install -e .. | ||
acanthophis-init --yes | ||
mamba env update -f environment.yml | ||
conda activate acanthophis | ||
mamba activate acanthophis | ||
rm -fr output tmp | ||
snakemake -j 2 --use-conda --ri "${@}" | ||
set -x | ||
which snakemake | ||
snakemake --version | ||
snakemake -j $(nproc 2>/dev/null || echo 2) --software-deployment-method conda apptainer --ri "${@}" |
Empty file.