簡體   English   中英

Snakemake:使用拆分命令時出錯?

[英]Snakemake: error when using split command?

在我的 Snakemake 規則的 shell 部分中使用 Unix split命令時出現錯誤:

rule split:
    input:
            "test_file.txt"
    output:
            directory("split_test_file")
    shell:
            '''
            mkdir {output}
            split -1 3 {input} split_
            mv split_* {output}
            '''

這是錯誤:

Error in rule split:
jobid: 0
output: split_test_file
shell:
    
    mkdir split_test_file
    split -1 3 test_file.txt split_
    mv split_* split_test_file
    
    (one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)

我認為錯誤發生在mv split_* split_test_file行中,因為當我只運行前兩行時沒有錯誤。 我似乎找不到為什么我不能將拆分test_file.txt產生的所有文件移動到 output 目錄中? 太感謝了!

  1. split命令中有一個錯字,其中-1需要是字母-l
  2. 您的mv命令會導致錯誤mv: cannot move 'split_test_file' to a subdirectory of itself, 'split_test_file/split_test_file' 要移動的文件和目標目錄都以相同的字符串split_ ,這會導致此錯誤。 修改其中任何一個都可以解決此問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM