Ilaria Pirona
02/05/2026, 9:01 AM#!/usr/bin/env nextflow
workflow {
chrlist = Channel.fromPath("<s3://path/to/the/file/bed.bed.gz>")
.splitText(decompress: true) { line -> line.split().first() }
.filter { chr -> chr.matches('^chr([1-9]|1[0-9]|2[0-2]|X|Y|M|MT)$') }
.unique()
.toList()
.view()
chrlist.size().view()
}Thomas Danhorn
02/16/2026, 8:10 AMprocess (e.g. with zgrep -oP, you already have the regex, just replace the $ with \t and pipe into uniq. (If your grep doesn't have -P, use a literal TAB and -E.)