我正在尝试运行一个Snakefile,我检查了它对少量文件起作用,但是当我试图使用更多的输入文件运行它时,它一直给我这个错误:
Building DAG of jobs...
Killed作为澄清,我有726个蛋白质文件和19634个hmm文件。
snakefile看起来如下所示:
ARCHIVE_FILE = 'output.tar.gz'
# a single output file
OUTPUT_FILE = 'output_{hmm}/{species}_{hmm}.out'
# a single input file
INPUT_FILE = 'proteins/{species}.fasta'
# a single hmm file
HMM_FILE = 'hmm/{hmm}.hmm'
# a single cat file
CAT_FILE = 'cat/cat_{hmm}.txt'
# a single lines file
LINE_FILE = 'lines/lines_{hmm}.txt'
# a single bit file
BIT_FILE = 'bit_scores/bit_{hmm}.txt'
# Build the list of input files.
INP = glob_wildcards(INPUT_FILE).species
# Build the list of hmm files.
HMM = glob_wildcards(HMM_FILE).hmm
# The list of all output files
OUT = expand(OUTPUT_FILE, species=INP, hmm=HMM)
# The list of all CAT files
CAT = expand(CAT_FILE, hmm=HMM)
# The list of all lines files
LINE = expand(LINE_FILE, hmm=HMM)
# The list of all lines files
BIT = expand(BIT_FILE, hmm=HMM)
# pseudo-rule that tries to build everything.
# Just add all the final outputs that you want built.
rule all:
input: ARCHIVE_FILE
# hmmsearch
rule hmm:
input:
species=INPUT_FILE ,
hmm=HMM_FILE
output:
OUTPUT_FILE,
params:
cmd='hmmsearch --noali -E 99 --tblout'
shell:
'{params.cmd} {output} {input.hmm} {input.species} '
# concatenate output per hmm
rule concatenate:
input:
expand(OUTPUT_FILE, species=INP, hmm="{hmm}"),
output:
CAT_FILE,
params:
cmd="cat",
shell:
"{params.cmd} {input} > {output} "
# clean cat files
rule clean_cats:
input:
cmd='/home/agalvez/bin/remove_lines_starting_with_#.pl',
values=CAT_FILE
output: LINE_FILE
shell:
'{input.cmd} -input {input.values} -output {output}'
# create an archive with all results
rule create_archive:
input: OUT, CAT, LINE,
output: ARCHIVE_FILE
shell: 'tar -czvf {output} {input}'有人知道如何解决这个问题吗?
发布于 2022-01-27 09:59:56
我认为您可以将所有的蛋白质序列连接到一个fasta文件中,并根据hmm配置文件运行该文件。这样你就有19634个工作,而不是19634×726。但是我认为您也可以将hmm概要文件合并到一个文件中,并有一个hmmsearch作业。
此外,即使你成功地按你计划的方式运行snakemake,处理1400万个文件也是很糟糕的。我不知道。但是我觉得你想做的事情,在许多剖面上运行许多蛋白质,并不罕见,但你正在使事情变得比必要的复杂。
发布于 2022-01-21 13:33:47
给定问题中的数字,OUTPUT_FILE中将有OUTPUT_FILE文件(因为每个文件都是由规则创建的,所以许多规则实例,而不考虑其他规则)。这可能仍然是可行的,但在哪里运行snakemake也很重要。如果在集群的登录节点上运行此操作,则通常登录节点的资源不足以运行大型工作流,并且由于内存不足,进程将被终止。
其中一些备选办法是:
在具有足够内存的机器上运行工作流(例如,只为snakemake);
concatenate与规则hmm相结合,但取决于资源密集型规则hmm是如何的);
https://stackoverflow.com/questions/70800208
复制相似问题