0

我正在尝试在 nextflow 中使用 watchPath 来查找文件类型,然后获取文件属性。就像是:

Channel.watchPath("/path/to/a/*/ready.txt", 'create' ).view()
                        .map{row ->
                        def readyPath = file(row[0])
                        def path2move = readyPath.getParent()
                        def TNname    = path2move.getBaseName()
                        [TNname, path2move ]
                        }.view().set{TNReadyFiles}

在我的最终观点声明中,我不断得到“to”和“/path/to”,而不是“/path/to/a/dir/”(创建文件的目录)。“path/to”恰好是我的脚本和工作目录的目录。使用监视路径后如何获得准确的文件操作?

4

1 回答 1

0

如果我正确理解您的问题:

Channel.watchPath("/path/to/a/*/ready.txt", 'create' ).view()
                        .map{row ->
                        def readyPath = row.getParent()
                        def TNname    = row.getName()
                        [TNname, readyPath ]
                        }.view().set{TNReadyFiles}

https://www.nextflow.io/docs/latest/script.html#check-file-attributes

于 2020-03-10T10:15:07.117 回答