展开

基于Snakemake的生信分析分析流程设计原则

最后发布时间 : 2022-12-21 10:51:13 浏览量 :

约定大于配置(Convention over configuration)

config文件的准备

  • config.yaml
  • contrast.tsv
  • metadata.tsv
  • samples.tsv
  • multiqc.yaml

samples.tsv

生信小木屋

metadata.tsv

生信小木屋

contrast.tsv

生信小木屋

rule make_b_files:
	input:
		bam=expand(
            "results/hisat2/{sample.sample_name}/hisat2.bam",
            sample=samples.itertuples(),
        ),
		input1 = "results/MASTS/{group}/{condition1}.txt"
	output:
		b1 = "results/MASTS/{group}/{condition1}-{condition2}.txt"
		# b1 = "results/MASTS/{group}/{condition1}-{condition2}.txt"

	params:
		file1 = lambda w, input:[cond1_bam for cond1_bam in input.bam if w.condition1 in cond1_bam], # if cond1_bam.startswith("pass2/"+CONDITION1)
		file2 = lambda w, input:[cond2_bam for cond2_bam in input.bam if w.condition1 in cond2_bam]
	run:
		with open(output.b1,'w') as file1:
			file1.write(",".join(params.file1))

		# with open(output.b2,'w') as file2:
		# 	file2.write(",".join(params.file2))