msions.hardklor

This module contains functions that are useful for interacting with Hardklor output files in Python.

Module Contents

Functions

hk2df(→ pandas.DataFrame)

Read a Hardklor tab-delimited file to a pandas DataFrame.

summarize_df(→ pandas.DataFrame)

Summarize the TIC in each scan from a Hardklor pandas DataFrame or Hardklor tab-delimited file.

msions.hardklor.hk2df(hk_file: str, by_int: bool = False) pandas.DataFrame[source]

Read a Hardklor tab-delimited file to a pandas DataFrame.

After import, all columns that can be converted to a numeric data type will be.

Parameters:
  • hk_file (str) – The Hardklor tab-delimited file to read.

  • by_int (bool) – Sort data by intensity.

Returns:

A pandas DataFrame of the input file.

Return type:

pd.DataFrame

Examples

>>> import msions.hardklor as hk
>>> hk.hk2df("test.hk")
msions.hardklor.summarize_df(hk_input: Union[pandas.DataFrame, str], full_ms1_df: pandas.DataFrame = None) pandas.DataFrame[source]

Summarize the TIC in each scan from a Hardklor pandas DataFrame or Hardklor tab-delimited file.

If an additional pandas DataFrame is provided with the MS1 scan information, the ion injection time will be mapped to each scan.

Parameters:
  • hk_input (pd.Dataframe or str) – The Hardklor pandas DataFrame or Hardklor tab-delimited file.

  • full_ms1_df (pd.DataFrame) – The pandas DataFrame containing the MS1 scan information.

Returns:

A summarized pandas DataFrame.

Return type:

pd.DataFrame

Examples

>>> import msions.hardklor as hk
>>> hk_df = hk.hk2df("test.hk")
>>> hk.summarize_df(hk_df)