diff --git a/.buildinfo b/.buildinfo index 72419a0..3cc5e86 100644 --- a/.buildinfo +++ b/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 302aee58d610cad8670a912e27df1e23 +config: aafe3390f3e6efdd4e17678cfb72cb5c tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/API.html b/API.html new file mode 100644 index 0000000..a6d0866 --- /dev/null +++ b/API.html @@ -0,0 +1,146 @@ + + + + + + + API — Spectrum-IO 0.7.0 documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Spectrum Fundamentals.

+
+

API

+

Import spectrum_fundamentals using

+
import spectrum_fundamentals as specfun
+
+
+
+

Modstring conversions: convert

+
+
+

Peptide and ion mass / mz calculations: peptide

+
+
+

Annotation of spectra: annot

+
+
+

Spectral similarity calculation: similarity

+
+
+

Further utility functions: utils

+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/authors.html b/_key_contributors.html similarity index 53% rename from authors.html rename to _key_contributors.html index efde273..8ee15e9 100644 --- a/authors.html +++ b/_key_contributors.html @@ -1,13 +1,13 @@ - + - Credits — spectrum_fundamentals 0.6.0 documentation + <no title> — Spectrum-IO 0.7.0 documentation - + - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

Contributor Covenant Code of Conduct

-
-

Our Pledge

-

In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our -project and our community a harassment-free experience for everyone, -regardless of age, body size, disability, ethnicity, gender identity and -expression, level of experience, nationality, personal appearance, race, -religion, or sexual identity and orientation.

-
-
-

Our Standards

-

Examples of behavior that contributes to creating a positive environment -include:

-
    -
  • Using welcoming and inclusive language

  • -
  • Being respectful of differing viewpoints and experiences

  • -
  • Gracefully accepting constructive criticism

  • -
  • Focusing on what is best for the community

  • -
  • Showing empathy towards other community members

  • -
-

Examples of unacceptable behavior by participants include:

-
    -
  • The use of sexualized language or imagery and unwelcome sexual -attention or advances

  • -
  • Trolling, insulting/derogatory comments, and personal or political -attacks

  • -
  • Public or private harassment

  • -
  • Publishing others’ private information, such as a physical or -electronic address, without explicit permission

  • -
  • Other conduct which could reasonably be considered inappropriate in a -professional setting

  • -
-
-
-

Our Responsibilities

-

Project maintainers are responsible for clarifying the standards of -acceptable behavior and are expected to take appropriate and fair -corrective action in response to any instances of unacceptable behavior.

-

Project maintainers have the right and responsibility to remove, edit, -or reject comments, commits, code, wiki edits, issues, and other -contributions that are not aligned to this Code of Conduct, or to ban -temporarily or permanently any contributor for other behaviors that they -deem inappropriate, threatening, offensive, or harmful.

-
-
-

Scope

-

This Code of Conduct applies both within project spaces and in public -spaces when an individual is representing the project or its community. -Examples of representing a project or community include using an -official project e-mail address, posting via an official social media -account, or acting as an appointed representative at an online or -offline event. Representation of a project may be further defined and -clarified by project maintainers.

-
-
-

Enforcement

-

Instances of abusive, harassing, or otherwise unacceptable behavior may -be reported by opening an issue. The project team -will review and investigate all complaints, and will respond in a way -that it deems appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an -incident. Further details of specific enforcement policies may be posted -separately.

-

Project maintainers who do not follow or enforce the Code of Conduct in -good faith may face temporary or permanent repercussions as determined -by other members of the project’s leadership.

-
-
-

Attribution

-

This Code of Conduct is adapted from the Contributor Covenant, version 1.4, -available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

-
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/contributing.html b/contributing.html index c58e943..926b71e 100644 --- a/contributing.html +++ b/contributing.html @@ -1,13 +1,13 @@ - + - Contributor Guide — spectrum_fundamentals 0.6.0 documentation + Contributor Guide — Spectrum-IO 0.7.0 documentation - + - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

spectrum_fundamentals

-
- -
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/news.html b/news.html new file mode 100644 index 0000000..6f85db6 --- /dev/null +++ b/news.html @@ -0,0 +1,114 @@ + + + + + + + News — Spectrum-IO 0.7.0 documentation + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

News

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/objects.inv b/objects.inv index 9606bb7..a3ee9b6 100644 Binary files a/objects.inv and b/objects.inv differ diff --git a/py-modindex.html b/py-modindex.html index da74888..6f0250a 100644 --- a/py-modindex.html +++ b/py-modindex.html @@ -1,12 +1,12 @@ - + - Python Module Index — spectrum_fundamentals 0.6.0 documentation + Python Module Index — Spectrum-IO 0.7.0 documentation - + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Quickstart

+ +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/readme.html b/readme.html index 5bcd8de..38781e1 100644 --- a/readme.html +++ b/readme.html @@ -1,13 +1,13 @@ - + - spectrum_fundamentals — spectrum_fundamentals 0.6.0 documentation + Spectrum Fundamentals — Spectrum-IO 0.7.0 documentation - + - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

spectrum_fundamentals.annotation package

-
-

Submodules

-
-
-

spectrum_fundamentals.annotation.annotation module

-
-
-spectrum_fundamentals.annotation.annotation.annotate_spectra(un_annot_spectra, mass_tolerance=None, unit_mass_tolerance=None)[source]
-

Annotate a set of spectra.

-

This function takes a DataFrame of raw peaks and metadata, and for each spectrum, it calls the parallel_annotate function -to annotate the spectrum and extract the necessary information. If there are any redundant peaks found in the annotation -process, the function removes them and logs the information. Finally, it returns a Pandas DataFrame containing the annotated -spectra with meta data.

-

The returned DataFrame has the following columns: -- INTENSITIES: a NumPy array containing the intensity values of each peak in the annotated spectrum -- MZ: a NumPy array containing the m/z values of each peak in the annotated spectrum -- CALCULATED_MASS: a float representing the calculated mass of the spectrum -- removed_peaks: a NumPy array containing the indices of any peaks that were removed during the annotation process

-
-
Parameters:
-
    -
  • un_annot_spectra (DataFrame) – a Pandas DataFrame containing the raw peaks and metadata to be annotated

  • -
  • mass_tolerance (float | None) – mass tolerance to calculate min and max mass

  • -
  • unit_mass_tolerance (str | None) – unit for the mass tolerance (da or ppm)

  • -
-
-
Returns:
-

a Pandas DataFrame containing the annotated spectra with meta data

-
-
Return type:
-

DataFrame

-
-
-
- -
-
-spectrum_fundamentals.annotation.annotation.generate_annotation_matrix(matched_peaks, unmod_seq, charge)[source]
-

Generate the annotation matrix in the prosit format from matched peaks.

-
-
Parameters:
-
    -
  • matched_peaks (DataFrame) – matched peaks needed to be converted

  • -
  • unmod_seq (str) – Un modified peptide sequence

  • -
  • charge (int) – Precursor charge

  • -
-
-
Returns:
-

numpy array of intensities and numpy array of masses

-
-
Return type:
-

Tuple[ndarray, ndarray]

-
-
-
- -
-
-spectrum_fundamentals.annotation.annotation.generate_annotation_matrix_xl(matched_peaks, unmod_seq, crosslinker_position)[source]
-

Generate the annotation matrix in the xl_prosit format from matched peaks.

-
-
Parameters:
-
    -
  • matched_peaks (DataFrame) – matched peaks needed to be converted

  • -
  • unmod_seq (str) – unmodified peptide sequence

  • -
  • crosslinker_position (int) – position of crosslinker

  • -
-
-
Returns:
-

numpy array of intensities and numpy array of masses

-
-
Return type:
-

Tuple[ndarray, ndarray]

-
-
-
- -
-
-spectrum_fundamentals.annotation.annotation.handle_multiple_matches(matched_peaks, sort_by='mass_diff')[source]
-

Resolve cases where multiple peaks have been matched to the same fragment ion.

-

This function takes a list of dictionaries representing matched peaks and resolves cases where multiple peaks have -been matched to the same fragment ion. The function sorts the peaks based on the provided sort_by parameter and -removes duplicate matches based on ion type, ion number, and charge state.

-
-
Parameters:
-
    -
  • matched_peaks (List[Dict[str, str | int | float]]) – A list of dictionaries, each representing a matched peak. Each dictionary must contain the -following keys: ‘ion_type’, ‘no’, ‘charge’, ‘exp_mass’, ‘theoretical_mass’, and ‘intensity’.

  • -
  • sort_by (str) – A string indicating the criterion to use when sorting matched peaks. Valid options are: -‘mass_diff’ (sort by absolute difference between experimental and theoretical mass, ascending order), -‘intensity’ (sort by intensity, descending order), and ‘exp_mass’ (sort by experimental mass, -descending order).

  • -
-
-
Raises:
-

ValueError – If an unsupported value is passed to sort_by.

-
-
Returns:
-

A tuple containing a DataFrame of matched peaks (with duplicates removed) and an integer indicating the -number of duplicate matches that were removed.

-
-
Return type:
-

Tuple[DataFrame, int]

-
-
-
- -
-
-spectrum_fundamentals.annotation.annotation.match_peaks(fragments_meta_data, peaks_intensity, peaks_masses, tmt_n_term, unmod_sequence, charge)[source]
-

Matching experimental peaks with theoretical fragment ions.

-
-
Parameters:
-
    -
  • fragments_meta_data (List[dict]) – Fragments ions meta data eg. ion type, number, theo_mass…

  • -
  • peaks_intensity (ndarray) – Experimental peaks intensities

  • -
  • peaks_masses (ndarray) – Experimental peaks masses

  • -
  • tmt_n_term (int) – Flag to check if there is tmt modification on n_terminus 1: no_tmt, 2:tmt

  • -
  • unmod_sequence (str) – Unmodified peptide sequence

  • -
  • charge (int) – Precursor charge

  • -
-
-
Returns:
-

List of matched/annotated peaks

-
-
Return type:
-

List[Dict[str, str | int | float]]

-
-
-
- -
-
-spectrum_fundamentals.annotation.annotation.parallel_annotate(spectrum, index_columns, mass_tolerance=None, unit_mass_tolerance=None)[source]
-

Perform parallel annotation of a spectrum.

-

This function takes a spectrum and its index columns and performs parallel annotation of the spectrum. -It starts by initializing the peaks and extracting necessary data from the spectrum. -It then matches the peaks to the spectrum and generates an annotation matrix based on the matched peaks. -If there are multiple matches found, it removes the redundant matches. -Finally, it returns annotated spectrum with meta data including intensity values, masses, calculated masses, -and any peaks that were removed. The function is designed to run in different threads to speed up the annotation pipeline.

-
-
Parameters:
-
    -
  • spectrum (ndarray) – a np.ndarray that contains the spectrum to be annotated

  • -
  • index_columns (Dict[str, int]) – a dictionary that contains the index columns of the spectrum

  • -
  • mass_tolerance (float | None) – mass tolerance to calculate min and max mass

  • -
  • unit_mass_tolerance (str | None) – unit for the mass tolerance (da or ppm)

  • -
-
-
Returns:
-

a tuple containing intensity values (np.ndarray), masses (np.ndarray), calculated mass (float), -and any removed peaks (List[str])

-
-
Return type:
-

Tuple[ndarray, ndarray, float, int] | Tuple[ndarray, ndarray, ndarray, ndarray, float, float, int, int] | None

-
-
-
- -
-
-spectrum_fundamentals.annotation.annotation.peak_pos_xl_cms2(unmod_seq, crosslinker_position)[source]
-

Determines the positions of all potential normal and xl fragments within the vector generated by generate_annotation_matrix.

-

This function is used only for cleavable crosslinked peptides.

-
-
Parameters:
-
    -
  • unmod_seq (str) – Unmodified peptide sequence

  • -
  • crosslinker_position (int) – The position of the crosslinker

  • -
-
-
Raises:
-

ValueError – if peptides exceed a length of 30

-
-
Returns:
-

position of different fragments as list

-
-
Return type:
-

ndarray

-
-
-
- -
-
-

Module contents

-

Initialize annotation.

-
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/spectrum_fundamentals.html b/spectrum_fundamentals.html deleted file mode 100644 index 6e79ab9..0000000 --- a/spectrum_fundamentals.html +++ /dev/null @@ -1,716 +0,0 @@ - - - - - - - spectrum_fundamentals package — spectrum_fundamentals 0.6.0 documentation - - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

spectrum_fundamentals package

-
-

Subpackages

-
- -
-
-
-

Submodules

-
-
-

spectrum_fundamentals.charge module

-
-
-spectrum_fundamentals.charge.indices_to_one_hot(labels, classes=None)[source]
-

Convert a single or a list of labels to one-hot encoding.

-
-
Parameters:
-
    -
  • labels (int | List[int] | ndarray) – The labels to be one-hot encoding. Must be one-based.

  • -
  • classes (int | None) – The number of classes, i.e. the length of the encoding. If omitted, set to the max label + 1.

  • -
-
-
Raises:
-
    -
  • TypeError – If the type of labels is not understood

  • -
  • ValueError – If the highest label in labels is larger or equal to the number of classes.

  • -
-
-
Returns:
-

np.ndarray with the one-hot encoded labels.

-
-
Return type:
-

ndarray

-
-
-
- -
-
-

spectrum_fundamentals.constants module

-
-
-class spectrum_fundamentals.constants.RescoreType(value)[source]
-

Bases: Enum

-

Class for rescoring types.

-
-
-ANDROMEDA = 'andromeda'
-
- -
-
-PROSIT = 'prosit'
-
- -
- -
-
-

spectrum_fundamentals.fragments module

-
-
-spectrum_fundamentals.fragments.compute_ion_masses(seq_int, charge_onehot, tmt='')[source]
-

Collects an integer sequence e.g. [1,2,3] with charge 2 and returns array with 174 positions for ion masses.

-

Invalid masses are set to -1.

-
-
Parameters:
-
    -
  • seq_int (List[int]) – TODO

  • -
  • charge_onehot (List[int]) – is a onehot representation of charge with 6 elems for charges 1 to 6

  • -
  • tmt (str) – TODO

  • -
-
-
Returns:
-

list of masses as floats

-
-
Return type:
-

ndarray | None

-
-
-
- -
-
-spectrum_fundamentals.fragments.compute_peptide_mass(sequence)[source]
-

Compute the theoretical mass of the peptide sequence.

-
-
Parameters:
-

sequence (str) – Modified peptide sequence

-
-
Returns:
-

Theoretical mass of the sequence

-
-
Return type:
-

float

-
-
-
- -
-
-spectrum_fundamentals.fragments.get_min_max_mass(mass_analyzer, mass, mass_tolerance=None, unit_mass_tolerance=None)[source]
-

Helper function to get min and max mass based on mass analyzer.

-

If both mass_tolerance and unit_mass_tolerance are provided, the function uses the provided tolerance -to calculate the min and max mass. If either mass_tolerance or unit_mass_tolerance is missing -(or both are None), the function falls back to the default tolerances based on the mass_analyzer.

-

Default mass tolerances for different mass analyzers: -- FTMS: +/- 20 ppm -- TOF: +/- 40 ppm -- ITMS: +/- 0.35 daltons

-
-
Parameters:
-
    -
  • mass_tolerance (float | None) – mass tolerance to calculate min and max mass

  • -
  • unit_mass_tolerance (str | None) – unit for the mass tolerance (da or ppm)

  • -
  • mass_analyzer (str) – the type of mass analyzer used to determine the tolerance.

  • -
  • mass (float) – the theoretical fragment mass

  • -
-
-
Raises:
-
    -
  • ValueError – if mass_analyzer is other than one of FTMS, TOF, ITMS

  • -
  • ValueError – if unit_mass_tolerance is other than one of ppm, da

  • -
-
-
Returns:
-

a tuple (min, max) denoting the mass tolerance range.

-
-
Return type:
-

Tuple[float, float]

-
-
-
- -
-
-spectrum_fundamentals.fragments.initialize_peaks(sequence, mass_analyzer, charge, mass_tolerance=None, unit_mass_tolerance=None, noncl_xl=False, peptide_beta_mass=0.0, xl_pos=-1)[source]
-

Generate theoretical peaks for a modified peptide sequence.

-
-
Parameters:
-
    -
  • sequence (str) – Modified peptide sequence

  • -
  • mass_analyzer (str) – Type of mass analyzer used eg. FTMS, ITMS

  • -
  • charge (int) – Precursor charge

  • -
  • mass_tolerance (float | None) – mass tolerance to calculate min and max mass

  • -
  • unit_mass_tolerance (str | None) – unit for the mass tolerance (da or ppm)

  • -
  • noncl_xl (bool) – whether the function is called with a non-cleavable xl modification

  • -
  • peptide_beta_mass (float) – the mass of the second peptide to be considered for non-cleavable XL

  • -
  • xl_pos (int) – the position of the crosslinker for non-cleavable XL

  • -
-
-
Returns:
-

List of theoretical peaks, Flag to indicate if there is a tmt on n-terminus, Un modified peptide sequence

-
-
Return type:
-

Tuple[List[dict], int, str, float]

-
-
-
- -
-
-spectrum_fundamentals.fragments.initialize_peaks_xl(sequence, mass_analyzer, crosslinker_position, crosslinker_type, mass_tolerance=None, unit_mass_tolerance=None, sequence_beta=None)[source]
-

Generate theoretical peaks for a modified (potentially cleavable cross-linked) peptide sequence.

-

This function get only one modified peptide (peptide a or b))

-
-
Parameters:
-
    -
  • sequence (str) – Modified peptide sequence (peptide a or b)

  • -
  • mass_analyzer (str) – Type of mass analyzer used eg. FTMS, ITMS

  • -
  • crosslinker_position (int) – The position of crosslinker

  • -
  • crosslinker_type (str) – Can be either DSSO, DSBU or BuUrBU

  • -
  • mass_tolerance (float | None) – mass tolerance to calculate min and max mass

  • -
  • unit_mass_tolerance (str | None) – unit for the mass tolerance (da or ppm)

  • -
  • sequence_beta (str | None) – optional second peptide to be considered for non-cleavable XL

  • -
-
-
Raises:
-
    -
  • ValueError – if crosslinker_type is unkown

  • -
  • AssertionError – if the short and long XL sequence (the one with the short / long crosslinker mod) -has a tmt n term while the other one does not

  • -
-
-
Returns:
-

List of theoretical peaks, flag to indicate if there is a tmt on n-terminus, unmodified peptide -sequence, therotical mass of modified peptide (without considering mass of crosslinker)

-
-
Return type:
-

Tuple[List[dict], int, str, float]

-
-
-
- -
-
-

spectrum_fundamentals.mod_string module

-
-
-spectrum_fundamentals.mod_string.add_permutations(modified_sequence, unimod_id, residues)[source]
-

Generate different peptide sequences with moving the modification to all possible residues.

-
-
Parameters:
-
    -
  • modified_sequence (str) – Peptide sequence

  • -
  • unimod_id (int) – modification unimod id to be used for generating different permutations.

  • -
  • residues (List[str]) – possible amino acids where this mod can exist

  • -
-
-
Returns:
-

list of possible sequence permutations

-
-
-
- -
-
-spectrum_fundamentals.mod_string.get_mods_list(mods_variable, mods_fixed)[source]
-

Helper function to get mods list.

-
-
Parameters:
-
    -
  • mods_variable (str) –

  • -
  • mods_fixed (str) –

  • -
-
-
-
- -
-
-spectrum_fundamentals.mod_string.internal_to_mod_mass(sequences)[source]
-

Function to exchange the internal mod identifiers with the masses of the specific modifiction.

-
-
Parameters:
-

sequences (List[str]) – List[str] of sequences

-
-
Returns:
-

List[str] of modified sequences

-
-
Return type:
-

List[str]

-
-
-
- -
-
-spectrum_fundamentals.mod_string.internal_to_mod_names(sequences)[source]
-

Function to translate an internal modstring to MSP format.

-
-
Parameters:
-

sequences (List[str]) – List[str] of sequences

-
-
Returns:
-

List[Tuple[str, str] of mod summary and mod sequences

-
-
Return type:
-

List[Tuple[str, str]]

-
-
-
- -
-
-spectrum_fundamentals.mod_string.internal_to_spectronaut(sequences)[source]
-

Function to translate a modstring from the internal format to the spectronaut format.

-
-
Parameters:
-

sequences (ndarray | Series | List[str]) – List[str] of sequences

-
-
Returns:
-

List[str] of modified sequences

-
-
Return type:
-

List[str]

-
-
-
- -
-
-spectrum_fundamentals.mod_string.internal_without_mods(sequences)[source]
-

Function to remove any mod identifiers and return the plain AA sequence.

-
-
Parameters:
-

sequences (List[str]) – List[str] of sequences

-
-
Returns:
-

List[str] of modified sequences

-
-
Return type:
-

List[str]

-
-
-
- -
-
-spectrum_fundamentals.mod_string.maxquant_to_internal(sequences, fixed_mods=None)[source]
-

Function to translate a MaxQuant modstring to the Prosit format.

-
-
Parameters:
-
    -
  • sequences (ndarray | Series | List[str]) – List[str] of sequences

  • -
  • fixed_mods (Dict[str, str] | None) – Optional dictionary of modifications with key aa and value mod, e.g. ‘M’: ‘M(UNIMOD:35)’. -Fixed modifications must be included in the variable modificatons dictionary. -By default, i.e. if nothing is supplied to fixed_mods, carbamidomethylation on cystein will be included -in the fixed modifications. If you want to have no fixed modifictions at all, supply fixed_mods={}

  • -
-
-
Raises:
-

AssertionError – if illegal modification was provided in the fixed_mods dictionary.

-
-
Returns:
-

a list of modified sequences

-
-
Return type:
-

List[str]

-
-
-
- -
-
-spectrum_fundamentals.mod_string.msfragger_to_internal(sequences, fixed_mods=None)[source]
-

Function to translate a MSFragger modstring to the Prosit format.

-
-
Parameters:
-
    -
  • sequences (ndarray | Series | List[str]) – List[str] of sequences

  • -
  • fixed_mods (Dict[str, str] | None) – Optional dictionary of modifications with key aa and value mod, e.g. ‘M[147]’: ‘M(UNIMOD:35)’. -Fixed modifications must be included in the variable modificatons dictionary. -By default, i.e. if nothing is supplied to fixed_mods, carbamidomethylation on cystein will be included -in the fixed modifications. If you want to have no fixed modifictions at all, supply fixed_mods={}

  • -
-
-
Raises:
-

AssertionError – if illegal modification was provided in the fixed_mods dictionary.

-
-
Returns:
-

a list of modified sequences

-
-
Return type:
-

List[str]

-
-
-
- -
-
-spectrum_fundamentals.mod_string.parse_modstrings(sequences, alphabet, translate=False, filter=False)[source]
-

Parse modstrings.

-
-
Parameters:
-
    -
  • sequences (List[str]) – List of strings

  • -
  • alphabet (Dict[str, int]) – dictionary where the keys correspond to all possible ‘Elements’ that can occur in the string

  • -
  • translate (bool) – boolean to determine if the Elements should be translated to the corresponding values of ALPHABET

  • -
  • filter (bool) – boolean to determine if non-parsable sequences should be filtered out

  • -
-
-
Returns:
-

generator that yields a list of sequence ‘Elements’ or the translated sequence “Elements”

-
-
-
- -
-
-spectrum_fundamentals.mod_string.proteomicsdb_to_internal(sequence, mods_variable='', mods_fixed='')[source]
-

Function to create a sequence with UNIMOD modifications from given sequence and it’s varaible and fixed modifications.

-
-
Parameters:
-
    -
  • sequence (str) – The sequence to modify

  • -
  • mods_variable (str) – the variable modifacations (e.g. “Oxidation@M45”)

  • -
  • mods_fixed (str) – the fixed modifacations (e.g. “Carbamidomethyl@C”)

  • -
-
-
Returns:
-

sequence with unimods (e.g.”AAC[UNIMOD:4]GHK”)

-
-
Return type:
-

str

-
-
-
- -
-
-spectrum_fundamentals.mod_string.sage_to_internal(sequences)[source]
-

Convert mod string from sage to the internal format.

-

This function converts sequences using the mass change of a modification in -square brackets as done by Sage to the internal format by replacing the mass -shift with the corresponding UNIMOD identifier of known and supported -modifications defined in the constants.

-
-
Parameters:
-

sequences (List[str]) – A list of sequences with values inside square brackets.

-
-
Returns:
-

A list of modified sequences with values converted to internal format.

-
-
Return type:
-

List[str]

-
-
-
- -
-
-spectrum_fundamentals.mod_string.xisearch_to_internal(xl, seq, mod, crosslinker_position, mod_positions)[source]
-

Function to translate a xisearch modstring to the XL-Prosit format.

-
-
Parameters:
-
    -
  • xl (str) – type of crosslinker used. Can be ‘DSSO’ or ‘DSBU’.

  • -
  • seq (str) – unmodified peptide sequence

  • -
  • mod (str) – all modifications of pep

  • -
  • crosslinker_position (int) – crosslinker position of peptide

  • -
  • mod_positions (str) – position of all modifications of peptide

  • -
-
-
Raises:
-

ValueError – if suplied type of crosslinker is unknown

-
-
Returns:
-

modified sequence

-
-
-
- -
-
-

Module contents

-

Initialize fundamentals.

-
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/spectrum_fundamentals.metrics.html b/spectrum_fundamentals.metrics.html deleted file mode 100644 index 0566a08..0000000 --- a/spectrum_fundamentals.metrics.html +++ /dev/null @@ -1,1078 +0,0 @@ - - - - - - - spectrum_fundamentals.metrics package — spectrum_fundamentals 0.6.0 documentation - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

spectrum_fundamentals.metrics package

-
-

Submodules

-
-
-

spectrum_fundamentals.metrics.fragments_ratio module

-
-
-class spectrum_fundamentals.metrics.fragments_ratio.FragmentsRatio(pred_intensities=None, true_intensities=None, mz=None, xl=False)[source]
-

Bases: Metric

-

Main to initialize a FragmentsRatio obj.

-
-
Parameters:
-
    -
  • pred_intensities (ndarray | csr_matrix | None) –

  • -
  • true_intensities (ndarray | csr_matrix | None) –

  • -
  • mz (ndarray | csr_matrix | None) –

  • -
  • xl (bool) –

  • -
-
-
-
-
-calc(xl=False)[source]
-

Adds columns with count, fraction and fraction_predicted features to metrics_val dataframe.

-
-
Parameters:
-

xl (bool) –

-
-
-
- -
-
-static count_observation_states(observation_state, test_state, ion_mask=None, xl=False)[source]
-

Count the number of observation states.

-
-
Parameters:
-
    -
  • observation_state (csr_matrix) – integer observation_state, array of length 174

  • -
  • test_state (int) – integer for the test observation state

  • -
  • ion_mask (ndarray | csr_matrix | None) – mask with 1s for the ions that should be counted and 0s for ions that should be ignored, integer array of length 174

  • -
  • xl (bool) – whether or not the function is executed with xl mode

  • -
-
-
Returns:
-

number of observation states equal to test_state per row

-
-
Return type:
-

ndarray

-
-
-
- -
-
-static count_with_ion_mask(boolean_array, ion_mask=None, xl=False)[source]
-

Count the number of ions.

-
-
Parameters:
-
    -
  • boolean_array (csr_matrix) – boolean array with True for observed/predicted peaks and False for missing observed/predicted peaks, array of length 174

  • -
  • ion_mask (ndarray | spmatrix | None) – mask with 1s for the ions that should be counted and 0s for ions that should be ignored, integer array of length 174 for linear and 348 for crosslinked peptides, or a list of integers, -or a scipy.sparse.csr_matrix or scipy.sparse._csc.csc_matrix.

  • -
  • xl (bool) – whether to process with crosslinked or linear peptides

  • -
-
-
Returns:
-

number of observed/predicted peaks not masked by ion_mask

-
-
Return type:
-

ndarray

-
-
-
- -
-
-static get_mask_observed_valid(observed_mz)[source]
-

Creates a mask out of an observed m/z array with True for invalid entries and False for valid entries in the observed intensities array.

-
-
Parameters:
-

observed_mz (csr_matrix) – observed m/z, array of length 174

-
-
Returns:
-

boolean array, array of length 174

-
-
Return type:
-

csr_matrix

-
-
-
- -
-
-static get_observation_state(observed_boolean, predicted_boolean, mask)[source]
-

Computes the observation state between the observed and predicted boolean arrays.

-

possible values: -- 4: not seen in either -- 3: predicted but not in observed -- 2: seen in both -- 1: observed but not in predicted -- 0: invalid -:param observed_boolean: boolean observed intensities, boolean array of length 174 -:param predicted_boolean : boolean predicted intensities, boolean array of length 174 -:param mask: mask with True for invalid values in the observed intensities array, boolean array of length 174 -:return: integer array, array of length 174

-
-
Parameters:
-
    -
  • observed_boolean (csr_matrix) –

  • -
  • predicted_boolean (csr_matrix) –

  • -
  • mask (csr_matrix) –

  • -
-
-
Return type:
-

csr_matrix

-
-
-
- -
-
-static make_boolean(intensities, mask, cutoff=2e-07)[source]
-

Transform array of intensities into boolean array with True if > cutoff and False otherwise.

-
-
Parameters:
-
    -
  • intensities (csr_matrix) – observed or predicted intensities, array of length 174

  • -
  • mask (csr_matrix) – mask with True for invalid values in the observed intensities array, boolean array of length 174

  • -
  • cutoff (float) – minimum intensity value to be considered a peak, for observed intensities use the default cutoff of 0.0, for predicted intensities, set a cutoff, e.g. 0.05

  • -
-
-
Returns:
-

boolean array, array of length 174

-
-
Return type:
-

csr_matrix

-
-
-
- -
-
-metrics_val: DataFrame
-
- -
-
-pred_intensities: ndarray | csr_matrix | None
-
- -
-
-true_intensities: ndarray | csr_matrix | None
-
- -
- -
-
-class spectrum_fundamentals.metrics.fragments_ratio.ObservationState(value)[source]
-

Bases: IntEnum

-

States.

-
    -
  • 4: not seen in either

  • -
  • 3: predicted but not in observed

  • -
  • 2: seen in both

  • -
  • 1: observed but not in predicted

  • -
  • 0: invalid

  • -
-
-
-INVALID_ION = 0
-
- -
-
-NOT_OBS_AND_NOT_PRED = 4
-
- -
-
-NOT_OBS_BUT_PRED = 3
-
- -
-
-OBS_AND_PRED = 2
-
- -
-
-OBS_BUT_NOT_PRED = 1
-
- -
- -
-
-

spectrum_fundamentals.metrics.metric module

-
-
-class spectrum_fundamentals.metrics.metric.Metric(pred_intensities=None, true_intensities=None, mz=None, xl=False)[source]
-

Bases: object

-

Main to init a Metric obj.

-
-
Parameters:
-
    -
  • pred_intensities (ndarray | csr_matrix | None) –

  • -
  • true_intensities (ndarray | csr_matrix | None) –

  • -
  • mz (ndarray | csr_matrix | None) –

  • -
  • xl (bool) –

  • -
-
-
-
-
-abstract calc(all_features)[source]
-

Calculate.

-
-
Parameters:
-

all_features (bool) –

-
-
-
- -
-
-metrics_val: DataFrame
-
- -
-
-pred_intensities: ndarray | csr_matrix | None
-
- -
-
-true_intensities: ndarray | csr_matrix | None
-
- -
-
-write_to_file(file_path)[source]
-

Write to file_path.

-
-
Parameters:
-

file_path (str) –

-
-
-
- -
- -
-
-

spectrum_fundamentals.metrics.percolator module

-
-
-class spectrum_fundamentals.metrics.percolator.Percolator(metadata, input_type, pred_intensities=None, true_intensities=None, mz=None, all_features_flag=False, regression_method='lowess', fdr_cutoff=0.01)[source]
-

Bases: Metric

-

Expects the following metadata columns.

-

RAW_FILE -SCAN_NUMBER -MODIFIED_SEQUENCE: sequence with modifications -SEQUENCE: sequence without modifications -CHARGE: precursor charge state -MASS: experimental precursor mass -CALCULATED_MASS: calculated mass based on sequence and modifications -SCORE: Andromeda score -REVERSE: does the sequence come from the reversed (=decoy) database -FRAGMENTATION: fragmentation method, e.g. HCD, CID -RETENTION_TIME: observed retention time -PREDICTED_RETENTION_TIME: predicted retention time by Prosit

-
-
Parameters:
-
    -
  • metadata (DataFrame) –

  • -
  • input_type (str) –

  • -
  • pred_intensities (ndarray | csr_matrix | None) –

  • -
  • true_intensities (ndarray | csr_matrix | None) –

  • -
  • mz (ndarray | csr_matrix | None) –

  • -
  • all_features_flag (bool) –

  • -
  • regression_method (str) –

  • -
  • fdr_cutoff (float) –

  • -
-
-
-
-
-add_common_features()[source]
-

Add features used by both Andromeda and Prosit feature scoring sets.

-
- -
-
-add_percolator_metadata_columns()[source]
-

Add metadata columns needed by percolator, e.g. to identify a PSM.

-
- -
-
-apply_lda_and_get_indices_below_fdr(initial_scoring_feature='spectral_angle', fdr_cutoff=0.01)[source]
-

Applies a linear discriminant analysis on the features calculated so far (before retention time alignment) to estimate false discovery rates (FDRs).

-
-
Parameters:
-
    -
  • initial_scoring_feature (str) – name of the initial scoring feature

  • -
  • fdr_cutoff (float) – FDR cutoff as float

  • -
-
-
Returns:
-

array with indices below FDR

-
-
-
- -
-
-calc()[source]
-

Adds percolator metadata and feature columns to metrics_val based on PSM metadata.

-
- -
-
-static calculate_fdrs(sorted_labels)[source]
-

Calculate FDR.

-
-
Parameters:
-

sorted_labels (Series | ndarray) – array with labels sorted (target, decoy)

-
-
Returns:
-

array with calculated FDRs

-
-
Return type:
-

ndarray

-
-
-
- -
-
-static calculate_mass_difference(metadata_subset)[source]
-

Calculate mass difference.

-
-
Parameters:
-

metadata_subset (Tuple[float, float]) – experimental and calculated mass as tuple

-
-
Returns:
-

mass difference

-
-
Return type:
-

float

-
-
-
- -
-
-static calculate_mass_difference_ppm(metadata_subset)[source]
-

Calculate mass difference in ppm.

-
-
Parameters:
-

metadata_subset (Tuple[float, float]) – experimental and calculated mass as tuple

-
-
Returns:
-

mass difference in ppm

-
-
Return type:
-

float

-
-
-
- -
-
-static count_arginines_and_lysines(sequence)[source]
-

Count number of arginines and lysines.

-
-
Parameters:
-

sequence (str) – peptide sequence

-
-
Returns:
-

number of arginines and lysines

-
-
Return type:
-

int

-
-
-
- -
-
-static count_missed_cleavages(sequence)[source]
-

Count number of missed cleavages assuming Trypsin/P proteolysis.

-
-
Parameters:
-

sequence (str) – peptide sequence

-
-
Returns:
-

number of missed cleavages

-
-
Return type:
-

int

-
-
-
- -
-
-fdr_cutoff: float
-
- -
-
-static fdrs_to_qvals(fdrs)[source]
-

Converts FDRs to q-values.

-
-
Parameters:
-

fdrs (ndarray) – array with FDRs

-
-
Returns:
-

array with qvals

-
-
Return type:
-

ndarray

-
-
-
- -
-
-static get_aligned_predicted_retention_times(observed_retention_times_fdr_filtered, predicted_retention_times_fdr_filtered, predicted_retention_times_all, curve_fitting_method='lowess')[source]
-

Apply regression to find a mapping from predicted iRT values to experimental retention times.

-
-
Parameters:
-
    -
  • observed_retention_times_fdr_filtered (ndarray | Series) – observed retention times after FDR filter

  • -
  • predicted_retention_times_fdr_filtered (ndarray | Series) – predicted retention times after FDR filter

  • -
  • predicted_retention_times_all (ndarray | Series) – all predicted retention times

  • -
  • curve_fitting_method (str) – method for curve fitting (lowess, spline, or logistic)

  • -
-
-
Returns:
-

aligned predicted retention times

-
-
Return type:
-

ndarray

-
-
-
- -
-
-static get_delta_score(scores_df, scoring_feature)[source]
-

Calculates delta scores by sorting (from high to low) and grouping PSMs by scan number.

-

Inside each group the delta scores are calculated per PSM to the next best of that group. -The lowest scoring PSM of each group receives a delta score of 0. -:param scores_df: must contain two columns: scoring_feature (eg. ‘spectral_angle’) and ‘ScanNr’ -:param scoring_feature: feature name to get the delta scores of -:raises NotImplementedError: If there is only one unique value for ScanNr in the scores_df. -:return: numpy array of delta scores

-
-
Parameters:
-
    -
  • scores_df (DataFrame) –

  • -
  • scoring_feature (str) –

  • -
-
-
Return type:
-

ndarray

-
-
-
- -
-
-get_indices_below_fdr(feature_name, fdr_cutoff=0.01)[source]
-

Get indices below FDR.

-
-
Parameters:
-
    -
  • feature_name (str) – name of the feature to sort by as string

  • -
  • fdr_cutoff (float) – FDR cutoff as float

  • -
-
-
Returns:
-

array with indices below FDR

-
-
Return type:
-

ndarray

-
-
-
- -
-
-static get_specid(metadata_subset)[source]
-

Create a unique identifier used as spectrum id in percolator, this is not parsed by percolator but functions as a key to map percolator results back to our internal representation.

-
-
Parameters:
-

metadata_subset (Series | Tuple) – tuple of (raw_file, scan_number, modified_sequence, charge and optionally scan_event_number)

-
-
Returns:
-

percolator spectrum id

-
-
Return type:
-

str

-
-
-
- -
-
-static get_target_decoy_label(reverse)[source]
-

Get target or decoy label.

-
-
Parameters:
-

reverse (bool) – if true, return the label for DECOY, otherwise return the label for TARGET

-
-
Returns:
-

target/decoy label for percolator

-
-
-
- -
-
-input_type: str
-
- -
-
-metadata: DataFrame
-
- -
-
-static sample_balanced_over_bins(retention_time_df, sample_size=5000)[source]
-

Sample balanced over bins.

-
-
Parameters:
-
    -
  • retention_time_df (DataFrame) – DataFrame with observed and predicted retention times

  • -
  • sample_size (int) – number of samples

  • -
-
-
Returns:
-

RT Index

-
-
Return type:
-

Index

-
-
-
- -
-
-target_decoy_labels: ndarray
-
- -
- -
-
-class spectrum_fundamentals.metrics.percolator.TargetDecoyLabel(value)[source]
-

Bases: IntEnum

-

Target and decoy labels as used by Percolator.

-
-
-DECOY = -1
-
- -
-
-TARGET = 1
-
- -
- -
-
-spectrum_fundamentals.metrics.percolator.get_fitting_func(curve_fitting_method)[source]
-

Retrieve the correct function given a curve fitting method.

-
-
Parameters:
-

curve_fitting_method (str) – method for curve fitting (lowess, spline, or logistic)

-
-
Raises:
-

ValueError – if an invalid curve_fitting_method is supplied

-
-
Returns:
-

Callable that accepts x and y, i.e. fit_func(x,y) where x are the data points and y -are the corresponding measures for which the fit should be done.

-
-
-
- -
-
-spectrum_fundamentals.metrics.percolator.logistic(x, a, b, c, d)[source]
-

Calculates logistic regression function.

-
-
Parameters:
-
    -
  • x (Series | ndarray) –

  • -
  • a (float) –

  • -
  • b (float) –

  • -
  • c (float) –

  • -
  • d (float) –

  • -
-
-
-
- -
-
-spectrum_fundamentals.metrics.percolator.spline(knots, x, y)[source]
-

Calculates spline fitting.

-
-
Parameters:
-
    -
  • knots (int) –

  • -
  • x (ndarray) –

  • -
  • y (ndarray) –

  • -
-
-
-
- -
-
-

spectrum_fundamentals.metrics.similarity module

-
-
-class spectrum_fundamentals.metrics.similarity.SimilarityMetrics(pred_intensities=None, true_intensities=None, mz=None, xl=False)[source]
-

Bases: Metric

-

Class to generate several features than can be used by percoltor for rescoring.

-
-
Parameters:
-
    -
  • pred_intensities (ndarray | csr_matrix | None) –

  • -
  • true_intensities (ndarray | csr_matrix | None) –

  • -
  • mz (ndarray | csr_matrix | None) –

  • -
  • xl (bool) –

  • -
-
-
-
-
-static abs_diff(observed_intensities, predicted_intensities, metric)[source]
-

Calculate several similarity metrics.

-
-
Parameters:
-
    -
  • observed_intensities (csr_matrix) – observed intensities, constants.EPSILON intensity indicates zero intensity peaks, 0 intensity indicates invalid peaks (charge state > peptide charge state or position >= peptide length), array of length 174

  • -
  • predicted_intensities (csr_matrix) – predicted intensities, see observed_intensities for details, array of length 174

  • -
  • metric (str) – metric (mean, std, q1, q2, q3, min, max, or mse)

  • -
-
-
Returns:
-

calculated similarity values

-
-
Return type:
-

List[float]

-
-
-
- -
-
-calc(all_features, xl=False)[source]
-

Adds columns with spectral angle feature to metrics_val dataframe.

-
-
Parameters:
-
    -
  • all_features (bool) – if True, calculate all metrics

  • -
  • xl (bool) – whether calculating for crosslinked or linear peptides

  • -
-
-
-
- -
-
-static calculate_quantiles(observed, predicted, quantile)[source]
-

Helper function to calculcate quantiles.

-
-
Parameters:
-
    -
  • observed (ndarray) – observed intensities

  • -
  • predicted (ndarray) – predicted intensities

  • -
  • quantile (str) – quantile method

  • -
-
-
Returns:
-

calculated quantile

-
-
Return type:
-

float

-
-
-
- -
-
-static correlation(observed_intensities, predicted_intensities, charge=0, method='pearson', xl=False)[source]
-

Calculate correlation between observed and predicted.

-
-
Parameters:
-
    -
  • observed_intensities (csr_matrix) – observed intensities, constants.EPSILON intensity indicates zero intensity peaks, 0 intensity indicates invalid peaks (charge state > peptide charge state or position >= peptide length), array of length 174

  • -
  • predicted_intensities (csr_matrix) – predicted intensities, see observed_intensities for details, array of length 174

  • -
  • charge (int) – to filter by the peak charges, 0 means everything

  • -
  • method (str) – either pearson or spearman

  • -
  • xl (bool) – wheter or not to use xl mode

  • -
-
-
Raises:
-

ValueError – if charge is smaller than 1 or larger than 5

-
-
Returns:
-

calculated correlations

-
-
Return type:
-

List[float]

-
-
-
- -
-
-static cos(observed_intensities, predicted_intensities)[source]
-

Calculate cosine similarity.

-
-
Parameters:
-
    -
  • observed_intensities (csr_matrix) – observed intensities, constants.EPSILON intensity indicates zero intensity peaks, 0 intensity indicates invalid peaks (charge state > peptide charge state or position >= peptide length), array of length 174

  • -
  • predicted_intensities (csr_matrix) – predicted intensities, see observed_intensities for details, array of length 174

  • -
-
-
Returns:
-

cosine values

-
-
Return type:
-

List[float]

-
-
-
- -
-
-static l2_norm(matrix)[source]
-

Compute the l2-norm (sqrt(sum(x^2) ) for each row of the matrix.

-
-
Parameters:
-

matrix – matrix with intensities, constants.EPSILON intensity indicates zero intensity peaks, 0 intensity indicates invalid peaks (charge state > peptide charge state or position >= peptide length), matrix of size (nspectra, 174)

-
-
Returns:
-

vector with rowwise norms of the matrix

-
-
Return type:
-

ndarray

-
-
-
- -
-
-metrics_val: DataFrame
-
- -
-
-static modified_cosine(observed_intensities, predicted_intensities, observed_mz, theoretical_mz)[source]
-

Calculate modified cosine similarity as defined in Chris D. McGann et al. (Real-time spectral library matching for sample multiplexed quantitative proteomics).

-
-
Parameters:
-
    -
  • observed_intensities (csr_matrix | ndarray) – observed intensities, constants.EPSILON intensity indicates zero intensity peaks, 0 intensity indicates invalid peaks (charge state > peptide charge state or position >= peptide length), array of length 174

  • -
  • predicted_intensities (csr_matrix | ndarray) – predicted intensities, see observed_intensities for details, array of length 174

  • -
  • observed_mz (csr_matrix | ndarray) – observed mz values

  • -
  • theoretical_mz (csr_matrix | ndarray) – theoretical mz values

  • -
-
-
Returns:
-

calculates cosine values

-
-
Return type:
-

List[float]

-
-
-
- -
-
-pred_intensities: ndarray | csr_matrix | None
-
- -
-
-static rowwise_dot_product(observed_intensities, predicted_intensities)[source]
-

Calculate rowwise dot product.

-
-
Parameters:
-
    -
  • observed_intensities (csr_matrix | ndarray) – observed intensities, constants.EPSILON intensity indicates zero intensity peaks, -0 intensity indicates invalid peaks (charge state > peptide charge state or position >= peptide length), -array of length 174

  • -
  • predicted_intensities (csr_matrix | ndarray) – predicted intensities, see observed_intensities for details, array of length 174

  • -
-
-
Returns:
-

matrix containing the rowwise dotproduct

-
-
Return type:
-

ndarray

-
-
-
- -
-
-static spectral_angle(observed_intensities, predicted_intensities, charge=0, xl=False)[source]
-

Calculate spectral angle.

-
-
Parameters:
-
    -
  • observed_intensities (csr_matrix | ndarray) – observed intensities, constants.EPSILON intensity indicates zero intensity peaks, 0 intensity indicates invalid peaks (charge state > peptide charge state or position >= peptide length), array of length 174

  • -
  • predicted_intensities (csr_matrix | ndarray) – predicted intensities, see observed_intensities for details, array of length 174

  • -
  • charge (int) – to filter by the peak charges, 0 means everything

  • -
  • xl (bool) – whether operating on cleavable crosslinked or linear peptides

  • -
-
-
Raises:
-

ValueError – if charge is smaller than 1 or larger than 5

-
-
Returns:
-

SA values

-
-
Return type:
-

ndarray

-
-
-
- -
-
-static spectral_entropy_similarity(observed_intensities, predicted_intensities)[source]
-

Calculate spectral entropy similarity as defined in Li et al. (Spectral entropy outperforms MS/MS dot product similarity for small-molecule compound identification).

-
-
Parameters:
-
    -
  • observed_intensities (csr_matrix | ndarray) – observed intensities, constants.EPSILON intensity indicates zero intensity peaks, 0 intensity indicates invalid peaks (charge state > peptide charge state or position >= peptide length), array of length 174

  • -
  • predicted_intensities (csr_matrix | ndarray) – predicted intensities, see observed_intensities for details, array of length 174

  • -
-
-
Returns:
-

spectral entropy similarity values

-
-
Return type:
-

List[float]

-
-
-
- -
-
-true_intensities: ndarray | csr_matrix | None
-
- -
-
-static unit_normalization(matrix)[source]
-

Normalize each row of the matrix such that the norm equals 1.0.

-
-
Parameters:
-

matrix (csr_matrix | ndarray) – matrix with intensities, constants.EPSILON intensity indicates zero intensity peaks, 0 intensity indicates invalid peaks (charge state > peptide charge state or position >= peptide length), matrix of size (nspectra, 174)

-
-
Returns:
-

normalized matrix

-
-
Return type:
-

csr_matrix | ndarray

-
-
-
- -
- -
-
-spectrum_fundamentals.metrics.similarity.get_metric_func(metric)[source]
-

Return a callable function for a given metric shortcut.

-
-
Parameters:
-

metric (str) – a shortcut for the desired metric.

-
-
Raises:
-

ValueError – if the provided metric is not known

-
-
Returns:
-

callable metric function

-
-
-
- -
-
-

Module contents

-

Initialize metrics.

-
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/usage.html b/usage.html index 06b6a52..07253f9 100644 --- a/usage.html +++ b/usage.html @@ -1,13 +1,13 @@ - + - Usage — spectrum_fundamentals 0.6.0 documentation + Usage — Spectrum-IO 0.7.0 documentation - +