MZmine3 Class#

class expectmine.steps.steps.mzmine3.mzmine3.MZmine3(**kwargs: Dict[Any, Any])[source]#

Bases: BaseStep

MZmine3 Batch step. The idea is the following: provide the step with a batchfile, give the step some input data in form of .mzml files and pipe the output to the next step.

Important: It is best to not provide the step with input and output steps. If input is provided, the step just changes all input paths to the provided paths of the step. in output, it works a bit differently. There only the sirius output step is rewritten, the rest is left untouched.

classmethod can_run(input_files: list[str]) bool[source]#

Indicates weather the step can run on a given list of inputs. This method is used for the autosuggestion of possible next steps.

Parameters:

input_files (list[str]) – List of input files for the step

Example:

>>> can_run(["test.mzml", "test2.mzml", "data.txt"])
False
>>> can_run(["test.mzml", "test2.mzml"])
True
classmethod citation_and_disclaimer() str[source]#

Generates all necessary citations and disclaimers.

Returns:

A multiline string with necessary citation and disclaimers.

Return type:

string

install(persistent_store: BaseStore, io: BaseIo, logger: BaseLogger)[source]#

Verifies that all necessary prerequisites to the method have been properly installed. If not the method can take action and install the files, methods or executables on its own.

Parameters:
  • persistent_store (BaseStore) – Persistent store which saves all step necessary parameters. The data stored will be available to all executions of the same step.

  • io (BaseIo) – Gives the step access to query data from the user.

  • logger (BaseLogger) – Gives the step access to log information about its execution.

Example:

>>> install(Store(...), Io(...), Logger(...))
metadata(persistent_store: BaseStore, volatile_store: BaseStore) dict[str, object][source]#

Produces metadata about the past run.

Parameters:
  • persistent_store – Persistent store which saves all step necessary parameters. The data stored will be available to all executions of the same step.

  • volatile_store (BaseStore) – Volatile store which saves all step necessary execution parameters. The data stored will only be available to this instance of the step.

Returns:

Dict with all metadata in it.

Return type:

dict[str, object]

Example:

>>> metadata(Store(...), Store(...))
{ "python": 3.10 }
classmethod output_filetypes(input_files: list[str]) list[str][source]#

Returns a list of possible output file-extensions.

NOTE: This method currently under development and can return an over or under-defined set of file extensions. Also, we currently do not rely on internal state to narrow the list of possible output file formats

Parameters:

input_files (list[str]) – List of input files for the step

Returns:

A list of output files for the step.

Return type:

list[str]

Example:

>>> output_filetypes(["test.mzml", "test2.mzml"])
["test.txt", "test2.txt"]
run(input_files: list[Path], output_path: Path, persistent_store: BaseStore, volatile_store: BaseStore, logger: BaseLogger) list[Path][source]#

INFO: The following step should work as following:

  1. Check if it has no import if no, monkeypatch import.

  2. Check if ms2 import is used, if yes, update files.

  3. Update files in import step.

  4. Update files in export step -> change current_file

  1. Run step with batchfile

setup(volatile_store: BaseStore, io: BaseIo, logger: BaseLogger)[source]#

Sets the step up to run with a specific configuration only available to this step instance. Purpose of this method is to set parameters for the step to correctly process the input data.

Parameters:
  • volatile_store (BaseStore) – Volatile store which saves all step necessary execution parameters. The data stored will only be available to this instance of the step.

  • io (BaseIo) – Gives the step access to query data from the user.

  • logger (BaseLogger) – Gives the step access to log information about its execution.

Example:

>>> setup(Store(...), Io(...), Logger(...))
classmethod step_name() str[source]#

Returns the name of the step instance.

Example:

>>> step_name()
"BaseStep"