Python snakemake包装器:将通配符指向config.yaml或txt列表

Python snakemake包装器:将通配符指向config.yaml或txt列表,python,list,snakemake,Python,List,Snakemake,我正在尝试使用以下蛇形包装: rule get_fastq_pe: output: # the wildcard name must be accession, pointing to an SRA number "data/{accession}_1.fastq", "data/{accession}_2.fastq" params: # optional extra arg

我正在尝试使用以下蛇形包装:

rule get_fastq_pe:
    output:
        # the wildcard name must be accession, pointing to an SRA number
        "data/{accession}_1.fastq",
        "data/{accession}_2.fastq"
    params:
        # optional extra arguments
        extra=""
    threads: 6  # defaults to 6
    wrapper:
        "0.73.0/bio/sra-tools/fasterq-dump"

如何在txt文件或config.yaml文件中直接访问多个SRR访问?

首先,在yaml文件中指定所需的所有SRR
SRR.yml

SRR:
  - SRR1234
  - SRR5678
  - SRR2468
  - SRR1357
然后在Snakefile中,加载带有关键字
configfile:
的yaml文件:

configfile: "SRR.yml"
定义规则all以触发所有必要文件的创建:

rule all:
    input: expand("data/{accession}_{RF}.fastq", accession=config["SRR"], RF=["1","2"])
然后添加您的规则:

rule get_fastq_pe:
    output:
        # the wildcard name must be accession, pointing to an SRA number
        "data/{accession}_1.fastq",
        "data/{accession}_2.fastq"
    params:
        # optional extra arguments
        extra=""
    threads: 6  # defaults to 6
    wrapper:
        "0.73.0/bio/sra-tools/fasterq-dump"

很有帮助,很明显。谢谢我根本不知道我需要一个规则。正在尝试添加类似于规则get_fastq_pe output或params的内容。