Skip to content

Commit

Permalink
fix multiple decoy db generation if only one is given
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasscheid committed Jan 3, 2024
1 parent d00d9b5 commit 1c092c4
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 21 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Adding MS²Rescore module with the underlying python CLI [#288](https://github.com/nf-core/mhcquant/issues/288)

### `Fixed`

- Create only one decoy database [#287](https://github.com/nf-core/mhcquant/issues/287)

### `Deprecated`

- Removed MS²PIP and DeepLC modules. These feature generators are now called via the MS²Rescore framework
Expand Down
49 changes: 28 additions & 21 deletions workflows/mhcquant.nf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ WorkflowMhcquant.initialise(params, log)

// Input/output options
if (params.input) { sample_sheet = file(params.input) }
if (params.fasta) { params.fasta = params.fasta }
if (params.fasta) { params.fasta = params.fasta }

// MHC affinity prediction
if (params.predict_class_1 || params.predict_class_2) {
Expand Down Expand Up @@ -152,32 +152,32 @@ workflow MHCQUANT {

// Input fasta file
Channel.fromPath(params.fasta)
.combine(INPUT_CHECK.out.ms_runs)
.map{ fasta, meta, ms_file -> [meta.subMap('id', 'sample', 'condition'), fasta] }
.ifEmpty { exit 1, "params.fasta was empty - no input file supplied" }
.set { input_fasta }
.map{ fasta -> [[id:fasta.getBaseName()], fasta] }
.ifEmpty { error ("params.fasta was empty - no input file supplied") }
.set { fasta_file }

//
// SUBWORKFLOW: Include protein information
//
if (params.include_proteins_from_vcf) {
// Include the proteins from the vcf file to the fasta file
INCLUDE_PROTEINS(input_fasta)
ch_versions = ch_versions.mix(INCLUDE_PROTEINS.out.versions.ifEmpty(null))
ch_fasta_file = INCLUDE_PROTEINS.out.ch_fasta_file
ch_vcf_from_sheet = INCLUDE_PROTEINS.out.ch_vcf_from_sheet
} else {
ch_fasta_file = input_fasta
ch_vcf_from_sheet = Channel.empty()
}

// TODO: Temporary disabled because of outdated vcf parsing
//if (params.include_proteins_from_vcf) {
// // Include the proteins from the vcf file to the fasta file
// INCLUDE_PROTEINS(fasta_file)
// ch_versions = ch_versions.mix(INCLUDE_PROTEINS.out.versions)
// ch_fasta_file = INCLUDE_PROTEINS.out.ch_fasta_file
// ch_vcf_from_sheet = INCLUDE_PROTEINS.out.ch_vcf_from_sheet
//} else {
// ch_fasta_file = fasta_file
// ch_vcf_from_sheet = Channel.empty()
//}
if (!params.skip_decoy_generation) {
// Generate reversed decoy database
OPENMS_DECOYDATABASE(ch_fasta_file)
ch_versions = ch_versions.mix(OPENMS_DECOYDATABASE.out.versions.ifEmpty(null))
OPENMS_DECOYDATABASE(fasta_file)
ch_versions = ch_versions.mix(OPENMS_DECOYDATABASE.out.versions)
ch_decoy_db = OPENMS_DECOYDATABASE.out.decoy
.map{ meta, fasta -> [fasta] }
} else {
ch_decoy_db = ch_fasta_file
ch_decoy_db = fasta_file.map{ meta, fasta -> [fasta] }
}

// If mzml files are specified, they are encapsulated in a list [meta, [mzml]]. We need to extract the path for grouping later
Expand Down Expand Up @@ -211,10 +211,17 @@ workflow MHCQUANT {
}

// Run comet database search
OPENMS_COMETADAPTER(ch_clean_mzml_file.join(ch_decoy_db, remainder:true))
// TODO: Fix accordingly with vcf parsing
//if (params.include_proteins_from_vcf) {
// OPENMS_COMETADAPTER(ch_clean_mzml_file.join(ch_decoy_db, remainder:true))
//} else {
// OPENMS_COMETADAPTER(ch_clean_mzml_file.combine(ch_fasta_file.map{ meta, fasta -> [fasta] }))
//}
OPENMS_COMETADAPTER(ch_clean_mzml_file.combine(ch_decoy_db))
ch_versions = ch_versions.mix(OPENMS_COMETADAPTER.out.versions)

// Index decoy and target hits
OPENMS_PEPTIDEINDEXER(OPENMS_COMETADAPTER.out.idxml.join(ch_decoy_db))
OPENMS_PEPTIDEINDEXER(OPENMS_COMETADAPTER.out.idxml.combine(ch_decoy_db))
ch_versions = ch_versions.mix(OPENMS_PEPTIDEINDEXER.out.versions.ifEmpty(null))

// Save indexed runs for later use to keep meta-run information. Sort based on file id
Expand Down

0 comments on commit 1c092c4

Please sign in to comment.