<p>在JeeYem的帮助下,正确的代码是:</p>
<pre><code>rule all:
input:
"c.log","c.raw"
rule bfile:
input:
"a.map","a.ped"
output:
"b.bed","b.bim","b.fam"
params:
a1 = "a",
a2 = "b"
shell:
"plink file {params.a1} out {params.a2}"
rule cfile:
input:
"b.bed","b.bim","b.fam"
output:
"c.log", "c.raw"
params:
aa1 = "b",
aa2 = "c"
shell:
"plink bfile {params.aa1} out {params.aa2} recodeA"
</code></pre>
<p>我运行snakemake,它生成我想要的结果:</p>
<pre><code>Provided cores: 1
Rules claiming more threads will be scaled down.
Job counts:
count jobs
1 all
1 bfile
1 cfile
3
rule bfile:
input: a.map, a.ped
output: b.bed, b.bim, b.fam
jobid: 2
PLINK v1.90b6.5 64-bit (13 Sep 2018) www.cog-genomics.org/plink/1.9/
(C) 2005-2018 Shaun Purcell, Christopher Chang GNU General Public License v3
Logging to b.log.
Options in effect:
file a
out b
63985 MB RAM detected; reserving 31992 MB for main workspace.
.ped scan complete (for binary autoconversion).
Performing single-pass .bed write (3 variants, 6 people).
file: b.bed + b.bim + b.fam written.
Finished job 2.
1 of 3 steps (33%) done
rule cfile:
input: b.bed, b.bim, b.fam
output: c.log, c.raw
jobid: 1
PLINK v1.90b6.5 64-bit (13 Sep 2018) www.cog-genomics.org/plink/1.9/
(C) 2005-2018 Shaun Purcell, Christopher Chang GNU General Public License v3
Note: recodeA flag deprecated. Use 'recode A ...'.
Logging to c.log.
Options in effect:
bfile b
out c
recode A
63985 MB RAM detected; reserving 31992 MB for main workspace.
3 variants loaded from .bim file.
6 people (4 males, 2 females) loaded from .fam.
3 phenotype values loaded from .fam.
Using 1 thread (no multithreaded calculations invoked).
Before main variant filters, 4 founders and 2 nonfounders present.
Calculating allele frequencies... done.
Total genotyping rate is 0.777778.
3 variants and 6 people pass filters and QC.
Among remaining phenotypes, 3 are cases and 0 are controls. (3 phenotypes are
missing.)
recode A to c.raw ... done.
Finished job 1.
2 of 3 steps (67%) done
localrule all:
input: c.log, c.raw
jobid: 0
Finished job 0.
3 of 3 steps (100%) done
</code></pre>