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

Accept only-one-sample per project as input to QuaC

parent 28bbc54c
No related branches found
No related tags found
1 merge request!3Accept only-one-sample per project as input to QuaC
#family_id sample_id paternal_id maternal_id sex phenotype
unknown A -9 -9 -9 -9
unknown B -9 -9 -9 -9
unknown A father_1 mother_1 -9 -9
#family_id sample_id paternal_id maternal_id sex phenotype
unknown A father_1 mother_1 -9 -9
unknown B father_1 mother_1 -9 -9
......@@ -30,3 +30,8 @@ YYYY-MM-DD John Doe
* QuaC's input are output from the small variant caller pipeline, and former's output will fit seemlessly with the latter's output.
* QuaC accepts pedigree file as input. A dummy pedigree file creator script is provided, which will be handy until phenotips is made available to us.
* System-level testing is added
2021-06-08 Manavalan Gajapathy
* Bugfix: Fixes error when there is only one sample in input ped file (#34)
* Adds system-testing for such only-one-sample-in-input setup (#35).
......@@ -318,7 +318,7 @@ conda activate quac
python src/run_quac.py \
--project_name test_project \
--projects_path ".test/ngs-data/" \
--pedigree ".test/configs/project.ped" \
--pedigree ".test/configs/project_2_samples.ped" \
--outdir "$USER_SCRATCH/tmp/quac/results/test_project_wgs/analysis" \
-e="--conda-create-envs-only"
```
......@@ -402,27 +402,30 @@ module load Anaconda3/2020.02
conda activate quac
# WGS mode
PROJECT="project_2_samples"
python src/run_quac.py \
--project_name test_project \
--projects_path ".test/ngs-data/" \
--pedigree ".test/configs/project.ped" \
--outdir "$USER_SCRATCH/tmp/quac/results/test_project_wgs/analysis"
--pedigree ".test/configs/${PROJECT}.ped" \
--outdir "$USER_SCRATCH/tmp/quac/results/test_${PROJECT}_wgs/analysis"
# Exome mode
python src/run_quac.py \
--project_name test_project \
--projects_path ".test/ngs-data/" \
--pedigree ".test/configs/project.ped" \
--outdir "$USER_SCRATCH/tmp/quac/results/test_project_exome/analysis" \
--pedigree ".test/configs/${PROJECT}.ped" \
--outdir "$USER_SCRATCH/tmp/quac/results/test_${PROJECT}_exome/analysis" \
--quac_watch_config "configs/quac_watch/exome_quac_watch_config.yaml" \
--exome
```
Note: Use `PROJECT="project_1_sample"` to test out a project with only one sample.
### Expected output files
```sh
$ tree $USER_SCRATCH/tmp/quac/results/test_project/ -d -L 4
/data/scratch/manag/tmp/quac/results/test_project/
$ tree $USER_SCRATCH/tmp/quac/results/test_project_2_samples/ -d -L 4
/data/scratch/manag/tmp/quac/results/test_project_2_samples/
└── analysis
├── A
│ └── qc
......@@ -494,14 +497,14 @@ DAG_DIR="pipeline_visualized"
python src/run_quac.py \
--project_name test_project \
--projects_path .test/ngs-data/ \
--pedigree .test/configs/project.ped \
--pedigree .test/configs/project_2_samples.ped \
--run_locally --extra_args "--dag -F | dot -Tpng > ${DAG_DIR}/wgs_dag.png"
# Rulegraph - less informative than DAG at sample level but less dense than DAG makes this easier to skim
python src/run_quac.py \
--project_name test_project \
--projects_path .test/ngs-data/ \
--pedigree .test/configs/project.ped \
--pedigree .test/configs/project_2_samples.ped \
--run_locally --extra_args "--rulegraph -F | dot -Tpng > ${DAG_DIR}/wgs_rulegraph.png"
###### Exome mode ######
......@@ -509,7 +512,7 @@ python src/run_quac.py \
python src/run_quac.py \
--project_name test_project \
--projects_path .test/ngs-data/ \
--pedigree .test/configs/project.ped \
--pedigree .test/configs/project_2_samples.ped \
--exome \
--quac_watch_config "configs/quac_watch/exome_quac_watch_config.yaml" \
--run_locally --extra_args "--dag -F | dot -Tpng > ${DAG_DIR}/exome_dag.png"
......@@ -518,7 +521,7 @@ python src/run_quac.py \
python src/run_quac.py \
--project_name test_project \
--projects_path .test/ngs-data/ \
--pedigree .test/configs/project.ped \
--pedigree .test/configs/project_2_samples.ped \
--exome \
--quac_watch_config "configs/quac_watch/exome_quac_watch_config.yaml" \
--run_locally --extra_args "--rulegraph -F | dot -Tpng > ${DAG_DIR}/exome_rulegraph.png"
......
......@@ -124,13 +124,11 @@ rule mosdepth_plot:
protected(OUT_DIR / "project_level_qc" / "mosdepth" / "mosdepth.html"),
message:
"Running mosdepth plotting"
params:
infiles=lambda wildcards: str(OUT_DIR / f"{{{','.join(SAMPLES)}}}" / "qc" / "mosdepth" / "*.mosdepth.global.dist.txt"),
shell:
r"""
python {input.script} \
--output {output} \
{params.infiles}
{input.dist}
"""
......@@ -156,12 +154,11 @@ rule indexcov:
str(WORKFLOW_PATH / "configs/env/goleft.yaml")
params:
outdir=lambda wildcards, output: Path(output[0]).parent,
infiles=lambda wildcards: str(PROJECT_PATH / f"{{{','.join(SAMPLES)}}}" / "bam" / "*.bam"),
shell:
r"""
goleft indexcov \
--directory {params.outdir} \
{params.infiles} \
{input.bam} \
> {log} 2>&1
"""
......
......@@ -41,14 +41,13 @@ rule somalier_relate:
log=OUT_DIR / "project_level_qc" / "somalier" / "relatedness" / "somalier.log",
params:
outdir=lambda wildcards, output: Path(output["out"][0]).parent,
infiles=lambda wildcards: str(OUT_DIR / "project_level_qc" / "somalier" / "extract" / f"{{{','.join(SAMPLES)}}}.somalier"),
shell:
r"""
somalier relate \
--ped {input.ped} \
--infer \
--output-prefix {params.outdir}/somalier \
{params.infiles} \
{input.extracted} \
> {log} 2>&1
"""
......@@ -73,13 +72,12 @@ rule somalier_ancestry:
log=OUT_DIR / "project_level_qc" / "somalier" / "ancestry" / "somalier.log",
params:
outdir=lambda wildcards, output: Path(output["out"][0]).parent,
infiles=lambda wildcards: str(OUT_DIR / "project_level_qc" / "somalier" / "extract" / f"{{{','.join(SAMPLES)}}}.somalier"),
shell:
r"""
somalier ancestry \
--output-prefix {params.outdir}/somalier \
--labels {input.labels_1kg} \
{input.somalier_1kg_directory}/*.somalier ++ \
{params.infiles} \
{input.extracted} \
> {log} 2>&1
"""
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