Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update version #25

Merged
merged 16 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,14 @@ jobs:
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1

- name: Install micromamba
env:
MAMBA_ROOT_PREFIX: ${{ github.workspace }}/.micromamba
if: matrix.exec_profile == 'conda'
run: |
wget -qO- https://micromamba.snakepit.net/api/micromamba/linux-64/latest | tar -xvj bin/micromamba
echo "$(pwd)/bin" >> $GITHUB_PATH
echo "$(pwd)/micromamba/bin" >> $GITHUB_PATH
./bin/micromamba shell init -s bash -p ./micromamba
./bin/micromamba shell init -s bash
echo $'channels:\n - conda-forge\n - bioconda\n - defaults\nuse_lockfiles: false' >> ~/.mambarc

- name: Run pipeline with test data
Expand All @@ -72,6 +74,8 @@ jobs:
run: |
nextflow run ${GITHUB_WORKSPACE} -profile $TEST_PROFILE,$EXEC_PROFILE --outdir ${TEST_PROFILE}_${EXEC_PROFILE}_results
- name: Run pipeline with test data in conda profile (and single-threaded)
env:
MAMBA_ROOT_PREFIX: ${{ github.workspace }}/.micromamba
if: matrix.exec_profile == 'conda'
# TODO nf-core: You can customise CI pipeline run tests as required
# For example: adding multiple test runs with different parameters
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased] nfcore/quantms

### `Added`

- [#386](https://github.com/bigbio/quantms/pull/386) Make validation of ontology terms optional

### `Changed`

### `Fixed`

### `Dependencies`

### `Parameters`

- `validate_ontologies`: enable or disable validating ontologies in the input SDRF file.

## [1.3.0] nfcore/quantms - [08/04/2024] - Santiago de Cuba

### `Added`
Expand Down
27 changes: 17 additions & 10 deletions bin/check_samplesheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def parse_args(args=None):
parser = argparse.ArgumentParser(description=Description, epilog=Epilog)
parser.add_argument("SDRF", help="SDRF/Expdesign file to be validated")
parser.add_argument("ISSDRF", help="SDRF file or Expdesign file")
parser.add_argument("VALIDATE_ONTOLOGIES", help="Validate ontology terms.")
parser.add_argument("--CHECK_MS", help="check mass spectrometry fields in SDRF.", action="store_true")

return parser.parse_args(args)
Expand All @@ -44,20 +45,26 @@ def print_error(error, context="Line", context_str=""):
sys.exit(1)


def check_sdrf(check_ms, sdrf):
def check_sdrf(check_ms, sdrf, validate_ontologies):
df = SdrfDataFrame.parse(sdrf)
errors = df.validate(DEFAULT_TEMPLATE)
if check_ms:
errors = errors + df.validate(MASS_SPECTROMETRY)
for error in errors:
print(error)
if not errors:
print("Everying seems to be fine. Well done.")
if validate_ontologies:
errors = df.validate(DEFAULT_TEMPLATE)
if check_ms:
errors = errors + df.validate(MASS_SPECTROMETRY)
for error in errors:
print(error)
if not errors:
print("Everying seems to be fine. Well done.")
else:
print("There were validation errors!")
else:
print("There were validation errors!")
errors = False
print("No ontology term validation was performed.")

sys.exit(bool(errors))



def check_expdesign(expdesign):
data = pd.read_csv(expdesign, sep="\t", header=0, dtype=str)
data = data.dropna()
Expand Down Expand Up @@ -117,7 +124,7 @@ def main(args=None):
args = parse_args(args)

if args.ISSDRF == "true":
check_sdrf(args.CHECK_MS, args.SDRF)
check_sdrf(args.CHECK_MS, args.SDRF, args.VALIDATE_ONTOLOGIES == "true")
else:
check_expdesign(args.SDRF)

Expand Down
2 changes: 2 additions & 0 deletions bin/psm_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@


def mods_position(peptide):
if peptide.startswith("."):
peptide = peptide[1:]
pattern = re.compile(r"\((.*?)\)")
original_mods = pattern.findall(peptide)
peptide = re.sub(r"\(.*?\)", ".", peptide)
Expand Down
2 changes: 1 addition & 1 deletion modules/local/ms2rescore/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ process MS2RESCORE {
tag "$meta.mzml_id"
label 'process_high'

conda "bioconda::ms2rescore=3.0.3 bioconda::psm-utils=0.8.0 conda-forge::pydantic=1.10"
conda "bioconda::ms2rescore=3.0.3 bioconda::psm-utils=0.8.2 conda-forge::pydantic=1.10.14 pygam=0.9.1 bioconda::deeplc=2.2.27 bioconda::ms2pip=4.0.0.dev8 bioconda::deeplcretrainer=0.2.11 conda-forge::scikit-learn=1.4.2 conda-forge::scipy=1.13.0"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/ms2rescore:3.0.3--pyhdfd78af_0':
'biocontainers/ms2rescore:3.0.3--pyhdfd78af_0' }"
Expand Down
6 changes: 3 additions & 3 deletions modules/local/preprocess_expdesign.nf
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ process PREPROCESS_EXPDESIGN {
tag "$design.Name"
label 'process_low'

conda "bioconda::sdrf-pipelines=0.0.26"
conda "bioconda::sdrf-pipelines=0.0.27"
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/sdrf-pipelines:0.0.26--pyhdfd78af_0"
container "https://depot.galaxyproject.org/singularity/sdrf-pipelines:0.0.27--pyhdfd78af_0"
} else {
container "biocontainers/sdrf-pipelines:0.0.26--pyhdfd78af_0"
container "biocontainers/sdrf-pipelines:0.0.27--pyhdfd78af_0"
}

input:
Expand Down
9 changes: 5 additions & 4 deletions modules/local/samplesheet_check.nf
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ process SAMPLESHEET_CHECK {
tag "$input_file"
label 'process_single'

conda "bioconda::sdrf-pipelines=0.0.26"
conda "bioconda::sdrf-pipelines=0.0.27"
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/sdrf-pipelines:0.0.26--pyhdfd78af_0"
container "https://depot.galaxyproject.org/singularity/sdrf-pipelines:0.0.27--pyhdfd78af_0"
} else {
container "biocontainers/sdrf-pipelines:0.0.26--pyhdfd78af_0"
container "biocontainers/sdrf-pipelines:0.0.27--pyhdfd78af_0"
}

input:
path input_file
val is_sdrf
val validate_ontologies

output:
path "*.log", emit: log
Expand All @@ -27,7 +28,7 @@ process SAMPLESHEET_CHECK {
def args = task.ext.args ?: ''

"""
check_samplesheet.py "${input_file}" ${is_sdrf} --CHECK_MS 2>&1 | tee input_check.log
check_samplesheet.py "${input_file}" ${is_sdrf} ${validate_ontologies} --CHECK_MS 2>&1 | tee input_check.log

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
6 changes: 3 additions & 3 deletions modules/local/sdrfparsing/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ process SDRFPARSING {
tag "$sdrf.Name"
label 'process_low'

conda "conda-forge::pandas_schema bioconda::sdrf-pipelines=0.0.26"
conda "conda-forge::pandas_schema bioconda::sdrf-pipelines=0.0.27"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/sdrf-pipelines:0.0.26--pyhdfd78af_0' :
'biocontainers/sdrf-pipelines:0.0.26--pyhdfd78af_0' }"
'https://depot.galaxyproject.org/singularity/sdrf-pipelines:0.0.27--pyhdfd78af_0' :
'biocontainers/sdrf-pipelines:0.0.27--pyhdfd78af_0' }"

input:
path sdrf
Expand Down
1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ params {

// Input options
input = null
validate_ontologies = true

// Tools flags
posterior_probabilities = 'percolator'
Expand Down
6 changes: 6 additions & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@
"description": "Whether export PSM from decoy in final identification results",
"fa_icon": "far fa-check-square",
"help_text": "Whether export PSM from decoy in final identification results for dda_id subworkflow for specific cases."
},
"validate_ontologies": {
"type": "boolean",
"description": "Check that ontology terms in an input SDRF file exist.",
"fa_icon": "far fa-check-square",
"help_text": "If false, only a basic readability check is performed on an input SDRF file. This option is useful when ontology providers are inaccessible."
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion subworkflows/local/input_check.nf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ workflow INPUT_CHECK {
exit 1
}
}
SAMPLESHEET_CHECK ( input_file, is_sdrf )
SAMPLESHEET_CHECK ( input_file, is_sdrf, params.validate_ontologies )

emit:
ch_input_file = SAMPLESHEET_CHECK.out.checked_file
Expand Down
Loading