Skip to content

Commit

Permalink
Merge pull request #225 from MannLabs/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
sander-willems-bruker authored Sep 23, 2022
2 parents 35e7a54 + 948dfd0 commit 0242150
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 29 deletions.
2 changes: 1 addition & 1 deletion alphatims/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


__project__ = "alphatims"
__version__ = "1.0.2"
__version__ = "1.0.3"
__license__ = "Apache"
__description__ = "A Python package to index Bruker TimsTOF raw data for fast and easy accession and visualization"
__author__ = "Sander Willems, Eugenia Voytik"
Expand Down
22 changes: 9 additions & 13 deletions alphatims/bruker.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ def read_bruker_sql(
frames.MaxIntensity[0] = 0
frames.SummedIntensities[0] = 0
frames.NumPeaks[0] = 0
frames.MsMsType[0] = 0
polarity_col = frames["Polarity"].copy()
frames = pd.DataFrame(
{
Expand Down Expand Up @@ -1183,7 +1184,8 @@ def _import_data_from_d_folder(
self._parse_quad_indptr()
self._intensity_min_value = int(np.min(self.intensity_values))
self._intensity_max_value = int(np.max(self.intensity_values))
self.set_cycle()
if self.acquisition_mode == "diaPASEF":
self.set_cycle()

def save_as_hdf(
self,
Expand Down Expand Up @@ -2273,19 +2275,13 @@ def use_calibrated_mz_values_as_default(
def set_cycle(self) -> None:
"""Set the quad cycle for diaPASEF data.
"""
last_window_group = -1
for max_index, (frame, window_group) in enumerate(
zip(
self.fragment_frames.Frame,
self.fragment_frames.Precursor
)
):
if window_group < last_window_group:
subframes = self.fragment_frames.drop("Frame", axis=1)
for max_index in range(1, len(subframes)):
subframe = subframes.iloc[max_index]
if subframe.equals(subframes.iloc[0]):
break
else:
last_window_group = window_group
frames = self.fragment_frames.Frame[max_index-1]
frames += self.fragment_frames.Frame[0] == int(self.zeroth_frame)
frames = self.fragment_frames.Frame[max_index] - 1
frames += (1 - int(self.zeroth_frame))
sub_cycles = frames - len(np.unique(self.fragment_frames.Frame[:max_index]))
cycle = np.zeros(
(
Expand Down
5 changes: 4 additions & 1 deletion alphatims/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,10 @@ def detect(**kwargs):
def export_hdf(**kwargs):
with parse_cli_settings("export hdf", **kwargs) as parameters:
import alphatims.bruker
data = alphatims.bruker.TimsTOF(parameters["bruker_raw_data"])
data = alphatims.bruker.TimsTOF(
parameters["bruker_raw_data"],
use_hdf_if_available=False
)
if "output_folder" not in parameters:
directory = data.directory
else:
Expand Down
2 changes: 1 addition & 1 deletion alphatims/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def line_plot(

def heatmap(
df,
x_axis_label: str = "rt",
x_axis_label: str = "mz",
y_axis_label: str = "mobility",
title: str = "",
z_axis_label: str = "intensity",
Expand Down
2 changes: 1 addition & 1 deletion alphatims/tempmmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def make_temp_dir(prefix: str = "temp_mmap_") -> tuple:
f"WARNING: Temp mmap arrays are written to {TEMP_DIR_NAME}. "
"Cleanup of this folder is OS dependant, "
"and might need to be triggered manually! "
f"Current space: {shutil.disk_usage(TEMP_DIR_NAME)[-1]}"
f"Current space: {shutil.disk_usage(TEMP_DIR_NAME)[-1]:,}"
)


Expand Down
2 changes: 1 addition & 1 deletion misc/bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.0.2
current_version = 1.0.3
commit = True
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<build>\d+))?
Expand Down
2 changes: 1 addition & 1 deletion misc/one_click_linux/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: AlphaTims
Version: 1.0.2
Version: 1.0.3
Architecture: all
Maintainer: Mann Labs <opensource@alphapept.com>
Description: AlphaTims GUI
Expand Down
2 changes: 1 addition & 1 deletion misc/one_click_linux/create_installer_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ rm -rf dist
rm -rf build
python setup.py sdist bdist_wheel
cd misc/one_click_linux
pip install "../../dist/alphatims-1.0.2-py3-none-any.whl[plotting-stable,stable,legacy-stable]"
pip install "../../dist/alphatims-1.0.3-py3-none-any.whl[plotting-stable,stable,legacy-stable]"
pip install pyinstaller==4.10
pyinstaller ../pyinstaller/alphatims.spec -y
conda deactivate
Expand Down
4 changes: 2 additions & 2 deletions misc/one_click_macos/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<key>CFBundleIconFile</key>
<string>alpha_logo.icns</string>
<key>CFBundleIdentifier</key>
<string>alphatims.1.0.2</string>
<string>alphatims.1.0.3</string>
<key>CFBundleShortVersionString</key>
<string>1.0.2</string>
<string>1.0.3</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand Down
6 changes: 3 additions & 3 deletions misc/one_click_macos/create_installer_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ rm -rf build
python setup.py sdist bdist_wheel
cd misc/one_click_macos
pip install pyinstaller==4.10
pip install "../../dist/alphatims-1.0.2-py3-none-any.whl[plotting-stable,stable,legacy-stable]"
pip install "../../dist/alphatims-1.0.3-py3-none-any.whl[plotting-stable,stable,legacy-stable]"
conda list
pyinstaller ../pyinstaller/alphatims.spec -y
conda deactivate
Expand All @@ -34,7 +34,7 @@ if false; then
# https://scriptingosx.com/2019/09/notarize-a-command-line-tool/
for f in $(find dist/alphatims -name '*.so' -or -name '*.dylib'); do codesign --sign "Developer ID Application: Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (7QSY5527AQ)" $f; done
codesign --sign "Developer ID Application: Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (7QSY5527AQ)" dist/alphatims/Contents/MacOS/alphatims_gui --force --options=runtime --entitlements entitlements.xml
pkgbuild --root dist/alphatims --identifier de.mpg.biochem.alphatims.app --version 1.0.2 --install-location /Applications/AlphaTims.app --scripts scripts alphatims.pkg --sign "Developer ID Installer: Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (7QSY5527AQ)"
pkgbuild --root dist/alphatims --identifier de.mpg.biochem.alphatims.app --version 1.0.3 --install-location /Applications/AlphaTims.app --scripts scripts alphatims.pkg --sign "Developer ID Installer: Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (7QSY5527AQ)"
productbuild --distribution distribution.xml --resources Resources --package-path alphatims.pkg dist/alphatims_gui_installer_macos.pkg --sign "Developer ID Installer: Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (7QSY5527AQ)"
requestUUID=$(xcrun altool --notarize-app --primary-bundle-id "de.mpg.biochem.alphatims.app" --username "willems@biochem.mpg.de" --password "@keychain:Alphatims-develop" --asc-provider 7QSY5527AQ --file dist/alphatims_gui_installer_macos.pkg 2>&1 | awk '/RequestUUID/ { print $NF; }')
request_status="in progress"
Expand All @@ -46,6 +46,6 @@ if false; then
xcrun altool --notarization-info "$requestUUID" --username "willems@biochem.mpg.de" --password "@keychain:Alphatims-develop"
xcrun stapler staple dist/alphatims_gui_installer_macos.pkg
else
pkgbuild --root dist/alphatims --identifier de.mpg.biochem.alphatims.app --version 1.0.2 --install-location /Applications/AlphaTims.app --scripts scripts alphatims.pkg
pkgbuild --root dist/alphatims --identifier de.mpg.biochem.alphatims.app --version 1.0.3 --install-location /Applications/AlphaTims.app --scripts scripts alphatims.pkg
productbuild --distribution distribution.xml --resources Resources --package-path alphatims.pkg dist/alphatims_gui_installer_macos.pkg
fi
2 changes: 1 addition & 1 deletion misc/one_click_macos/distribution.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<installer-script minSpecVersion="1.000000">
<title>AlphaTims 1.0.2</title>
<title>AlphaTims 1.0.3</title>
<background mime-type="image/png" file="alpha_logo.png" scaling="proportional"/>
<welcome file="welcome.html" mime-type="text/html" />
<conclusion file="conclusion.html" mime-type="text/html" />
Expand Down
2 changes: 1 addition & 1 deletion misc/one_click_windows/alphatims_innoinstaller.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "AlphaTims"
#define MyAppVersion "1.0.2"
#define MyAppVersion "1.0.3"
#define MyAppPublisher "Max Planck Institute of Biochemistry, Mann department"
#define MyAppURL "https://github.com/MannLabs/alphatims"
#define MyAppExeName "alphatims_gui.exe"
Expand Down
2 changes: 1 addition & 1 deletion misc/one_click_windows/create_installer_windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ call rmdir dist /s /q
call rmdir build /s /q
call python setup.py sdist bdist_wheel
call cd misc/one_click_windows
call pip install "../../dist/alphatims-1.0.2-py3-none-any.whl[plotting-stable,stable,legacy-stable]"
call pip install "../../dist/alphatims-1.0.3-py3-none-any.whl[plotting-stable,stable,legacy-stable]"
call pip install pyinstaller==4.10
call pyinstaller ../pyinstaller/alphatims.spec -y
call conda deactivate
Expand Down
2 changes: 1 addition & 1 deletion misc/one_click_windows/create_installer_windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ rm -rf dist
rm -rf build
python setup.py sdist bdist_wheel
cd misc/one_click_windows
pip install "../../dist/alphatims-1.0.2-py3-none-any.whl[plotting-stable,stable,legacy-stable]"
pip install "../../dist/alphatims-1.0.3-py3-none-any.whl[plotting-stable,stable,legacy-stable]"
pip install pyinstaller==4.10
# TODO https://stackoverflow.com/questions/54175042/python-3-7-anaconda-environment-import-ssl-dll-load-fail-error/60405693#60405693
pyinstaller ../pyinstaller/alphatims.spec -y
Expand Down

0 comments on commit 0242150

Please sign in to comment.