Skip to content

Commit

Permalink
update: nextflow
Browse files Browse the repository at this point in the history
  • Loading branch information
zprobot committed Nov 19, 2024
1 parent b791359 commit f4d1bce
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 5 deletions.
50 changes: 50 additions & 0 deletions nextflow/maxquant_psm.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
nextflow.enable.dsl=2

params.msms_file
params.mzml_dir
params.output_dir
params.chunksize = 1000000
params.output_prefix_file = "psm"
params.file_num = 20
params.partitions = ""

workflow {
generateResults(params.msms_file, params.output_dir, params.chunksize, params.output_prefix_file)
extractInfoFromMzml(generateResults.out, params.mzml_dir, params.output_dir, params.file_num, params.partitions)

}
process generateResults {
input:
path msmsFile
path outputDir
val chunksize
val output_prefix_file

output:
path "**/*.psm.parquet", emit: 'psm'

script:
"""
quantmsioc convert-maxquant-psm --msms_file ${msmsFile} --output_folder ${outputDir} --chunksize ${chunksize} --output_prefix_file ${output_prefix_file}
"""
}

process extractInfoFromMzml {
input:
path resultsFile
path mzmlDir
path outputDir
val file_num
val partitions

script:
if (partitions != ''){
"""
quantmsioc map-spectrum-message-to-parquet --parquet_path ${resultsFile} --mzml_directory ${mzmlDir} --output_folder res/${outputDir} --file_num ${file_num} --partitions ${partitions}
"""
}else {
"""
quantmsioc map-spectrum-message-to-parquet --parquet_path ${resultsFile} --mzml_directory ${mzmlDir} --output_folder res/${outputDir} --file_num ${file_num}
"""
}
}
2 changes: 1 addition & 1 deletion quantmsio/commands/diann_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def diann_convert_to_parquet(
os.makedirs(output_folder)

if not output_prefix_file:
output_prefix_file = ""
output_prefix_file = "feature"
filename = create_uuid_filename(output_prefix_file, ".feature.parquet")
feature_output_path = output_folder + "/" + filename

Expand Down
2 changes: 1 addition & 1 deletion quantmsio/commands/feature_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def convert_feature_file(
raise click.UsageError("Please provide all the required parameters")
feature_manager = Feature(mzTab_path=mztab_file, sdrf_path=sdrf_file, msstats_in_path=msstats_file)
if not output_prefix_file:
output_prefix_file = ""
output_prefix_file = "feature"
filename = create_uuid_filename(output_prefix_file, ".feature.parquet")
output_path = output_folder + "/" + filename
if not partitions:
Expand Down
4 changes: 2 additions & 2 deletions quantmsio/commands/maxquant_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def convert_maxquant_psm(
raise click.UsageError("Please provide all the required parameters")

if not output_prefix_file:
output_prefix_file = ""
output_prefix_file = "psm"

MQ = MaxQuant()
output_path = output_folder + "/" + create_uuid_filename(output_prefix_file, ".psm.parquet")
Expand Down Expand Up @@ -114,7 +114,7 @@ def convert_maxquant_feature(
raise click.UsageError("Please provide all the required parameters")

if not output_prefix_file:
output_prefix_file = ""
output_prefix_file = "feature"

MQ = MaxQuant()
filename = create_uuid_filename(output_prefix_file, ".feature.parquet")
Expand Down
2 changes: 1 addition & 1 deletion quantmsio/commands/psm_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def convert_psm_file(
raise click.UsageError("Please provide all the required parameters")

if not output_prefix_file:
output_prefix_file = ""
output_prefix_file = "psm"

psm_manager = Psm(mzTab_path=mztab_file)
output_path = output_folder + "/" + create_uuid_filename(output_prefix_file, ".psm.parquet")
Expand Down

0 comments on commit f4d1bce

Please sign in to comment.