oktoberfest.data.Spectra

class oktoberfest.data.Spectra(*args, **kwargs)

Main to init spectra data.

Parameters:
  • args (Any)

  • kwargs (Any)

Return type:

Any

__init__(*args, **kwargs)
Parameters:
Return type:

None

Methods

add_column(data[, name])

Add column to spectra data.

add_intensities(intensities, annotation, ...)

Add predicted intensities and convert to sparse matrix.

add_intensities_without_mapping(intensities, ...)

Add predicted intensities and convert to sparse matrix.

add_list_of_predicted_intensities(...)

Add chunks of predicted intensities and convert to sparse matrix.

add_matrix_from_hdf5(intensity_data, ...)

Concatenate intensity df as a sparse matrix to our data.

add_mzs(mzs, fragment_type)

Add mass to charge ratios.

convert_to_df()

Gives back spectra_data instance as a pandas Dataframe.

filter_by_score(threshold)

Filter out peptides with search engine score below threshold in-place.

from_hdf5(input_file)

Read from hdf5 file.

get_matrix(fragment_type)

Get intensities sparse matrix from AnnData object.

get_meta_data()

Get meta data with intensity, mz and intensity predictions as pd.DataFrame.

preprocess_for_machine_learning([...])

Filter and preprocess for machine learning applications and transform into a Parquet-serializable dataframe.

remove_decoys()

Remove decoys in-place.

remove_duplicates(num_duplicates)

Filter out (peptide, charge, collision energy) duplicates if there's more than n_duplicates.

write_as_hdf5(output_file)

Write spectra_data to hdf5 file.

Attributes

COLUMNS_FRAGMENT_ION

INTENSITY_COLUMN_PREFIX

INTENSITY_COLUMN_PREFIX_A

INTENSITY_COLUMN_PREFIX_B

INTENSITY_LAYER_NAME

INTENSITY_LAYER_NAME_A

INTENSITY_LAYER_NAME_B

INTENSITY_PRED_LAYER_NAME

INTENSITY_PRED_LAYER_NAME_A

INTENSITY_PRED_LAYER_NAME_B

INTENSITY_PRED_PREFIX

INTENSITY_PRED_PREFIX_A

INTENSITY_PRED_PREFIX_B

MAX_CHARGE

MZ_COLUMN_PREFIX

MZ_COLUMN_PREFIX_A

MZ_COLUMN_PREFIX_B

MZ_LAYER_NAME

MZ_LAYER_NAME_A

MZ_LAYER_NAME_B