-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #349 from jonasscheid/generate_speclib
Generate spectrum library using EasyPQP
- Loading branch information
Showing
14 changed files
with
30,827 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Nextflow config file for running minimal tests | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Defines input files and everything required to run a fast and simple pipeline test. | ||
Use as follows: | ||
nextflow run nf-core/mhcquant -profile test,<docker/singularity> --outdir <OUTDIR> | ||
---------------------------------------------------------------------------------------- | ||
*/ | ||
|
||
process { | ||
resourceLimits = [ | ||
cpus: 2, | ||
memory: '6.GB', | ||
time: '2.h' | ||
] | ||
} | ||
|
||
params { | ||
config_profile_name = 'Test profile' | ||
config_profile_description = 'Minimal test dataset to check pipeline function' | ||
|
||
// Input data | ||
input = params.pipelines_testdata_base_path + 'mhcquant/testdata/HepG2_sample_sheet.tsv' | ||
fasta = params.pipelines_testdata_base_path + 'mhcquant/testdata/UP000005640_9606.fasta' | ||
generate_speclib = true | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
process EASYPQP_CONVERT { | ||
tag "$meta.id" | ||
label 'process_single' | ||
|
||
conda "bioconda::easypqp=0.1.50" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/easypqp:0.1.50--pyhdfd78af_1' : | ||
'biocontainers/easypqp:0.1.50--pyhdfd78af_1' }" | ||
|
||
input: | ||
tuple val(meta), path(pepxml), path(spectra) | ||
path unimod | ||
|
||
output: | ||
tuple val(meta), path("*.psmpkl") , emit: psmpkl | ||
tuple val(meta), path("*.peakpkl"), emit: peakpkl | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
def args = task.ext.args ?: '' | ||
|
||
""" | ||
export MPLCONFIGDIR=/tmp/matplotlib | ||
export XDG_CACHE_HOME=/tmp/fontconfig-cache | ||
mkdir -p \$MPLCONFIGDIR \$XDG_CACHE_HOME | ||
easypqp convert \\ | ||
--pepxml $pepxml \\ | ||
--spectra $spectra \\ | ||
--unimod $unimod \\ | ||
$args | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
easypqp: \$(easypqp --version 2>&1 | sed 's/easypqp, version //; s/Using.*\$//') | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
|
||
""" | ||
export MPLCONFIGDIR=/tmp/matplotlib | ||
export XDG_CACHE_HOME=/tmp/fontconfig-cache | ||
mkdir -p \$MPLCONFIGDIR \$XDG_CACHE_HOME | ||
touch "${prefix}.psmpkl" | ||
touch "${prefix}.peakpkl" | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
easypqp: \$(easypqp --version 2>&1 | sed 's/easypqp, version //; s/Using.*\$//') | ||
END_VERSIONS | ||
""" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
process EASYPQP_LIBRARY { | ||
tag "$meta.id" | ||
label 'process_single' | ||
|
||
conda "bioconda::easypqp=0.1.50" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/easypqp:0.1.50--pyhdfd78af_1' : | ||
'biocontainers/easypqp:0.1.50--pyhdfd78af_1' }" | ||
|
||
input: | ||
tuple val(meta), path(psmpkl), path(peakpkl) | ||
|
||
output: | ||
tuple val(meta), path("*.tsv") , emit: tsv | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
|
||
""" | ||
export MPLCONFIGDIR=/tmp/matplotlib | ||
export XDG_CACHE_HOME=/tmp/fontconfig-cache | ||
mkdir -p \$MPLCONFIGDIR \$XDG_CACHE_HOME | ||
easypqp library \ | ||
--out ${prefix}_speclib.tsv \ | ||
$args \ | ||
$psmpkl $peakpkl | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
easypqp: \$(easypqp --version 2>&1 | sed 's/easypqp, version //; s/Using.*\$//') | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
|
||
""" | ||
export MPLCONFIGDIR=/tmp/matplotlib | ||
export XDG_CACHE_HOME=/tmp/fontconfig-cache | ||
mkdir -p \$MPLCONFIGDIR \$XDG_CACHE_HOME | ||
touch "${prefix}_speclib.tsv" | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
easypqp: \$(easypqp --version 2>&1 | sed 's/easypqp, version //; s/Using.*\$//') | ||
END_VERSIONS | ||
""" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* Generates spectrum library for DIA-based searches | ||
*/ | ||
|
||
// | ||
// MODULE: Loaded from modules/local/ | ||
// | ||
|
||
include { EASYPQP_CONVERT } from '../../modules/local/easypqp/convert' | ||
include { EASYPQP_LIBRARY; | ||
EASYPQP_LIBRARY as EASYPQP_LIBRARY_GLOBAL } from '../../modules/local/easypqp/library' | ||
|
||
// | ||
// MODULE: Installed directly from nf-core/modules | ||
// | ||
|
||
workflow SPECLIB { | ||
|
||
take: | ||
fdrfiltered_comet_idxml | ||
mzml | ||
|
||
main: | ||
ch_versions = Channel.empty() | ||
|
||
// Load unimod tables (Future:) | ||
unimod = file("$projectDir/assets/250120_unimod_tables.xml", checkIfExists: true) | ||
|
||
// Convert psms and spectra to pickle files | ||
EASYPQP_CONVERT(fdrfiltered_comet_idxml.join(mzml), unimod) | ||
ch_versions = ch_versions.mix(EASYPQP_CONVERT.out.versions) | ||
|
||
EASYPQP_CONVERT.out.psmpkl | ||
.map { meta, psmpkl -> [groupKey([id: "${meta.sample}_${meta.condition}"], meta.group_count), psmpkl] } | ||
.groupTuple() | ||
.set { ch_psmpkl } | ||
EASYPQP_CONVERT.out.peakpkl | ||
.map { meta, peakpkl -> [groupKey([id: "${meta.sample}_${meta.condition}"], meta.group_count), peakpkl] } | ||
.groupTuple() | ||
.set { ch_peakpkl } | ||
|
||
// Generate spectrum library for each sample-condition pair | ||
EASYPQP_LIBRARY(ch_psmpkl.join(ch_peakpkl)) | ||
ch_versions = ch_versions.mix(EASYPQP_LIBRARY.out.versions) | ||
|
||
// Generate spectrum library for all MSruns in the samplesheet | ||
if (params.global_fdr) { | ||
EASYPQP_CONVERT.out.psmpkl | ||
.map { meta, psmpkl -> [[id: "global"], psmpkl] } | ||
.groupTuple() | ||
.set { ch_global_psmpkl } | ||
EASYPQP_CONVERT.out.peakpkl | ||
.map { meta, peakpkl -> [[id: "global"], peakpkl] } | ||
.groupTuple() | ||
.set { ch_global_peakpkl } | ||
EASYPQP_LIBRARY_GLOBAL(ch_global_psmpkl.join(ch_global_peakpkl)) | ||
} | ||
|
||
emit: | ||
versions = ch_versions | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters