Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenwacker committed Feb 9, 2023
1 parent 76483b5 commit 19120a9
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 13 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,5 +256,6 @@ The target list can be stored as csv or Excel file.

# Release Notes

## 0.1.9 Milestones
## 0.2.0 Milestones
- peak_area_top3 comparable to El-Maven PeakAreaTop values

4 changes: 2 additions & 2 deletions images/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions ms_mint/Mint.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
)
from .pca import PrincipalComponentsAnalyser
from .plotting import MintPlotter
from .filter import Resampler
#from .filter import Resampler
from .chromatogram import Chromatogram, extract_chromatogram_from_ms1

import ms_mint
Expand Down Expand Up @@ -497,9 +497,8 @@ def get_chromatograms(self, fns=None, peak_label=None, **kwargs):
if peak_label is None:
peak_label = self.peak_labels

resampler = Resampler()

data = []

for fn in self.tqdm(fns):
df = ms_file_to_df(fn)
for label in peak_label:
Expand All @@ -515,6 +514,7 @@ def get_chromatograms(self, fns=None, peak_label=None, **kwargs):
chrom_data["rt_min"] = rt_min
chrom_data["rt_max"] = rt_min
data.append(chrom_data)

data = pd.concat(data).reset_index()

data["ms_file"] = data["ms_file"].apply(lambda x: P(x).with_suffix("").name)
Expand Down
7 changes: 6 additions & 1 deletion ms_mint/pca.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,12 @@ def cumulative_variance(self, height=4, aspect=2):
n_components = self.pca.results["n_components"]
fig = plt.figure(figsize=(height * aspect, height))
cum_expl_var = self.pca.results["cum_expl_var"]
plt.bar(np.arange(n_components) + 1, cum_expl_var, facecolor="grey", edgecolor="none")
plt.bar(
np.arange(n_components) + 1,
cum_expl_var,
facecolor="grey",
edgecolor="none",
)
plt.xlabel("Principal Component")
plt.ylabel("Explained variance [%]")
plt.title("Cumulative explained variance")
Expand Down
4 changes: 0 additions & 4 deletions ms_mint/plotting.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import numpy as np
import seaborn as sns
import pandas as pd

from warnings import simplefilter
from scipy.cluster.hierarchy import ClusterWarning
Expand All @@ -15,11 +14,8 @@
plot_metabolomics_hist2d,
)

from tqdm import tqdm

import plotly.express as px

from .filter import Resampler
from .tools import scale_dataframe, mz_mean_width_to_min_max
from .io import ms_file_to_df

Expand Down
2 changes: 1 addition & 1 deletion tests/test__integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def test__optimize_min_max():
mint.targets["rt_max"] = None
print("Before")
print(mint.targets[["rt", "rt_min", "rt_max"]])
result = mint.opt.rt_min_max()
mint.opt.rt_min_max()
print("After")
print(mint.targets[["rt", "rt_min", "rt_max"]])
n_missing_values_in_rt_cols = mint.targets[["rt_min", "rt_max"]].isna().sum().sum()
Expand Down
2 changes: 1 addition & 1 deletion tests/test__targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from paths import (
# TEST_TARGETS_FN_V2_CSV_SEC,
TEST_TARGETS_FN_V0_XLSX,
#TEST_TARGETS_FN_V0_XLSX,
TEST_TARGETS_FN_V0,
TEST_TARGETS_FN_V1,
)
Expand Down

0 comments on commit 19120a9

Please sign in to comment.