简体   繁体   English

Snakemake 无法识别多个文件作为输入

[英]Snakemake not recognizing multiple files as input

I'm having some trouble running snakemake.我在运行 snakemake 时遇到了一些问题。 I want to perform quality control of some RNA-Seq bulk samples using FastQC.我想使用 FastQC 对一些 RNA-Seq 批量样本进行质量控制。 I've written the code in a way that all files following the pattern {sample}_{replicate}.fastq.gz should be used as input, where {sample} is the sample id (ie SRR6974023) and {replicate} is 1 or 2. My little scripts follows:我编写代码的方式是,所有遵循模式{sample}_{replicate}.fastq.gz的文件都应该用作输入,其中{sample}是样本 id(即 SRR6974023), {replicate}是 1或 2. 我的小脚本如下:

configfile: "config.yaml"

rule all:
  input:
    expand("raw_qc/{sample}_{replicate}_fastqc.{extension}", sample=config["samples"], replicate=[1, 2], extension=["zip", "html"])
    

rule fastqc:
  input:
    rawread=expand("raw_data/{sample}_{replicate}.fastq.gz", sample=config["samples"], replicate=[1, 2])
  
  output:
    compress=expand("raw_qc/{sample}_{replicate}_fastqc.zip", sample=config["samples"], replicate=[1, 2]),
    net=expand("raw_qc/{sample}_{replicate}_fastqc.html", sample=config["samples"], replicate=[1, 2])
  
  threads: 
    8
  
  params:
    path="raw_qc/"
  
  shell:
    "fastqc -t {threads} {input.rawread} -o {params.path}" 

Just is case, the config.yaml is:就是这样, config.yaml是:

samples:
  SRR6974023
  SRR6974024

The raw_data directory with my files look like this:我的文件的raw_data目录如下所示:

SRR6974023_1.fastq.gz  SRR6974023_2.fastq.gz  SRR6974024_1.fastq.gz  SRR6974024_2.fastq.gz

Finally, when I run the script, I always see the same error:最后,当我运行脚本时,我总是看到同样的错误:

Building DAG of jobs...
MissingInputException in line 8 of /home/user/path/Snakefile:
Missing input files for rule fastqc:
raw_data/SRR6974023 SRR6974024_2.fastq.gz
raw_data/SRR6974023 SRR6974024_1.fastq.gz

It see correctly only the last files, in this case SRR6974024_1.fastq.gz and SRR6974024_2.fastq.gz .它只正确看到最后一个文件,在这种情况下SRR6974024_1.fastq.gzSRR6974024_2.fastq.gz Whatsoever, the other one it's only seen as SRR6974023 .无论如何,另一个它只被视为SRR6974023 How can I solve this issue?我该如何解决这个问题? I appreciate some help.我很感激一些帮助。 Thank you all!谢谢你们!

The yaml is not configured correctly. yaml配置不正确。 It should have - to turn each row into a list:它应该-将每一行变成一个列表:

samples:
  - SRR6974023
  - SRR6974024

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM