Skip to content

Commit

Permalink
#53 ADD docs for xic_plot.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jalew188 committed Jun 15, 2024
1 parent 34fb605 commit 1e61737
Showing 1 changed file with 62 additions and 5 deletions.
67 changes: 62 additions & 5 deletions alpharaw/viz/xic_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,15 @@


class XIC_Plot:
# hovermode = "x" | "y" | "closest" | False | "x unified" | "y unified"
"""
Only apply for 3D-MS, i.e. without mobility
"""

hovermode = "closest"
"""
hovermode = "x", "y", "closest", False, "x unified", "y unified"
"""

plot_height = 550
colorscale_qualitative = "Alphabet"
colorscale_sequential = "Viridis"
Expand All @@ -33,10 +40,6 @@ class XIC_Plot:
# list of XIC_Trace objects
traces: list = []

"""
Only apply for 3D-MS, i.e. without mobility
"""

def plot(
self,
spectrum_df: pd.DataFrame,
Expand All @@ -48,6 +51,33 @@ def plot(
plot_rows=1,
ith_plot_row=0,
):
"""
_summary_
Parameters
----------
spectrum_df : pd.DataFrame
_description_
peak_df : pd.DataFrame
_description_
query_df : pd.DataFrame
_description_
title : str, optional
_description_, by default ""
add_peak_area : bool, optional
_description_, by default False
create_new_fig : bool, optional
_description_, by default True
plot_rows : int, optional
_description_, by default 1
ith_plot_row : int, optional
_description_, by default 0
Returns
-------
_type_
_description_
"""
if "rt_sec" in query_df.columns:
rt_sec = query_df.rt_sec.values[0]
else:
Expand Down Expand Up @@ -391,6 +421,33 @@ def get_peak_area(
precursor_left_mz: float = -1.0,
precursor_right_mz: float = -1.0,
) -> np.ndarray:
"""
Get peak area values for each of the `query_masses`
Parameters
----------
spectrum_df : pd.DataFrame
The spectrum dataframe
peak_df : pd.DataFrame
The peak dataframe
query_masses : np.ndarray
The query m/z values
mass_tols : np.ndarray
The query m/z tolerance in Da
query_start_rt_sec : float
_description_
query_stop_rt_sec : float
_description_
precursor_left_mz : float, optional
_description_, by default -1.0
precursor_right_mz : float, optional
_description_, by default -1.0
Returns
-------
np.ndarray
_description_
"""
spec_idxes = get_spec_idxes_from_df(
spectrum_df,
query_start_rt_sec=query_start_rt_sec,
Expand Down

0 comments on commit 1e61737

Please sign in to comment.