diff --git a/nextflow/maxquant_psm.nf b/nextflow/maxquant_psm.nf new file mode 100644 index 0000000..f849ccd --- /dev/null +++ b/nextflow/maxquant_psm.nf @@ -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} + """ + } +} diff --git a/quantmsio/commands/diann_command.py b/quantmsio/commands/diann_command.py index 3d1c561..82d947e 100644 --- a/quantmsio/commands/diann_command.py +++ b/quantmsio/commands/diann_command.py @@ -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 diff --git a/quantmsio/commands/feature_command.py b/quantmsio/commands/feature_command.py index b3f2221..fcc7889 100644 --- a/quantmsio/commands/feature_command.py +++ b/quantmsio/commands/feature_command.py @@ -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: diff --git a/quantmsio/commands/maxquant_command.py b/quantmsio/commands/maxquant_command.py index 082e16d..7dcb697 100644 --- a/quantmsio/commands/maxquant_command.py +++ b/quantmsio/commands/maxquant_command.py @@ -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") @@ -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") diff --git a/quantmsio/commands/psm_command.py b/quantmsio/commands/psm_command.py index 0f88a99..7d7023f 100644 --- a/quantmsio/commands/psm_command.py +++ b/quantmsio/commands/psm_command.py @@ -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")