{sample}与{wildcard的差异.样品}在蛇的制作



谁能告诉我下面蛇形官方教程中{sample}{wildcard.sample}的区别?它们都等于"a"吗?或";B"?我想知道什么时候使用{sample}{wildcard.sample}。谢谢!

SAMPLES = ["A", "B"]

rule all:
input:
"plots/quals.svg"

rule bwa_map:
input:
"data/genome.fa",
"data/samples/{sample}.fastq"
output:
"mapped_reads/{sample}.bam"
shell:
"bwa mem {input} | samtools view -Sb - > {output}"

rule samtools_sort:
input:
"mapped_reads/{sample}.bam"
output:
"sorted_reads/{sample}.bam"
shell:
"samtools sort -T sorted_reads/{wildcards.sample} "
"-O bam {input} > {output}"

rule samtools_index:
input:
"sorted_reads/{sample}.bam"
output:
"sorted_reads/{sample}.bam.bai"
shell:
"samtools index {input}"

rule bcftools_call:
input:
fa="data/genome.fa",
bam=expand("sorted_reads/{sample}.bam", sample=SAMPLES),
bai=expand("sorted_reads/{sample}.bam.bai", sample=SAMPLES)
output:
"calls/all.vcf"
shell:
"samtools mpileup -g -f {input.fa} {input.bam} | "
"bcftools call -mv - > {output}"

rule plot_quals:
input:
"calls/all.vcf"
output:
"plots/quals.svg"
script:
"scripts/plot-quals.py"

{sample}在输入"或"output"和{通配符。Sample}用于"shell",因为只有{通配符。获取实际的示例名称并传输到shell,然后shell中的命令将运行。我想。

最新更新