Newer
Older
bam=PROJECT_PATH / "{sample}" / "bam" / "{sample}.bam",
bam_index=PROJECT_PATH / "{sample}" / "bam" / "{sample}.bam.bai",
sites=config["somalier"]["sites"],
ref_genome=config["ref"],
protected(OUT_DIR / "project_level_qc" / "somalier" / "extract" / "{sample}.somalier"),
"Running somalier extract. Sample: {wildcards.sample}"
singularity:
"docker://brentp/somalier:v0.2.12"
outdir=lambda wildcards, output: Path(output[0]).parent,
extracted=expand(OUT_DIR / "project_level_qc" / "somalier" / "extract" / "{sample}.somalier", sample=SAMPLES),
OUT_DIR / "project_level_qc" / "somalier" / "relatedness" / "somalier.{ext}",
ext=["html", "pairs.tsv", "samples.tsv"],
"Running somalier relate"
singularity:
"docker://brentp/somalier:v0.2.12"
log=OUT_DIR / "project_level_qc" / "somalier" / "relatedness" / "somalier.log",
outdir=lambda wildcards, output: Path(output["out"][0]).parent,
infiles=lambda wildcards: str(OUT_DIR / "project_level_qc" / "somalier" / "extract" / f"{{{','.join(SAMPLES)}}}.somalier")
echo "Heads up: Somalier is run on all samples in the input directory; Not just the files mentioned in the rule's input."
--infer \
--output-prefix {params.outdir}/somalier \
extracted=expand(OUT_DIR / "project_level_qc" / "somalier" / "extract" / "{sample}.somalier", sample=SAMPLES),
labels_1kg=config["somalier"]["labels_1kg"],
somalier_1kg=directory(config["somalier"]["somalier_1kg"]),
OUT_DIR / "project_level_qc" / "somalier" / "ancestry" / "somalier.somalier-ancestry.{ext}",
"Running somalier ancestry."
singularity:
"docker://brentp/somalier:v0.2.12"
log=OUT_DIR / "project_level_qc" / "somalier" / "ancestry" / "somalier.log",
outdir=lambda wildcards, output: Path(output["out"][0]).parent,
infiles=lambda wildcards: str(OUT_DIR / "project_level_qc" / "somalier" / "extract" / f"{{{','.join(SAMPLES)}}}.somalier")
--output-prefix {params.outdir}/somalier \
--labels {input.labels_1kg} \
{input.somalier_1kg}/*.somalier ++ \