mass_automation.sample_identification package#

Submodules#

mass_automation.sample_identification.plot module#

mass_automation.sample_identification.plot.agglosamples(spectra_vecs, filenames, decoder, show=False, path=None)#

Plots dendrogram based on samples. Used to analyze similarities in spectra.

Parameters:
  • spectra_vecs (dict) – Dictionary, where keys are names of the spectra (typically mzXML file names) and values are numpy arrays with vector components.

  • filenames (list) – List with the filenames of required spectra.

  • decoder (list) – List with decoders, which use to characterize spectra (for example, “Green”, “Black” tea spectra)

  • path (str) – Path to the file, if you want to save dendrogram.

Raises:
  • ValueError

  • Incorrect decoder list sizes.

mass_automation.sample_identification.plot.plot_pca(spectra_vecs, required_keys, class_decoder, name_decoder, colormapper, dim_red='PCA', min_bin=0, max_bin=850, figsize=(12, 10), IsNameDecoder=False, path=None, show=True)#

Plots PCA or t-SNE graph.

Parameters:
  • spectra_vecs (dict) – Dictionary, where keys are names of the spectra (typically mzXML file names) and values are numpy arrays with vector components.

  • required_keys (list) – List of keys of spectra that should be plotted.

  • class_decoder (list) – List of spectra decoders by class.

  • name_decoder (list) – List of spectra decoders by name. Use strings.

  • colormapper (dict) – Dictionary, which gives each class a unique color.

  • dim_red (str) – Dimensionality reduction technique. Can be ‘PCA’ or ‘TSNE’. (default is ‘PCA’).

  • min_bin (int) – Number of the first component of spectra that go through PCA. (default is 0).

  • max_bin (int) – Number of the last component of spectra that go through PCA. (default is 850)

  • figsize (tuple) – Plot size. (default is (12, 10)).

  • IsNameDecoder (bool) – If True name decoders are shown in the plot.

  • path (str) – Path to the file, if you want to save graph.

Raises:
  • ValueError

  • Incorrect decoder list sizes.

Module contents#