Skip to content

Commit

Permalink
added create_fake_mzml_files and removed the need for teh spectra input
Browse files Browse the repository at this point in the history
  • Loading branch information
VinzentRisch committed Jan 31, 2025
1 parent 91df31e commit 140983f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion q2_ms/assets/group_peaks_density.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ library(optparse)

# Define command-line options
option_list <- list(
make_option(opt_str = "--spectra", type = "character"),
make_option(opt_str = "--xcms_experiment", type = "character"),
make_option(opt_str = "--bw", type = "numeric"),
make_option(opt_str = "--min_fraction", type = "numeric"),
Expand Down
2 changes: 0 additions & 2 deletions q2_ms/plugin_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@
plugin.methods.register_function(
function=group_peaks_density,
inputs={
"spectra": SampleData[mzML],
"xcms_experiment": XCMSExperiment % Properties("RT_adjusted"),
},
outputs=[("xcms_experiment_grouped", XCMSExperiment % Properties("Grouped"))],
Expand All @@ -272,7 +271,6 @@
"threads": Int,
},
input_descriptions={
"spectra": "Spectra data as mzML files.",
"xcms_experiment": "XCMSExperiment object with chromatographic peak "
"information and adjusted retention time.",
},
Expand Down
7 changes: 5 additions & 2 deletions q2_ms/xcms/group_peaks_density.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import copy

from q2_ms.types import XCMSExperimentDirFmt, mzMLDirFmt
from q2_ms.types import XCMSExperimentDirFmt
from q2_ms.utils import run_r_script
from q2_ms.xcms.utils import create_fake_mzml_files


def group_peaks_density(
spectra: mzMLDirFmt,
xcms_experiment: XCMSExperimentDirFmt,
bw: float = 30,
min_fraction: float = 0.5,
Expand All @@ -15,6 +15,9 @@ def group_peaks_density(
threads: int = 1,
ms_level: int = 1,
) -> XCMSExperimentDirFmt:
# Create fake mzML files to make the xcms experiment object import possible
create_fake_mzml_files(str(xcms_experiment))

# Create parameters dict
params = copy.copy(locals())

Expand Down

0 comments on commit 140983f

Please sign in to comment.