Skip to content

Commit

Permalink
Merge pull request #15 from bigbio/dev
Browse files Browse the repository at this point in the history
u
  • Loading branch information
daichengxin authored Aug 6, 2022
2 parents 183588f + 4141176 commit 8342adf
Show file tree
Hide file tree
Showing 6 changed files with 681 additions and 30 deletions.
654 changes: 634 additions & 20 deletions bin/diann_convert.py

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,13 @@ process {

// IDFILTER on PROTEIN LEVEL
level = params.protein_quant == 'strictly_unique_peptides' ? 'prot' : 'protgroup'
decoys_present = params.quantify_decoys ? ' ' : '-remove_decoys'
withName: '.*:TMT:PROTEININFERENCE:IDFILTER' {
ext.args = [
"-score:${level} \"$params.protein_level_fdr_cutoff\"",
"-score:pep \"$params.psm_level_fdr_cutoff\"",
"-delete_unreferenced_peptide_hits",
"-remove_decoys"
"${decoys_present}"
].join(' ').trim()
ext.suffix = '.consensusXML'
publishDir = [
Expand Down
27 changes: 20 additions & 7 deletions modules/local/diannconvert/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,48 @@ process DIANNCONVERT {
tag "$exp_design.Name"
label 'process_low'

conda (params.enable_conda ? "conda-forge::pandas_schema bioconda::sdrf-pipelines=0.0.21" : null)
conda (params.enable_conda ? "conda-forge::pandas_schema conda-forge::lzstring bioconda::pmultiqc=0.0.13" : null)
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/sdrf-pipelines:0.0.21--pyhdfd78af_0"
container "https://depot.galaxyproject.org/singularity/pmultiqc:0.0.13--pyhdfd78af_0"
} else {
container "quay.io/biocontainers/sdrf-pipelines:0.0.21--pyhdfd78af_0"
container "quay.io/biocontainers/pmultiqc:0.0.13--pyhdfd78af_0"
}

input:
path(report)
path(exp_design)
path(report_pg)
path(report_pr)
val(meta)
path(fasta)

output:
path "*msstats_in.csv", emit: out_msstats
path "*triqler_in.tsv", emit: out_triqler
path "*.mztab", emit: out_mztab
path "versions.yml", emit: version

script:
def args = task.ext.args ?: ''
def dia_params = [meta.fragmentmasstolerance,meta.fragmentmasstoleranceunit,meta.precursormasstolerance,
meta.precursormasstoleranceunit,meta.enzyme,meta.fixedmodifications,meta.variablemodifications].join(';')

"""
diann_convert.py convert \\
--diann_report ${report} \\
--exp_design ${exp_design} \\
--diann_report "${report}" \\
--exp_design "${exp_design}" \\
--pg_matrix "${report_pg}" \\
--pr_matrix "${report_pr}" \\
--dia_params "${dia_params}" \\
--fasta "${fasta}" \\
--charge $params.max_precursor_charge \\
--missed_cleavages $params.allowed_missed_cleavages \\
--qvalue_threshold $params.protein_level_fdr_cutoff \\
|& tee trans_to_msstats.log
|& tee convert_report.log
cat <<-END_VERSIONS > versions.yml
"${task.process}":
sdrf-pipelines: \$(echo "0.0.21")
pyopenms: \$(echo "2.8.0")
END_VERSIONS
"""
}
23 changes: 22 additions & 1 deletion modules/local/diannconvert/meta.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: DIANNCONVERT
description: A module to convert DIA report files to MSstats
description: A module to convert DIA report files to MSstats, Triqler and mzTab
keywords:
- DIA-NN
- conversion
- MSstats
- Triqler
- mzTab
tools:
- custom:
description: |
Expand All @@ -20,6 +21,21 @@ input:
type: file
description: An experimental design file including Sample and replicates column et al.
pattern: "*.tsv"
- report_pr:
type: file
description: A text table containing normalized quantities for precursors. They are filtered at 1% FDR, using both global and run-specific q-values for precursors
pattern: "*pr_matrix.tsv"
- report_pg:
type: file
description: A text table containing normalized quantities for protein groups. They are filtered at 1% FDR, using global q-values for protein groups
pattern: "*pg_matrix.tsv"
- meta:
type: map
description: Groovy Map containing sample information
- fasta:
type: file
description: Protein sequence database in Fasta format.
pattern: "*.{fasta,fa}"
output:
- out_msstats:
type: file
Expand All @@ -29,9 +45,14 @@ output:
type: file
description: Triqler input file
pattern: "out_triqler.tsv"
- out_mztab:
type: file
description: mzTab
pattern: "*.mztab"
- version:
type: file
description: File containing software version
pattern: "versions.yml"
authors:
- "@daichengxin"
- "@wanghong"
1 change: 1 addition & 0 deletions modules/local/diannsummary/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ process DIANNSUMMARY {
path "diann_report.pr_matrix.tsv", emit: pr_matrix
path "diann_report.pg_matrix.tsv", emit: pg_matrix
path "diann_report.gg_matrix.tsv", emit: gg_matrix
path "diann_report.unique_genes_matrix.tsv", emit: unique_gene_matrix
path "diannsummary.log", emit: log
path "versions.yml", emit: version

Expand Down
3 changes: 2 additions & 1 deletion workflows/dia.nf
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ workflow DIA {
//
// MODULE: DIANNCONVERT
//
DIANNCONVERT(DIANNSUMMARY.out.main_report, ch_expdesign)
DIANNCONVERT(DIANNSUMMARY.out.main_report, ch_expdesign, DIANNSUMMARY.out.pg_matrix, DIANNSUMMARY.out.pr_matrix,
ch_result.meta.first(), params.database)
ch_software_versions = ch_software_versions.mix(DIANNCONVERT.out.version.ifEmpty(null))

//
Expand Down

0 comments on commit 8342adf

Please sign in to comment.