Skip to content

Commit

Permalink
fixed pairplot
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenwacker committed Mar 1, 2023
1 parent 08dbab9 commit fea0852
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions ms_mint/plotly_tools.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import logging

import numpy as np
import colorlover as cl

Expand Down Expand Up @@ -217,6 +219,7 @@ def plotly_heatmap(

def plotly_peak_shapes(
mint_results,
fns=None,
col_wrap=1,
peak_labels=None,
legend=True,
Expand All @@ -231,6 +234,8 @@ def plotly_peak_shapes(
mint_results = mint_results.copy()
mint_results.ms_file = [P(fn).name for fn in mint_results.ms_file]

logging.warning('TEST')

res = mint_results[mint_results.peak_area > 0]

fns = list(res.ms_file.drop_duplicates())
Expand Down Expand Up @@ -263,10 +268,11 @@ def plotly_peak_shapes(
# Create sub-plots
for label_i, label in enumerate(peak_labels):
for file_i, fn in enumerate(fns):
# try:
x, y = res.loc[(label, fn), ["peak_shape_rt", "peak_shape_int"]]
# except:
# continue
try:
x, y = res.loc[(label, fn), ["peak_shape_rt", "peak_shape_int"]]
except KeyError as e:
logging.warning(e)
continue
if not isinstance(x, Iterable):
continue

Expand Down

0 comments on commit fea0852

Please sign in to comment.