Skip to content

Commit

Permalink
Specify threads in rule
Browse files Browse the repository at this point in the history
  • Loading branch information
verku committed Jun 17, 2024
1 parent 57f3ba5 commit e6598cc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/slurm/profile/config_plugin_dardel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ set-threads:
- filter_biallelic_missing_vcf=48
### PCA
- vcf2plink_pca=16
- plink_eigenvec=8
### runs of homozygosity
- filter_vcf_hwe=16
- vcf2plink_hwe=16
Expand Down
1 change: 1 addition & 0 deletions config/slurm/profile/config_plugin_rackham.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ set-threads:
- filter_biallelic_missing_vcf=6
### PCA
- vcf2plink_pca=2
- plink_eigenvec=1
### runs of homozygosity
- filter_vcf_hwe=2
- vcf2plink_hwe=2
Expand Down
3 changes: 2 additions & 1 deletion workflow/rules/10_pca.smk
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ rule plink_eigenvec:
output:
eigenvec="results/{dataset}/pca/" + REF_NAME + ".{dataset}.merged.biallelic.fmissing{fmiss}.{chr}.eigenvec",
eigenval="results/{dataset}/pca/" + REF_NAME + ".{dataset}.merged.biallelic.fmissing{fmiss}.{chr}.eigenval",
threads: 1
params:
bfile="results/{dataset}/pca/" + REF_NAME + ".{dataset}.merged.biallelic.fmissing{fmiss}.{chr}",
log:
Expand All @@ -77,7 +78,7 @@ rule plink_eigenvec:
samples=`cat {input.fam} | wc -l`
if [ "$samples" -gt 1 ]
then
plink --bfile {params.bfile} --allow-extra-chr --pca --out {params.bfile} 2> {log}
plink --bfile {params.bfile} --threads {threads} --allow-extra-chr --pca --out {params.bfile} 2> {log}
else
touch {output.eigenvec} && touch {output.eigenval} 2> {log}
echo "Not enough samples to calculate a PCA." >> {log}
Expand Down

0 comments on commit e6598cc

Please sign in to comment.