首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Nextflow名称冲突

Nextflow名称冲突
EN

Stack Overflow用户
提问于 2022-09-09 10:28:49
回答 1查看 155关注 0票数 0

我的文件有相同的名字,但在不同的文件夹。Nextflow将这些文件放到同一个工作目录中,从而导致名称冲突。我的问题是如何处理这个而不对文件进行重命名。示例:

代码语言:javascript
运行
复制
# Example data
mkdir folder1 folder2
echo 1 > folder1/file.txt
echo 2 > folder2/file.txt

# We read from samplesheet
$ cat samplesheet.csv
sample,file
sample1,/home/atpoint/foo/folder1/file.txt
sample1,/home/atpoint/foo/folder2/file.txt

# Nextflow main.nf
#! /usr/bin/env nextflow

nextflow.enable.dsl=2

// Read samplesheet and group files by sample (first column)
samplesheet = Channel
    .fromPath(params.samplesheet)
    .splitCsv(header:true)
    .map {
            sample = it['sample']
            file   = it['file']
            tuple(sample, file)
}
        
ch_samplesheet = samplesheet.groupTuple(by:0)

// That creates a tuple like:
// [sample1, [/home/atpoint/foo/folder1/file.txt, /home/atpoint/foo/folder2/file.txt]]

// Dummy process that stages both files into the same work directory folder
process PRO {

    input:
    tuple val(samplename), path(files)

    output:
    path("out.txt")

    script:
    """
    echo $samplename with files $files > out.txt
    """

}

workflow { PRO(ch_samplesheet) }

# Run it
NXF_VER=21.10.6 nextflow run main.nf --samplesheet $(realpath samplesheet.csv)

...obviously导致:

代码语言:javascript
运行
复制
N E X T F L O W  ~  version 21.10.6
Launching `main.nf` [adoring_jennings] - revision: 87f26fa90b
[-        ] process > PRO -
Error executing process > 'PRO (1)'

Caused by:
  Process `PRO` input file name collision -- There are multiple input files for each of the following file names: file.txt

那么,现在怎么办?这里的实际应用程序是相同fastq文件的排序复制,该文件随后具有相同的名称,但位于不同的文件夹中,我希望将它们输入一个合并它们的进程中。我知道这个文档中的部分,但不能说其中任何一个都是有用的,或者说我正确地理解了它。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-09-09 12:57:57

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73660749

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档