我正在使用以下配置文件格式蛇形对于一些测序分析实践(我有大量样本,每个样本包含 2 个 fastq 文件:
samples:
Sample1_XY:
- fastq_files/SRR4356728_1.fastq.gz
- fastq_files/SRR4356728_2.fastq.gz
Sample2_AB:
- fastq_files/SRR6257171_1.fastq.gz
- fastq_files/SRR6257171_2.fastq.gz
我在管道开始时使用以下规则来运行 fastqc 并对齐 fastqc 文件:
import os
# read config info into this namespace
configfile: "config.yaml"
rule all:
input:
expand("FastQC/{sample}_fastqc.zip", sample=config["samples"]),
expand("bam_files/{sample}.bam", sample=config["samples"]),
"FastQC/fastq_multiqc.html"
rule fastqc:
input:
sample=lambda wildcards: config['samples'][wildcards.sample]
output:
# Output needs to end in '_fastqc.html' for multiqc to work
html="FastQC/{sample}_fastqc.html",
zip="FastQC/{sample}_fastqc.zip"
params: ""
wrapper:
"0.21.0/bio/fastqc"
rule bowtie2:
input:
sample=lambda wildcards: config['samples'][wildcards.sample]
output:
"bam_files/{sample}.bam"
log:
"logs/bowtie2/{sample}.txt"
params:
index=config["index"], # prefix of reference genome index (built with bowtie2-build),
extra=""
threads: 8
wrapper:
"0.21.0/bio/bowtie2/align"
rule multiqc_fastq:
input:
expand("FastQC/{sample}_fastqc.html", sample=config["samples"])
output:
"FastQC/fastq_multiqc.html"
params:
log:
"logs/multiqc.log"
wrapper:
"0.21.0/bio/multiqc"
我的问题是 fastqc 规则。
目前,fastqc 规则和 Bowtie2 规则都会创建一个使用两个输入生成的输出文件SRRXXXXXXX_1.fastq.gz
and SRRXXXXXXX_2.fastq.gz
.
我需要 fastq 规则来生成两个文件,每个文件一个单独的文件fastq.gz
文件,但我不确定如何从 fastqc 规则输入语句正确索引配置文件,或者如何结合扩展和通配符命令来解决这个问题。我可以通过添加来获取单独的 fastq 文件[0]
or [1]
到输入语句的末尾,但不能同时运行。
我一直在努力尝试获得正确的索引格式来分别访问每个文件。当前的格式是我管理过的唯一允许snakemake -np
生成工作列表。
任何提示将非常感谢。