msions.percolator

This module contains functions that are useful for interacting with XMLs, such as Percolator output.

Module Contents

Functions

parse_psms(→ List[dict])

Parse the PSMs in an XML file.

parse_peps(→ List[dict])

Parse the peptides in an XML file.

psms2df(→ pandas.DataFrame)

Create a pandas DataFrame of PSM XML information.

peps2df(→ pandas.DataFrame)

Create a pandas DataFrame of peptide XML information.

id_scans(perc_target, ms2_tic_df)

Create a column saying whether an MS2 was identified

match_kro(kro_df, xml_input, ms_input[, faims])

Determine if Kronik features were identified or not

msions.percolator.parse_psms(xmlfile: str) List[dict][source]

Parse the PSMs in an XML file.

Parameters:

xmlfile (str) – The XML file.

Returns:

A list of dictionaries containing PSM information.

Return type:

List[dict]

Examples

>>> from msions.percolator import parse_psms
>>> parse_psms("test.xml")
msions.percolator.parse_peps(xmlfile: str) List[dict][source]

Parse the peptides in an XML file.

Parameters:

xmlfile (str) – The XML file.

Returns:

A list of dictionaries containing peptide information.

Return type:

List[dict]

Examples

>>> from msions.msxml import parse_peps
>>> parse_peps("test.xml")
msions.percolator.psms2df(xml_input: Union[List[dict], str]) pandas.DataFrame[source]

Create a pandas DataFrame of PSM XML information.

Parameters:

xml_input (list[dict] or str) – The PSM list of dictionaries or the XML file.

Returns:

The pandas DataFrame of PSM information.

Return type:

pd.DataFrame

Examples

>>> from msions.percolator import psms2df
>>> psms2df("test.xml")
msions.percolator.peps2df(xml_input: Union[List[dict], str]) pandas.DataFrame[source]

Create a pandas DataFrame of peptide XML information.

Parameters:

xml_input (list[dict] or str) – The peptide list of dictionaries or the XML file.

Returns:

The pandas DataFrame of peptide information.

Return type:

pd.DataFrame

Examples

>>> from msions.percolator import peps2df
>>> peps2df("test.xml")
msions.percolator.id_scans(perc_target, ms2_tic_df)[source]

Create a column saying whether an MS2 was identified

Parameters:
  • perc_target (str) – The TXT file of percolator output.

  • ms2_tic_df (pd.DataFrame) – The pandas DataFrame of MS2 scan information.

Examples

>>> from msions.percolator import id_scans
>>> ms2_tic_df = mzml.tic_df("test.mzML", level="2")
>>> id_scans("test.percolator.target.peptides.txt", ms2_tic_df)
msions.percolator.match_kro(kro_df: pandas.DataFrame, xml_input: pandas.DataFrame, ms_input: pandas.DataFrame, faims: bool = False)[source]

Determine if Kronik features were identified or not

Parameters:
  • kro_df (pd.DataFrame) – The pandas DataFrame of Kronik features.

  • xml_input (pd.DataFrame) – The pandas DataFrame of Percolator XML output.

  • ms_input (pd.DataFrame) – The pandas DataFrame of MS2 scan and precursor information.

  • faims (bool) – Whether data is from FAIMS runs

Examples

>>> from msions.percolator import match_kro
>>> match_kro(kro_df, perc_xml_df, ms_df)