When I use snakemake, I try to calculate md5 value for several files. The files are as below:
$ ls -l|cut -d" " -f1,2,5-
-rw-r--r-- 1 0 Oct 21 19:46 A.fastq.gz
-rw-r--r-- 1 0 Oct 21 19:46 B.fastq.gz
-rw-r--r-- 1 0 Oct 21 19:46 C.fastq.gz
-rw-r--r-- 1 0 Oct 21 19:46 D.fastq.gz
-rw-r--r-- 1 0 Oct 21 19:46 E.fastq.gz
-rw-r--r-- 1 0 Oct 21 19:46 F.fastq.gz
-rw-r--r-- 1 0 Oct 21 19:46 G.fastq.gz
-rw-r--r-- 1 0 Oct 21 19:46 H.fastq.gz
-rw-r--r-- 1 0 Oct 21 19:46 I.fastq.gz
-rw-r--r-- 1 0 Oct 21 19:46 J.fastq.gz
-rw-r--r-- 1 0 Oct 21 19:46 K.fastq.gz
-rw-r--r-- 1 0 Oct 21 19:46 L.fastq.gz
-rw-r--r-- 1 0 Oct 21 19:46 M.fastq.gz
-rw-r--r-- 1 0 Oct 21 19:46 N.fastq.gz
-rw-r--r-- 1 0 Oct 21 19:46 O.fastq.gz
-rw-r--r-- 1 0 Oct 21 19:46 P.fastq.gz
-rw-r--r-- 1 0 Oct 21 19:46 Q.fastq.gz
-rw-r--r-- 1 0 Oct 21 19:46 R.fastq.gz
-rw-r--r-- 1 0 Oct 21 19:46 S.fastq.gz
-rw-r--r-- 1 131 Oct 21 19:46 test.py
-rw-r--r-- 1 0 Oct 21 19:46 T.fastq.gz
-rw-r--r-- 1 0 Oct 21 19:46 U.fastq.gz
-rw-r--r-- 1 0 Oct 21 19:46 V.fastq.gz
-rw-r--r-- 1 0 Oct 21 19:46 W.fastq.gz
-rw-r--r-- 1 0 Oct 21 19:46 X.fastq.gz
-rw-r--r-- 1 0 Oct 21 19:46 Y.fastq.gz
-rw-r--r-- 1 0 Oct 21 19:46 Z.fastq.gz
So I created a Snakefile file called test.py
:
rule md5:
input:
"{sample}.fastq.gz"
output:
"{sample}.md5"
shell:
"md5sum {input} > {output}"
and then I run the code and got the error as below:
$ snakemake -c -s test.py *gz
Building DAG of jobs...
MissingRuleException:
No rule to produce I.fastq.gz (if you use input functions make sure that they don't raise unexpected exceptions).
I don't know why this error occurs and how to solve this.
I would be appreciated if anyone could help me figure out it.
Thanks a lot.
Many thanks!!!
I understand why I was wrong.
Thanks very much!