Skip to content
Snippets Groups Projects
Commit 4a2cdf9a authored by Manavalan Gajapathy's avatar Manavalan Gajapathy
Browse files

refactors variables to include "analysis" to path at higher level

parent a9860cff
No related branches found
No related tags found
1 merge request!2QC under one umbrella (well mostly) under QuaC
...@@ -74,9 +74,8 @@ def gather_mount_paths(projects_path, project_name, pedigree_path, out_dir, log_ ...@@ -74,9 +74,8 @@ def gather_mount_paths(projects_path, project_name, pedigree_path, out_dir, log_
mount_paths.add(Path(pedigree_path).parent) mount_paths.add(Path(pedigree_path).parent)
# output dirpath # output dirpath
outdir_path = str(Path(out_dir) / project_name) make_dir(out_dir)
make_dir(outdir_path) mount_paths.add(out_dir)
mount_paths.add(outdir_path)
# logs dirpath # logs dirpath
mount_paths.add(log_dir) mount_paths.add(log_dir)
...@@ -109,7 +108,7 @@ def create_snakemake_command(args, repo_path, mount_paths): ...@@ -109,7 +108,7 @@ def create_snakemake_command(args, repo_path, mount_paths):
"project_name": args.project_name, "project_name": args.project_name,
"projects_path": args.projects_path, "projects_path": args.projects_path,
"ped": args.pedigree, "ped": args.pedigree,
"out_dir": str(Path(args.outdir) / args.project_name), "out_dir": args.outdir,
"log_dir": args.log_dir, "log_dir": args.log_dir,
"exome": args.exome, "exome": args.exome,
} }
...@@ -234,7 +233,7 @@ if __name__ == "__main__": ...@@ -234,7 +233,7 @@ if __name__ == "__main__":
type=lambda x: is_valid_file(PARSER, x), type=lambda x: is_valid_file(PARSER, x),
metavar="", metavar="",
) )
QUAC_OUTDIR_DEFAULT = "$USER_SCRATCH/tmp/quac/results" QUAC_OUTDIR_DEFAULT = "$USER_SCRATCH/tmp/quac/results/test_project/analysis"
WORKFLOW.add_argument( WORKFLOW.add_argument(
"--outdir", "--outdir",
help="Out directory path", help="Out directory path",
...@@ -260,7 +259,7 @@ if __name__ == "__main__": ...@@ -260,7 +259,7 @@ if __name__ == "__main__":
metavar="", metavar="",
) )
LOGS_DIR_DEFAULT = f"{QUAC_OUTDIR_DEFAULT}/../logs" LOGS_DIR_DEFAULT = f"$USER_SCRATCH/tmp/quac/logs"
WRAPPER.add_argument( WRAPPER.add_argument(
"--log_dir", "--log_dir",
help="Directory path where logs (both workflow's and wrapper's) will be stored", help="Directory path where logs (both workflow's and wrapper's) will be stored",
......
...@@ -37,9 +37,9 @@ WGS_ONLY_COVERAGE_TARGETS = [] ...@@ -37,9 +37,9 @@ WGS_ONLY_COVERAGE_TARGETS = []
if not EXOME_MODE: if not EXOME_MODE:
WGS_ONLY_COVERAGE_TARGETS = [ WGS_ONLY_COVERAGE_TARGETS = [
# indexcov # indexcov
OUT_DIR / "analysis" / "project_level_qc" / "indexcov" / "index.html", OUT_DIR / "project_level_qc" / "indexcov" / "index.html",
# covviz # covviz
OUT_DIR / "analysis" / "project_level_qc" / "covviz" / "covviz_report.html", OUT_DIR / "project_level_qc" / "covviz" / "covviz_report.html",
] ]
...@@ -47,31 +47,31 @@ rule all: ...@@ -47,31 +47,31 @@ rule all:
input: input:
##### ancestry and relatedness ##### ##### ancestry and relatedness #####
# somalier # somalier
OUT_DIR / "analysis" / "project_level_qc" / "somalier" / "relatedness" / "somalier.html", OUT_DIR / "project_level_qc" / "somalier" / "relatedness" / "somalier.html",
OUT_DIR / "analysis" / "project_level_qc" / "somalier" / "ancestry" / "somalier.somalier-ancestry.html", OUT_DIR / "project_level_qc" / "somalier" / "ancestry" / "somalier.somalier-ancestry.html",
##### coverage ##### ##### coverage #####
# samtools # samtools
expand(str(OUT_DIR / "analysis" / "{sample}" / "qc" / "samtools-stats" / "{sample}.txt"), expand(str(OUT_DIR / "{sample}" / "qc" / "samtools-stats" / "{sample}.txt"),
sample=SAMPLES), sample=SAMPLES),
# qualimap # qualimap
expand(str(OUT_DIR / "analysis" / "{sample}" / "qc" / "qualimap" / "{sample}" / "qualimapReport.html"), expand(str(OUT_DIR / "{sample}" / "qc" / "qualimap" / "{sample}" / "qualimapReport.html"),
sample=SAMPLES), sample=SAMPLES),
# mosdepth # mosdepth
expand(str(OUT_DIR / "analysis" / "{sample}" / "qc" / "mosdepth" / "{sample}.mosdepth.global.dist.txt"), expand(str(OUT_DIR / "{sample}" / "qc" / "mosdepth" / "{sample}.mosdepth.global.dist.txt"),
sample=SAMPLES), sample=SAMPLES),
OUT_DIR / "analysis" / "project_level_qc" / "mosdepth" / "mosdepth.html", OUT_DIR / "project_level_qc" / "mosdepth" / "mosdepth.html",
# indexcov and covviz # indexcov and covviz
WGS_ONLY_COVERAGE_TARGETS, WGS_ONLY_COVERAGE_TARGETS,
##### cross-sample contamination ##### ##### cross-sample contamination #####
# verifyBamID # verifyBamID
expand(str(OUT_DIR / "analysis" / "{sample}" / "qc" / "verifyBamID" / "{sample}.Ancestry"), expand(str(OUT_DIR / "{sample}" / "qc" / "verifyBamID" / "{sample}.Ancestry"),
sample=SAMPLES), sample=SAMPLES),
##### VCF stats ##### ##### VCF stats #####
# bcftools # bcftools
expand(str(OUT_DIR / "analysis" / "{sample}" / "qc" / "bcftools-stats" / "{sample}.bcftools.stats"), expand(str(OUT_DIR / "{sample}" / "qc" / "bcftools-stats" / "{sample}.bcftools.stats"),
sample=SAMPLES), sample=SAMPLES),
##### results aggregation ##### ##### results aggregation #####
expand(str(OUT_DIR / "analysis" / "{sample}" / "qc" / "multiqc_initial_pass" / "{sample}_multiqc.html"), expand(str(OUT_DIR / "{sample}" / "qc" / "multiqc_initial_pass" / "{sample}_multiqc.html"),
sample=SAMPLES), sample=SAMPLES),
......
rule multiqc_initial_pass: rule multiqc_initial_pass:
input: input:
OUT_DIR / "analysis" / "project_level_qc" / "somalier" / "relatedness" / "somalier.html", expand(
OUT_DIR / "analysis" / "project_level_qc" / "somalier" / "ancestry" / "somalier.somalier-ancestry.html", str(
expand(str(OUT_DIR / "analysis" / "{sample}" / "qc" / "samtools-stats" / "{sample}.txt"), PROJECT_PATH
sample=SAMPLES), / "{{sample}}"
expand(str(OUT_DIR / "analysis" / "{sample}" / "qc" / "qualimap" / "{sample}" / "qualimapReport.html"), / "qc"
sample=SAMPLES), / "fastqc-raw"
expand(str(OUT_DIR / "analysis" / "{sample}" / "qc" / "mosdepth" / "{sample}.mosdepth.global.dist.txt"), / "{{sample}}-{unit}-{read}_fastqc.zip"
sample=SAMPLES), ),
expand(str(OUT_DIR / "analysis" / "{sample}" / "qc" / "verifyBamID" / "{sample}.Ancestry"), unit=[1,2],
sample=SAMPLES), read=["R1", "R2"],
expand(str(OUT_DIR / "analysis" / "{sample}" / "qc" / "bcftools-stats" / "{sample}.bcftools.stats"), ),
sample=SAMPLES), expand(
str(
PROJECT_PATH
/ "{{sample}}"
/ "qc"
/ "fastqc-trimmed"
/ "{{sample}}-{unit}-{read}_fastqc.zip"
),
unit=[1,2],
read=["R1", "R2"],
),
expand(
str(
PROJECT_PATH
/ "{{sample}}"
/ "qc"
/ "fastq_screen-trimmed"
/ "{{sample}}-{unit}-{read}_screen.txt"
),
unit=[1,2],
read=["R1", "R2"],
),
OUT_DIR / "project_level_qc" / "somalier" / "relatedness" / "somalier.html",
OUT_DIR / "project_level_qc" / "somalier" / "ancestry" / "somalier.somalier-ancestry.html",
OUT_DIR / "{sample}" / "qc" / "samtools-stats" / "{sample}.txt",
OUT_DIR / "{sample}" / "qc" / "qualimap" / "{sample}" / "qualimapReport.html",
OUT_DIR / "{sample}" / "qc" / "mosdepth" / "{sample}.mosdepth.global.dist.txt",
OUT_DIR / "{sample}" / "qc" / "verifyBamID" / "{sample}.Ancestry",
OUT_DIR / "{sample}" / "qc" / "bcftools-stats" / "{sample}.bcftools.stats",
# config_file = "configs/qc/multiqc_config.yaml", # config_file = "configs/qc/multiqc_config.yaml",
# rename_config = PROJECT_PATH + "/{all_samples}/qc/multiqc_initial_pass/multiqc_sample_rename_config/{all_samples}_rename_config.tsv", rename_config=(
PROJECT_PATH
/ "{sample}"
/ "qc"
/ "multiqc_initial_pass"
/ "multiqc_sample_rename_config"
/ "{sample}_rename_config.tsv"
),
output: output:
OUT_DIR / "analysis" / "{sample}" / "qc" / "multiqc_initial_pass" / "{sample}_multiqc.html", OUT_DIR / "{sample}" / "qc" / "multiqc_initial_pass" / "{sample}_multiqc.html",
# protected(PROJECT_PATH + "/{all_samples}/qc/multiqc_initial_pass/{all_samples}_multiqc_data/multiqc_general_stats.txt"), OUT_DIR / "{sample}" / "qc" / "multiqc_initial_pass" / "{sample}_multiqc_data" / "multiqc_general_stats.txt",
# protected(PROJECT_PATH + "/{all_samples}/qc/multiqc_initial_pass/{all_samples}_multiqc_data/multiqc_fastqc_trimmed.txt"), OUT_DIR / "{sample}" / "qc" / "multiqc_initial_pass" / "{sample}_multiqc_data" / "multiqc_fastqc_trimmed.txt",
# protected(PROJECT_PATH + "/{all_samples}/qc/multiqc_initial_pass/{all_samples}_multiqc_data/multiqc_fastq_screen.txt"), OUT_DIR / "{sample}" / "qc" / "multiqc_initial_pass" / "{sample}_multiqc_data" / "multiqc_fastq_screen.txt",
# wildcard_constraints: #TODO - fix unit wildcard
# unit="\d+",
# WARNING: don't put this rule in a group, bad things will happen. see issue #23 in gitlab (small var caller # WARNING: don't put this rule in a group, bad things will happen. see issue #23 in gitlab (small var caller
# pipeline repo) # pipeline repo)
message: message:
...@@ -29,4 +66,3 @@ rule multiqc_initial_pass: ...@@ -29,4 +66,3 @@ rule multiqc_initial_pass:
# extra = lambda wildcards, input: f'--config {input.config_file} --sample-names {input.rename_config}' # extra = lambda wildcards, input: f'--config {input.config_file} --sample-names {input.rename_config}'
wrapper: wrapper:
"0.64.0/bio/multiqc" "0.64.0/bio/multiqc"
...@@ -25,7 +25,7 @@ def is_testing_mode(): ...@@ -25,7 +25,7 @@ def is_testing_mode():
#### configs from cli #### #### configs from cli ####
OUT_DIR = Path(config["out_dir"]) OUT_DIR = Path(config["out_dir"])
PROJECT_NAME = config["project_name"] PROJECT_NAME = config["project_name"]
PROJECT_PATH = Path(config["projects_path"]) / PROJECT_NAME PROJECT_PATH = Path(config["projects_path"]) / PROJECT_NAME / "analysis"
PEDIGREE_FPATH = config["ped"] PEDIGREE_FPATH = config["ped"]
EXOME_MODE = config["exome"] EXOME_MODE = config["exome"]
......
########################## Samtools ########################## ########################## Samtools ##########################
rule samtools_stats: rule samtools_stats:
input: input:
PROJECT_PATH / "analysis" / "{sample}" / "bam" / "{sample}.bam", PROJECT_PATH / "{sample}" / "bam" / "{sample}.bam",
output: output:
OUT_DIR / "analysis" / "{sample}" / "qc" / "samtools-stats" / "{sample}.txt", OUT_DIR / "{sample}" / "qc" / "samtools-stats" / "{sample}.txt",
# protected(PROJECT_PATH + "/{sample}/qc/samtools-stats/{sample}.txt"), # protected(PROJECT_PATH + "/{sample}/qc/samtools-stats/{sample}.txt"),
wrapper: wrapper:
"0.64.0/bio/samtools/stats" "0.64.0/bio/samtools/stats"
...@@ -12,15 +12,15 @@ rule samtools_stats: ...@@ -12,15 +12,15 @@ rule samtools_stats:
########################## Qualimap ########################## ########################## Qualimap ##########################
rule qualimap_bamqc: rule qualimap_bamqc:
input: input:
bam = PROJECT_PATH / "analysis" / "{sample}" / "bam" / "{sample}.bam", bam = PROJECT_PATH / "{sample}" / "bam" / "{sample}.bam",
index = PROJECT_PATH / "analysis" / "{sample}" / "bam" / "{sample}.bam.bai", index = PROJECT_PATH / "{sample}" / "bam" / "{sample}.bam.bai",
#TODO: target regions #TODO: target regions
# target_regions = config["processing"]["restrict-regions"] if config["processing"].get("restrict-regions") else [] # target_regions = config["processing"]["restrict-regions"] if config["processing"].get("restrict-regions") else []
target_regions = [] target_regions = []
output: output:
html_report = OUT_DIR / "analysis" / "{sample}" / "qc" / "qualimap" / "{sample}" / "qualimapReport.html", html_report = OUT_DIR / "{sample}" / "qc" / "qualimap" / "{sample}" / "qualimapReport.html",
coverage = OUT_DIR / "analysis" / "{sample}" / "qc" / "qualimap" / "{sample}" / "raw_data_qualimapReport" / "coverage_across_reference.txt", coverage = OUT_DIR / "{sample}" / "qc" / "qualimap" / "{sample}" / "raw_data_qualimapReport" / "coverage_across_reference.txt",
summary = OUT_DIR / "analysis" / "{sample}" / "qc" / "qualimap" / "{sample}" / "genome_results.txt", summary = OUT_DIR / "{sample}" / "qc" / "qualimap" / "{sample}" / "genome_results.txt",
message: message:
"stats bam using qualimap" "stats bam using qualimap"
conda: conda:
...@@ -46,11 +46,11 @@ rule qualimap_bamqc: ...@@ -46,11 +46,11 @@ rule qualimap_bamqc:
########################## Mosdepth ########################## ########################## Mosdepth ##########################
rule mosdepth_coverage: rule mosdepth_coverage:
input: input:
bam=PROJECT_PATH / "analysis" / "{sample}" / "bam" / "{sample}.bam", bam=PROJECT_PATH / "{sample}" / "bam" / "{sample}.bam",
bam_index=PROJECT_PATH / "analysis" / "{sample}" / "bam" / "{sample}.bam.bai", bam_index=PROJECT_PATH / "{sample}" / "bam" / "{sample}.bam.bai",
output: output:
dist=OUT_DIR / "analysis" / "{sample}" / "qc" / "mosdepth" / "{sample}.mosdepth.global.dist.txt", dist=OUT_DIR / "{sample}" / "qc" / "mosdepth" / "{sample}.mosdepth.global.dist.txt",
summary=OUT_DIR / "analysis" / "{sample}" / "qc" / "mosdepth" / "{sample}.mosdepth.summary.txt", summary=OUT_DIR / "{sample}" / "qc" / "mosdepth" / "{sample}.mosdepth.summary.txt",
message: message:
"Running mosdepth for coverage. Sample: {wildcards.sample}" "Running mosdepth for coverage. Sample: {wildcards.sample}"
conda: conda:
...@@ -72,11 +72,11 @@ rule mosdepth_coverage: ...@@ -72,11 +72,11 @@ rule mosdepth_coverage:
rule mosdepth_plot: rule mosdepth_plot:
input: input:
dist=expand( dist=expand(
str(OUT_DIR / "analysis" / "{sample}" / "qc" / "mosdepth" / "{sample}.mosdepth.global.dist.txt"), sample=SAMPLES str(OUT_DIR / "{sample}" / "qc" / "mosdepth" / "{sample}.mosdepth.global.dist.txt"), sample=SAMPLES
), ),
script=WORKFLOW_PATH / "src/mosdepth/v0.3.1/plot-dist.py", script=WORKFLOW_PATH / "src/mosdepth/v0.3.1/plot-dist.py",
output: output:
OUT_DIR / "analysis" / "project_level_qc" / "mosdepth" / "mosdepth.html" OUT_DIR / "project_level_qc" / "mosdepth" / "mosdepth.html"
message: message:
"Running mosdepth plotting" "Running mosdepth plotting"
params: params:
...@@ -96,20 +96,20 @@ rule mosdepth_plot: ...@@ -96,20 +96,20 @@ rule mosdepth_plot:
rule indexcov: rule indexcov:
input: input:
bam=expand( bam=expand(
str(PROJECT_PATH / "analysis" / "{sample}" / "bam" / "{sample}.bam"), str(PROJECT_PATH / "{sample}" / "bam" / "{sample}.bam"),
sample=SAMPLES, sample=SAMPLES,
), ),
bam_index=expand( bam_index=expand(
str(PROJECT_PATH / "analysis" / "{sample}" / "bam" / "{sample}.bam.bai"), str(PROJECT_PATH / "{sample}" / "bam" / "{sample}.bam.bai"),
sample=SAMPLES, sample=SAMPLES,
), ),
output: output:
html=OUT_DIR / "analysis" / "project_level_qc" / "indexcov" / "index.html", html=OUT_DIR / "project_level_qc" / "indexcov" / "index.html",
bed=OUT_DIR / "analysis" / "project_level_qc" / "indexcov" / "indexcov-indexcov.bed.gz", bed=OUT_DIR / "project_level_qc" / "indexcov" / "indexcov-indexcov.bed.gz",
message: message:
"Running indexcov" "Running indexcov"
log: log:
OUT_DIR / "analysis" / "project_level_qc" / "indexcov" / "stdout.log", OUT_DIR / "project_level_qc" / "indexcov" / "stdout.log",
conda: conda:
str(WORKFLOW_PATH / "configs/env/goleft.yaml") str(WORKFLOW_PATH / "configs/env/goleft.yaml")
params: params:
...@@ -129,14 +129,14 @@ rule indexcov: ...@@ -129,14 +129,14 @@ rule indexcov:
########################## covviz ########################## ########################## covviz ##########################
rule covviz: rule covviz:
input: input:
bed=OUT_DIR / "analysis" / "project_level_qc" / "indexcov" / "indexcov-indexcov.bed.gz", bed=OUT_DIR / "project_level_qc" / "indexcov" / "indexcov-indexcov.bed.gz",
ped=PEDIGREE_FPATH, ped=PEDIGREE_FPATH,
output: output:
html=OUT_DIR / "analysis" / "project_level_qc" / "covviz" / "covviz_report.html", html=OUT_DIR / "project_level_qc" / "covviz" / "covviz_report.html",
message: message:
"Running covviz" "Running covviz"
log: log:
OUT_DIR / "analysis" / "project_level_qc" / "covviz" / "stdout.log", OUT_DIR / "project_level_qc" / "covviz" / "stdout.log",
conda: conda:
str(WORKFLOW_PATH / "configs/env/covviz.yaml") str(WORKFLOW_PATH / "configs/env/covviz.yaml")
shell: shell:
......
rule somalier_extract: rule somalier_extract:
input: input:
bam=PROJECT_PATH / "analysis" / "{sample}" / "bam" / "{sample}.bam", bam=PROJECT_PATH / "{sample}" / "bam" / "{sample}.bam",
bam_index=PROJECT_PATH / "analysis" / "{sample}" / "bam" / "{sample}.bam.bai", bam_index=PROJECT_PATH / "{sample}" / "bam" / "{sample}.bam.bai",
sites=config["somalier"]["sites"], sites=config["somalier"]["sites"],
ref_genome=config["ref"], ref_genome=config["ref"],
output: output:
OUT_DIR / "analysis" / "project_level_qc" / "somalier" / "extract" / "{sample}.somalier" OUT_DIR / "project_level_qc" / "somalier" / "extract" / "{sample}.somalier"
message: message:
"Running somalier extract. Sample: {wildcards.sample}" "Running somalier extract. Sample: {wildcards.sample}"
singularity: singularity:
...@@ -27,13 +27,13 @@ rule somalier_extract: ...@@ -27,13 +27,13 @@ rule somalier_extract:
rule somalier_relate: rule somalier_relate:
input: input:
extracted=expand( extracted=expand(
str(OUT_DIR / "analysis" / "project_level_qc" / "somalier" / "extract" / "{sample}.somalier"), str(OUT_DIR / "project_level_qc" / "somalier" / "extract" / "{sample}.somalier"),
sample=SAMPLES sample=SAMPLES
), ),
ped=PEDIGREE_FPATH, ped=PEDIGREE_FPATH,
output: output:
out=expand( out=expand(
str(OUT_DIR / "analysis" / "project_level_qc" / "somalier" / "relatedness" / "somalier.{ext}"), str(OUT_DIR / "project_level_qc" / "somalier" / "relatedness" / "somalier.{ext}"),
ext=["html", "pairs.tsv", "samples.tsv"], ext=["html", "pairs.tsv", "samples.tsv"],
), ),
message: message:
...@@ -41,7 +41,7 @@ rule somalier_relate: ...@@ -41,7 +41,7 @@ rule somalier_relate:
singularity: singularity:
"docker://brentp/somalier:v0.2.12" "docker://brentp/somalier:v0.2.12"
log: log:
log=OUT_DIR / "analysis" / "project_level_qc" / "somalier" / "relatedness" / "somalier.log", log=OUT_DIR / "project_level_qc" / "somalier" / "relatedness" / "somalier.log",
params: params:
outdir=lambda wildcards, output: Path(output["out"][0]).parent, outdir=lambda wildcards, output: Path(output["out"][0]).parent,
indir=lambda wildcards, input: Path(input[0]).parent, indir=lambda wildcards, input: Path(input[0]).parent,
...@@ -61,14 +61,14 @@ rule somalier_relate: ...@@ -61,14 +61,14 @@ rule somalier_relate:
rule somalier_ancestry: rule somalier_ancestry:
input: input:
extracted=expand( extracted=expand(
str(OUT_DIR / "analysis" / "project_level_qc" / "somalier" / "extract" / "{sample}.somalier"), str(OUT_DIR / "project_level_qc" / "somalier" / "extract" / "{sample}.somalier"),
sample=SAMPLES sample=SAMPLES
), ),
labels_1kg=config["somalier"]["labels_1kg"], labels_1kg=config["somalier"]["labels_1kg"],
somalier_1kg=directory(config["somalier"]["somalier_1kg"]), somalier_1kg=directory(config["somalier"]["somalier_1kg"]),
output: output:
out=expand( out=expand(
str(OUT_DIR / "analysis" / "project_level_qc" / "somalier" / "ancestry" / "somalier.somalier-ancestry.{ext}"), str(OUT_DIR / "project_level_qc" / "somalier" / "ancestry" / "somalier.somalier-ancestry.{ext}"),
ext=["html", "tsv"], ext=["html", "tsv"],
), ),
message: message:
...@@ -76,7 +76,7 @@ rule somalier_ancestry: ...@@ -76,7 +76,7 @@ rule somalier_ancestry:
singularity: singularity:
"docker://brentp/somalier:v0.2.12" "docker://brentp/somalier:v0.2.12"
log: log:
log=OUT_DIR / "analysis" / "project_level_qc" / "somalier" / "ancestry" / "somalier.log", log=OUT_DIR / "project_level_qc" / "somalier" / "ancestry" / "somalier.log",
params: params:
outdir=lambda wildcards, output: Path(output["out"][0]).parent, outdir=lambda wildcards, output: Path(output["out"][0]).parent,
indir=lambda wildcards, input: Path(input[0]).parent, indir=lambda wildcards, input: Path(input[0]).parent,
......
rule bcftools_stats: rule bcftools_stats:
input: input:
PROJECT_PATH / "analysis" / "{sample}" / "vcf" / "{sample}.vcf.gz", PROJECT_PATH / "{sample}" / "vcf" / "{sample}.vcf.gz",
output: output:
OUT_DIR / "analysis" / "{sample}" / "qc" / "bcftools-stats" / "{sample}.bcftools.stats", OUT_DIR / "{sample}" / "qc" / "bcftools-stats" / "{sample}.bcftools.stats",
message: message:
"stats vcf using bcftools" "stats vcf using bcftools"
conda: conda:
......
...@@ -7,13 +7,13 @@ def get_svd(wildcards): ...@@ -7,13 +7,13 @@ def get_svd(wildcards):
rule verifybamid: rule verifybamid:
input: input:
bam=PROJECT_PATH / "analysis" / "{sample}" / "bam" / "{sample}.bam", bam=PROJECT_PATH / "{sample}" / "bam" / "{sample}.bam",
bam_index=PROJECT_PATH / "analysis" / "{sample}" / "bam" / "{sample}.bam.bai", bam_index=PROJECT_PATH / "{sample}" / "bam" / "{sample}.bam.bai",
ref_genome=config["ref"], ref_genome=config["ref"],
svd=get_svd, svd=get_svd,
output: output:
ancestry=OUT_DIR / "analysis" / "{sample}" / "qc" / "verifyBamID" / "{sample}.Ancestry", ancestry=OUT_DIR / "{sample}" / "qc" / "verifyBamID" / "{sample}.Ancestry",
selfsm=OUT_DIR / "analysis" / "{sample}" / "qc" / "verifyBamID" / "{sample}.selfSM", selfsm=OUT_DIR / "{sample}" / "qc" / "verifyBamID" / "{sample}.selfSM",
message: message:
"Running VerifyBamID to detect within-species contamination. sample: {wildcards.sample}" "Running VerifyBamID to detect within-species contamination. sample: {wildcards.sample}"
conda: conda:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment