- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在重新设计一个工作流,基本上它从一个产生多个其他进程的进程开始。最初我在开始我的工作流程之前有变量,所以我制作了这些变量的元组,然后将它作为输入传递给流程。该进程获取每个值,并为元组中的每个值生成一个进程。
但是在我的新架构中,我在 processA 中得到了“元组”。然后 processB 需要将每个值作为输入,并为每个输入生成一个进程。
我的元组看起来像:{"002--002": some_params, "004--004": some_params, etc.}
我目前在 Python 中将这些值作为列表:['052--052', '054--054', '055--055', '059--059', '060-- 060', '066--066']
我想知道如何解析这个 Python 列表,以继续传递一个参数并生成多个进程?
ProcessA 还会创建诸如 somefile_052--052.someextension
之类的文件 - 我基本上想用正确的文件传递正确的变量。
如有任何帮助,我们将不胜感激。
这是一些代码:
这是我需要操作的文件。我需要发送具有相同代码的所有文件以及变量。
> ls
out.barcoded.subreads.bam out.subreads.060--060.bam.pbi out.subreads.090--090.subreadset.xml out.subreads.149--149.bam out.subreads.192--192.bam.pbi out.subreads.249--249.subreadset.xml out.subreads.285--285.bam out.subreads.321--321.bam.pbi out.subreads.479--479.subreadset.xml
out.barcoded.subreads.bam.pbi out.subreads.060--060.subreadset.xml out.subreads.091--091.bam out.subreads.149--149.bam.pbi out.subreads.192--192.subreadset.xml out.subreads.252--252.bam out.subreads.285--285.bam.pbi out.subreads.321--321.subreadset.xml out.subreads.482--482.bam
out.barcoded.subreads.lima.counts out.subreads.066--066.bam out.subreads.091--091.bam.pbi out.subreads.149--149.subreadset.xml out.subreads.227--227.bam out.subreads.252--252.bam.pbi out.subreads.285--285.subreadset.xml out.subreads.454--454.bam out.subreads.482--482.bam.pbi
out.barcoded.subreads.lima.guess out.subreads.066--066.bam.pbi out.subreads.091--091.subreadset.xml out.subreads.172--172.bam out.subreads.227--227.bam.pbi out.subreads.252--252.subreadset.xml out.subreads.303--303.bam out.subreads.454--454.bam.pbi out.subreads.482--482.subreadset.xml
out.barcoded.subreads.lima.report out.subreads.066--066.subreadset.xml out.subreads.107--107.bam out.subreads.172--172.bam.pbi out.subreads.227--227.subreadset.xml out.subreads.259--259.bam out.subreads.303--303.bam.pbi out.subreads.454--454.subreadset.xml out.subreads.489--489.bam
out.barcoded.subreads.lima.summary out.subreads.071--071.bam out.subreads.107--107.bam.pbi out.subreads.172--172.subreadset.xml out.subreads.233--233.bam out.subreads.259--259.bam.pbi out.subreads.303--303.subreadset.xml out.subreads.464--464.bam out.subreads.489--489.bam.pbi
out.barcoded.subreads.subreadset.xml out.subreads.071--071.bam.pbi out.subreads.107--107.subreadset.xml out.subreads.175--175.bam out.subreads.233--233.bam.pbi out.subreads.259--259.subreadset.xml out.subreads.307--307.bam out.subreads.464--464.bam.pbi out.subreads.489--489.subreadset.xml
out.subreads.052--052.bam out.subreads.071--071.subreadset.xml out.subreads.112--112.bam out.subreads.175--175.bam.pbi out.subreads.233--233.subreadset.xml out.subreads.261--261.bam out.subreads.307--307.bam.pbi out.subreads.464--464.subreadset.xml out.subreads.494--494.bam
out.subreads.052--052.bam.pbi out.subreads.082--082.bam out.subreads.112--112.bam.pbi out.subreads.175--175.subreadset.xml out.subreads.235--235.bam out.subreads.261--261.bam.pbi out.subreads.307--307.subreadset.xml out.subreads.468--468.bam out.subreads.494--494.bam.pbi
out.subreads.052--052.subreadset.xml out.subreads.082--082.bam.pbi out.subreads.112--112.subreadset.xml out.subreads.185--185.bam out.subreads.235--235.bam.pbi out.subreads.261--261.subreadset.xml out.subreads.313--313.bam out.subreads.468--468.bam.pbi out.subreads.494--494.subreadset.xml
out.subreads.054--054.bam.pbi out.subreads.082--082.subreadset.xml out.subreads.113--113.bam out.subreads.185--185.bam.pbi out.subreads.235--235.subreadset.xml out.subreads.264--264.bam out.subreads.313--313.bam.pbi out.subreads.468--468.subreadset.xml out.subreads.bam
out.subreads.054--054.subreadset.xml out.subreads.085--085.bam out.subreads.113--113.bam.pbi out.subreads.185--185.subreadset.xml out.subreads.241--241.bam out.subreads.264--264.bam.pbi out.subreads.313--313.subreadset.xml out.subreads.471--471.bam out.subreads.bam.pbi
out.subreads.055--055.bam out.subreads.085--085.bam.pbi out.subreads.113--113.subreadset.xml out.subreads.187--187.bam out.subreads.241--241.bam.pbi out.subreads.264--264.subreadset.xml out.subreads.316--316.bam out.subreads.471--471.bam.pbi out.subreads.json
out.subreads.055--055.bam.pbi out.subreads.085--085.subreadset.xml out.subreads.125--125.bam out.subreads.187--187.bam.pbi out.subreads.241--241.subreadset.xml out.subreads.265--265.bam out.subreads.316--316.bam.pbi out.subreads.471--471.subreadset.xml out.subreads.lima.counts
out.subreads.055--055.subreadset.xml out.subreads.088--088.bam out.subreads.125--125.bam.pbi out.subreads.187--187.subreadset.xml out.subreads.245--245.bam out.subreads.265--265.bam.pbi out.subreads.316--316.subreadset.xml out.subreads.473--473.bam out.subreads.lima.guess
out.subreads.059--059.bam out.subreads.088--088.bam.pbi out.subreads.125--125.subreadset.xml out.subreads.188--188.bam out.subreads.245--245.bam.pbi out.subreads.265--265.subreadset.xml out.subreads.317--317.bam out.subreads.473--473.bam.pbi out.subreads.lima.report
out.subreads.059--059.bam.pbi out.subreads.088--088.subreadset.xml out.subreads.143--143.bam out.subreads.188--188.bam.pbi out.subreads.245--245.subreadset.xml out.subreads.273--273.bam out.subreads.317--317.bam.pbi out.subreads.473--473.subreadset.xml out.subreads.lima.summary
out.subreads.059--059.subreadset.xml out.subreads.090--090.bam out.subreads.143--143.bam.pbi out.subreads.188--188.subreadset.xml out.subreads.249--249.bam out.subreads.273--273.bam.pbi out.subreads.317--317.subreadset.xml out.subreads.479--479.bam out.subreads.subreadset.xml
out.subreads.060--060.bam out.subreads.090--090.bam.pbi out.subreads.143--143.subreadset.xml out.subreads.192--192.bam out.subreads.249--249.bam.pbi out.subreads.273--273.subreadset.xml out.subreads.321--321.bam out.subreads.479--479.bam.pbi
所以我想发送这些文件和这个变量:059--059
out.subreads.059--059.bam
out.subreads.059--059.bam.pbi
out.subreads.059--059.subreadset.xml
目前我在工作流中的代码是:
process procA{
input:
file bc_fasta from bc_fasta_chan
output:
set file("$analysis_config.cell/bam/out.subreads.*"), val("$analysis_config.cell/bam/out.subreads.*") into lima_out
script:
```
// run script to generate the above generated files
```
}
process procB{
input:
set file(bc_bam_file), val(bc_name) from lima_out.flatten()
script:
"""
ls
echo ${bc_bam_file}
"""
}
最佳答案
诀窍是能够以某种方式从文件名中提取分组变量,然后调用 groupTuple .我刚刚使用了一个简单的正则表达式来获取这个变量,但如果需要,您可以实现更复杂的东西:
lima_out = Channel.fromPath( './files/out.subreads.*', relative: true )
subreads_pattern = ~/^out\.subreads\.(\d{3}--\d{3})\..*/
lima_out
.flatten()
.filter { it.name =~ subreads_pattern }
.map { tuple( (it.name =~ subreads_pattern)[0][1], it ) }
.groupTuple(size: 3, sort: true)
.view()
结果:
[489--489, [out.subreads.489--489.bam, out.subreads.489--489.bam.pbi, out.subreads.489--489.subreadset.xml]]
[316--316, [out.subreads.316--316.bam, out.subreads.316--316.bam.pbi, out.subreads.316--316.subreadset.xml]]
...
这是我如何将这些值输入到流程中的示例。我对处理伴随文件(在这种情况下,我们有扩展名为“.bam.pbi”的文件)的偏好是将它们与 BAM 文件放在一起。我只是为此使用一个元组。调用first()在我们的元组上,我们可以获得 BAM。不过,这只是我的偏好。您可以在 pbi 伴随文件的输入元组中有一个单独的文件/路径变量,但您可能不需要在脚本 block 中引用它。
lima_out = Channel.fromPath( './files/out.subreads.*', relative: true )
subreads_pattern = ~/^out\.subreads\.(\d{3}--\d{3})\..*/
lima_out
.flatten()
.filter { it.name =~ subreads_pattern }
.map { tuple( (it.name =~ subreads_pattern)[0][1], it ) }
.groupTuple(size: 3, sort: true)
.map { group_name, files -> tuple( group_name, files[2], files[0..1] ) }
.set { subreads_ch }
process next_process {
input:
tuple val(group), path(subreadset), path(indexed_subreads) from subreads_ch
"""
echo "subreadset XML: ${subreadset}"
echo "subreads BAM: ${indexed_subreads.first()}"
"""
}
关于python - Nextflow 在进程间操作变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65577430/
当我运行 nextflow 时,我得到一个 .nextflow 文件夹,但我找不到更改其位置的方法(即它不是 -work-dir).如何更改 .nextflow 文件夹的位置? 我看过 launchD
鉴于以下 nextflow.config : google { project = "cool-project" region = "europe-west4" l
我有一个输出多个文件的 nextflow 进程,如下所示: [chr1,/path/to/chr1_chunk1.TC.linear] [chr1,/path/to/chr1_chunk1.HDL.l
此处是 NextFlow 的新手,并且在一些基本概念上苦苦挣扎。我正在从 a previous publication 转换一组 bash 脚本进入 NextFlow 工作流程。 我正在转换 a si
如何将YAML格式的输入文件从一个参数传递到一个通道样本作为列表?如果有任何NextFlow功能或简单的解决方案来使通道样本工作,我将不胜感激!。--INPUT_LIST S3://my-Bucket
我有很多样本经历了一个有时会失败的过程(确定性地)。在这种情况下,我希望失败的进程停止,但所有其他样本仍然独立提交和处理。 如果我理解正确,设置 errorStrategy 'ignore' 将在失败
我正在重新设计一个工作流,基本上它从一个产生多个其他进程的进程开始。最初我在开始我的工作流程之前有变量,所以我制作了这些变量的元组,然后将它作为输入传递给流程。该进程获取每个值,并为元组中的每个值生成
我有一个 nextflow 脚本,它在单个 vcf 文件上运行几个进程。文件名为“bos_taurus.vcf”,位于目录/input_files/bos_taurus.vcf 中。目录 input_
我正在尝试在 Nextflow 管道中运行 Rscript。这个 Rscript 有一个包“ggolot2”。 我有这个错误: Error in library(ggplot2): there is
我有一个 Nextflow 进程,它使用 bash 脚本 ( check_bam.sh ) 生成文本文件。该文本文件内容的唯一选项是 0 或任何其他数字。我想提取该 0 或其他值并将其保存到 Next
我们正在尝试在默认的 k8s 命名空间上使用 nextflow,我们使用的命名空间是 nextflownamespace .我们已经创建了 PVC 并确保默认服务帐户具有管理员角色绑定(bind)。我
我有以下 nextflow 脚本: echo true
我正在 NextFlow 上执行分散-聚集操作。 它看起来像下面这样: reads = PATH+"test_1.fq" outdir = "results" split_read_ch = chan
当我使用 nextflow 提交作业时,其中一个进程失败,文件已损坏。显然我可以从工作列表中删除该文件,但我不希望将来在我扩大它时发生这种情况。默认情况下,这会停止所有其他进程 (9) 的运行,并且
如何在 nextflow 中执行 try catch? 我目前正在编写一个管道,我正在执行的 bash 命令可能会在某些条件下以退出代码 1 退出。这使我的管道陷入停顿。我现在想使用 try catc
我正在尝试运行此 pipeline ,它使用 Nextflow 实现并使用 Docker 容器。不幸的是,我不能使用 Docker,因为它不兼容 HPC(没有 sudo),所以我使用 Singular
我想要一个管道,它可以从一个名为“Input”的文件夹中接受这样的输入。文件的格式类似于“gene_KOs1.tsv gene_KOs2.tsv Mutations1.tsv Mutations2.t
我正在尝试制作一个使用 python 脚本的 Nextflow 脚本。我的 python 脚本导入了许多模块,但在 Nextflow python3 中找不到 7 个模块中的两个(cv2 和 matp
Nextflow 允许高效地制作复杂的管道。有些人只能通过视觉来理解事物,因此制作良好的图形表示很重要。在 nextflow 中这样做的方法是通过 -with-dag 命令: nextflow run
我正在尝试使用 nextflow 和 docker 运行 python 脚本。我正在使用 dockerfile(如下所示)来创建 docker 镜像。 Nextflow 脚本有一个简单的 python
我是一名优秀的程序员,十分优秀!