Skip to content

Commit

Permalink
Snakefmt pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
endast committed May 8, 2024
1 parent 97257bd commit 4ef1945
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
10 changes: 6 additions & 4 deletions pipelines/preprocess_no_qc.snakefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
include: "preprocessing/preprocess.snakefile"


rule all:
input:
combined_genotypes=rules.combine_genotypes.output,
variants_tsv=rules.add_variant_ids.output.variants,
variants_parquet=rules.create_parquet_variant_ids.output.variants
variants_parquet=rules.create_parquet_variant_ids.output.variants,


rule preprocess:
input:
variants=rules.add_variant_ids.output.variants,
variants_parquet=rules.create_parquet_variant_ids.output.variants,
samples=rules.extract_samples.output,
sparse_tg=expand(rules.sparsify.output.tsv,vcf_stem=vcf_stems),
sparse_tg=expand(rules.sparsify.output.tsv, vcf_stem=vcf_stems),
output:
expand(preprocessed_dir / "genotypes_chr{chr}.h5",chr=chromosomes),
expand(preprocessed_dir / "genotypes_chr{chr}.h5", chr=chromosomes),
shell:
" ".join(
[
Expand All @@ -25,6 +27,6 @@ rule preprocess:
"{input.variants_parquet}",
"{input.samples}",
f"{sparse_dir}",
f"{preprocessed_dir / 'genotypes'}",
f"{preprocessed_dir/ 'genotypes'}",
]
)
21 changes: 9 additions & 12 deletions pipelines/preprocess_with_qc.snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,24 @@ rule all:
input:
combined_genotypes=rules.combine_genotypes.output,
variants_tsv=rules.add_variant_ids.output.variants,
variants_parquet=rules.create_parquet_variant_ids.output.variants
variants_parquet=rules.create_parquet_variant_ids.output.variants,


rule preprocess:
input:
variants=rules.add_variant_ids.output.variants,
variants_parquet=rules.create_parquet_variant_ids.output.variants,
samples=rules.extract_samples.output,
sparse_tg=expand(rules.sparsify.output.tsv,vcf_stem=vcf_stems),

qc_varmiss=expand(rules.qc_varmiss.output,vcf_stem=vcf_stems),
qc_hwe=expand(rules.qc_hwe.output,vcf_stem=vcf_stems),
qc_read_depth=expand(
rules.qc_read_depth.output,vcf_stem=vcf_stems
),
sparse_tg=expand(rules.sparsify.output.tsv, vcf_stem=vcf_stems),
qc_varmiss=expand(rules.qc_varmiss.output, vcf_stem=vcf_stems),
qc_hwe=expand(rules.qc_hwe.output, vcf_stem=vcf_stems),
qc_read_depth=expand(rules.qc_read_depth.output, vcf_stem=vcf_stems),
qc_allelic_imbalance=expand(
rules.qc_allelic_imbalance.output,vcf_stem=vcf_stems
rules.qc_allelic_imbalance.output, vcf_stem=vcf_stems
),
qc_indmiss_samples=rules.process_individual_missingness.output
qc_indmiss_samples=rules.process_individual_missingness.output,
output:
expand(preprocessed_dir / "genotypes_chr{chr}.h5",chr=chromosomes),
expand(preprocessed_dir / "genotypes_chr{chr}.h5", chr=chromosomes),
shell:
" ".join(
[
Expand All @@ -43,6 +40,6 @@ rule preprocess:
"{input.variants_parquet}",
"{input.samples}",
f"{sparse_dir}",
f"{preprocessed_dir / 'genotypes'}",
f"{preprocessed_dir/ 'genotypes'}",
]
)

0 comments on commit 4ef1945

Please sign in to comment.