Jonas S
02/19/2025, 10:25 AMimport java.io.BufferedReader
import java.io.FileReader
// Define a function to count lines in a file using BufferedReader
def countLines(filePath) {
def lineCount = 0
new BufferedReader(new FileReader(filePath)).withCloseable { reader ->
while (reader.readLine() != null) {
lineCount++
}
}
return lineCount
}
// Use the filter channel operator with a closure to check the line count
OPENMS_IDFILTER_FOR_SPECLIB(ch_fdrfilter_comet_idxml)
.filtered
.filter { meta, idxml -> countLines(idxml.toString()) >= 130 }
.set { ch_filtered_idxml_for_speclib }Jim Downie
02/19/2025, 10:27 AMcountLines function won't do?
https://www.nextflow.io/docs/latest/reference/stdlib.html#splitting-filesJonas S
02/19/2025, 10:40 AMJim Downie
02/19/2025, 10:41 AM.gz extension or you pass the argument decompress: truePhil Ewels
03/05/2025, 9:32 AM.fastq.gz files into your pipeline, the Nextflow head job is gonna go sloooow.
Also those files will need to be staged to the tmp directory if they're not local, which can fill up local disk space.Phil Ewels
03/05/2025, 9:33 AMJim Downie
03/05/2025, 9:34 AMJim Downie
03/05/2025, 9:39 AMPhil Ewels
03/05/2025, 9:44 AM