@@ -19,16 +19,25 @@ nextflow_pipeline {
1919 def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}'])
2020 // stable_path: All files in ${params.outdir}/ with stable content
2121 def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore')
22- // Count peptidoforms from result TSV files (non-deterministic due to MS2Rescore/Percolator FDR )
23- def totalPeptidoforms = 0
22+ // Extract peptidoform column from result TSV files (qe and lumos groups )
23+ def peptidoform_data = []
2424 new File(params.outdir).eachFileRecurse { file ->
2525 if (file.name.endsWith('.tsv') && file.parentFile.path == params.outdir) {
2626 def lines = file.readLines()
27- if (lines.size() > 1) {
28- totalPeptidoforms += lines.size() - 1
27+ if (lines.size() > 0) {
28+ def header = lines[0].split('\t')
29+ def peptidoformIndex = header.findIndexOf { it == 'peptidoform' }
30+ if (peptidoformIndex >= 0) {
31+ def peptidoforms = lines.drop(1).collect { line ->
32+ def fields = line.split('\t')
33+ fields.size() > peptidoformIndex ? fields[peptidoformIndex] : ''
34+ }.findAll { it != '' }.sort()
35+ peptidoform_data.add([file.name, peptidoforms])
36+ }
2937 }
3038 }
3139 }
40+ peptidoform_data.sort { it[0] }
3241 assertAll(
3342 { assert workflow.success},
3443 { assert snapshot(
@@ -37,11 +46,10 @@ nextflow_pipeline {
3746 // All stable path name, with a relative path
3847 stable_name,
3948 // All files with stable contents
40- stable_path
41- ).match() },
42- // MS2Rescore is non-deterministic, so exact peptide lists vary between runs.
43- // Check that at least one preset group produced peptides (FDR < 0.01).
44- { assert totalPeptidoforms >= 100 : "Expected at least 100 peptidoforms across all groups, got ${totalPeptidoforms}" }
49+ stable_path,
50+ // Peptidoform data from result TSV files
51+ peptidoform_data
52+ ).match() }
4553 )
4654 }
4755 }
0 commit comments