massdash.loaders.GenericSpectrumLoader
- class massdash.loaders.GenericSpectrumLoader(libraryFile=None, **kwargs)
Bases:
GenericRawDataLoaderAbstract class for loading raw spectrum data
- rsltsFile
(str) The path to the report file (DIANN-TSV or OSW)
- dataFiles
(str/List[str]) The path to the mzML file(s)
- libraryFile
(str) The path to the library file (.tsv or .pqp)
- abstract loadFeatureMaps(pep_id: str, charge: int, config=<class 'massdash.structs.TargetedDIAConfig.TargetedDIAConfig'>, runNames: None | str | ~typing.List[str] = None) Dict[str, FeatureMap]
Loads a dictionary of FeatureMaps (where the keys are the filenames) from the results file
- Parameters:
pep_id (str) – Peptide ID
charge (int) – Charge
runNames (None | str | List[str]) – Name of the run to extract the feature map from. If None, all runs are extracted. If str, only the specified run is extracted. If List[str], only the specified runs are extracted.
- Returns:
FeatureMap object containing peak boundaries, intensity and confidence
- Return type:
- abstract loadTransitionGroups(pep_id: str, charge: int, config: TargetedDIAConfig, runNames: None | str | List[str] = None) Dict[str, TransitionGroup]
Loads the transition group for a given peptide ID and charge across all files
- Parameters:
pep_id (str) – Peptide ID
charge (int) – Charge
config (TargetedDIAConfig) – Configuration object containing the extraction parameters
runNames (None | str | List[str]) – Name of the run to extract the transition group from. If None, all runs are extracted. If str, only the specified run is extracted. If List[str], only the specified runs are extracted.
- Returns:
Dictionary of TransitionGroups, with keys as filenames
- Return type:
dict[str, TransitionGroup]
- abstract loadTransitionGroupsDf(pep_id: str, charge: int, config: TargetedDIAConfig) Dict[str, DataFrame]
Loads the transition group for a given peptide ID and charge across all files into a pandas DataFrame
- Parameters:
pep_id (str) – Peptide ID
charge (int) – Charge
config (TargetedDIAConfig) – Configuration object containing the extraction parameters
- Returns:
Dictionary of TransitionGroups, with keys as filenames
- Return type:
dict[str, pd.DataFrame]
- plotChromatogram(seq: str, charge: int, runName: str | None = None, includeBoundaries: bool = True, include_ms1: bool = False, smooth: bool = True, sgolay_polynomial_order: int = 3, sgolay_frame_length: int = 11, mz_tol: float = 20, rt_window: float = 50, im_window: float | None = None, **kwargs) bokeh.plotting.figure.Figure
Plots a chromatogram for a given peptide sequence and charge state for a given run
- Parameters:
seq (str) – Peptide sequence
charge (int) – Charge state
runName (str) – Name of the run to extract the chromatogram from
includeBoundaries (bool, optional) – Whether to include peak boundaries. Defaults to True.
include_ms1 (bool, optional) – Whether to include MS1 data. Defaults to False.
smooth (bool, optional) – Whether to smooth the chromatogram. Defaults to True.
sgolay_polynomial_order (int, optional) – Order of the polynomial to use for smoothing. Defaults to 3.
sgolay_frame_length (int, optional) – Frame length to use for smoothing. Defaults to 11.
mz_tol (float, optional) – m/z tolerance for extraction (in ppm). Defaults to 20.
rt_tol (float, optional) – RT tolerance for extraction (in seconds). Defaults to 50.
im_tol (float, optional) – IM tolerance for extraction (in 1/k0). Defaults to None.
- Returns:
Bokeh figure object
- Return type:
bokeh.plotting.figure.Figure