Skip to content

Commit 8867477

Browse files
committed
merge origin
2 parents 81d9698 + 6ea4f5f commit 8867477

File tree

23 files changed

+601
-48
lines changed

23 files changed

+601
-48
lines changed

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,5 @@ testing*
1212
bin/
1313
.nf-test/
1414
ro-crate-metadata.json
15-
.nf-test/
1615
modules/nf-core/
1716
subworkflows/nf-core/

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,15 @@
33
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
44
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
55

6-
## 3.2.0 - [releasename] - [date]
6+
## 3.2.0dev - [release name] - [date]
7+
8+
### `Added`
9+
10+
- Added support for single run quantification [#438](https://github.com/nf-core/mhcquant/pull/438)
11+
12+
### `Fixed`
13+
14+
- Fixed an issue where stripping the sequence in `SUMMARIZE_RESULTS` did not work for complex modifications [#436](https://github.com/nf-core/mhcquant/pull/436)
715

816
### `Changed`
917

bin/summarize_results.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import pandas as pd
66
import numpy as np
7+
from pyopenms import AASequence
78
from argparse import ArgumentParser
89
import re
910
from collections import Counter
@@ -87,6 +88,13 @@ def parse_multiTSV(file_path):
8788
df["psm"] = df["sequence"].map(psm)
8889
return df
8990

91+
def strip_modifications(seq_with_mods: str) -> str:
92+
try:
93+
aa_seq = AASequence.fromString(seq_with_mods)
94+
return aa_seq.toUnmodifiedString()
95+
except Exception as e:
96+
logging.warning(f"Could not parse sequence {seq_with_mods}: {e}")
97+
return seq_with_mods
9098

9199
def process_file(file, prefix, quantify, keep_cols):
92100
"""Extract all the relevant information and write it to a TSV file for the MultiQC report
@@ -122,7 +130,7 @@ def process_file(file, prefix, quantify, keep_cols):
122130

123131
# Remove modification information from the sequence column
124132
data["peptidoform"] = data["sequence"]
125-
data["sequence"] = data["sequence"].apply(lambda seq: re.sub(r'\(.*?\)', '', seq))
133+
data["sequence"] = data["sequence"].apply(strip_modifications)
126134

127135
# ---------------------------------
128136
# Length distribution plot

conf/modules.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,12 @@ process {
255255
]
256256
}
257257

258+
withName: 'OPENMS_FILECONVERTER' {
259+
publishDir = [
260+
enabled: false
261+
]
262+
}
263+
258264
withName: 'MULTIQC' {
259265
ext.args = { params.multiqc_title ? "--title \"$params.multiqc_title\"" : '' }
260266
publishDir = [

conf/test_single_quant.config

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* ----------------------------------------------------------------------------
3+
* Nextflow config file for running tests
4+
* ----------------------------------------------------------------------------
5+
* Defines bundled input files and everything required to run a fast and simple
6+
* pipeline test. Use as follows:
7+
* nextflow run main.nf -profile test_single_quant,<docker/singularity>
8+
* */
9+
10+
params {
11+
config_profile_name = 'Test single replicate profile'
12+
config_profile_description = 'Test dataset to check pipeline function for single replicate'
13+
14+
// Limit resources so that this can run on GitHub Actions
15+
max_cpus = 2
16+
max_memory = '6.GB'
17+
max_time = '6.h'
18+
19+
// Input data
20+
input = params.pipelines_testdata_base_path + 'mhcquant/testdata/sample_sheet_single_quant.tsv'
21+
22+
// Pipeline settings
23+
quantify = true
24+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: openms_fileconverter
2+
channels:
3+
- conda-forge
4+
- bioconda
5+
- defaults
6+
dependencies:
7+
- bioconda::openms=3.4.1
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
process OPENMS_FILECONVERTER {
2+
tag "$meta.id"
3+
label 'process_single'
4+
5+
conda "${moduleDir}/environment.yml"
6+
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
7+
'https://depot.galaxyproject.org/singularity/openms:3.4.1--h81ffffe_1' :
8+
'biocontainers/openms:3.4.1--h81ffffe_1' }"
9+
10+
input:
11+
tuple val(meta), path(file), val(suffix)
12+
13+
output:
14+
tuple val(meta), path("*.${suffix}"), emit: consensusxml
15+
path "versions.yml" , emit: versions
16+
17+
when:
18+
task.ext.when == null || task.ext.when
19+
20+
script:
21+
def prefix = task.ext.prefix ?: "${meta.id}"
22+
23+
"""
24+
FileConverter \\
25+
-in $file \\
26+
-out ${prefix}.${suffix} \\
27+
-threads $task.cpus
28+
29+
cat <<-END_VERSIONS > versions.yml
30+
"${task.process}":
31+
openms: \$(echo \$(FileInfo --help 2>&1) | sed 's/^.*Version: //; s/-.*\$//' | sed 's/ -*//; s/ .*\$//')
32+
END_VERSIONS
33+
"""
34+
35+
stub:
36+
def prefix = task.ext.prefix ?: "${meta.id}"
37+
38+
"""
39+
touch ${prefix}.${suffix}
40+
41+
cat <<-END_VERSIONS > versions.yml
42+
"${task.process}":
43+
openms: \$(echo \$(FileInfo --help 2>&1) | sed 's/^.*Version: //; s/-.*\$//' | sed 's/ -*//; s/ .*\$//')
44+
END_VERSIONS
45+
"""
46+
}

modules/nf-core/gunzip/tests/main.nf.test

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/nf-core/multiqc/tests/main.nf.test

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/nf-core/openms/filefilter/tests/main.nf.test

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)