Shrink-Mgf Class#

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

Bases: BaseStep

Only takes the first n compounds of each given .mgf file. Good for debugging.

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]#

Processes the input_files given the parameters set in install and setup. The step will write to output_path.

Parameters:
  • input_files (list[Path]) – List of input files for the step.

  • output_path (Path) – Scoped folder where step will write to.

  • 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.

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

Returns:

List of all files produced.

Return type:

list[Path]

Example:

>>> run(["foo.txt, bar.txt"], Path(), Store(...), Store(...), Logger(...))
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"