Skip to content

Commit a56f4a5

Browse files
Merge pull request #226 from MannLabs/develop
Develop
2 parents 0242150 + a32faf5 commit a56f4a5

File tree

11 files changed

+34
-28
lines changed

11 files changed

+34
-28
lines changed

alphatims/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
__project__ = "alphatims"
5-
__version__ = "1.0.3"
5+
__version__ = "1.0.4"
66
__license__ = "Apache"
77
__description__ = "A Python package to index Bruker TimsTOF raw data for fast and easy accession and visualization"
88
__author__ = "Sander Willems, Eugenia Voytik"

alphatims/bruker.py

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2271,44 +2271,50 @@ def use_calibrated_mz_values_as_default(
22712271
)
22722272
self._use_calibrated_mz_values_as_default = use_calibrated_mz_values
22732273

2274-
22752274
def set_cycle(self) -> None:
22762275
"""Set the quad cycle for diaPASEF data.
22772276
"""
2278-
subframes = self.fragment_frames.drop("Frame", axis=1)
2279-
for max_index in range(1, len(subframes)):
2280-
subframe = subframes.iloc[max_index]
2281-
if subframe.equals(subframes.iloc[0]):
2282-
break
2283-
frames = self.fragment_frames.Frame[max_index] - 1
2284-
frames += (1 - int(self.zeroth_frame))
2285-
sub_cycles = frames - len(np.unique(self.fragment_frames.Frame[:max_index]))
2277+
ms1_diffs = np.diff(
2278+
np.flatnonzero(self.frames.MsMsType[int(self.zeroth_frame):]==0)
2279+
)
2280+
subcycle_length_count = np.bincount(ms1_diffs)
2281+
if np.all(subcycle_length_count[:-1]!=0):
2282+
raise ValueError("No consistent subcycle length")
2283+
subcycle_length = len(subcycle_length_count) - 1
2284+
max_precursor = len(self.fragment_frames.Precursor.unique())
2285+
subcycle_count = max_precursor // (subcycle_length - 1)
2286+
frame_count = subcycle_length * subcycle_count
22862287
cycle = np.zeros(
22872288
(
2288-
frames,
2289+
frame_count,
22892290
self.scan_max_index,
22902291
2,
22912292
)
22922293
)
2293-
# cycle[:] = -1
2294-
precursor_frames = np.ones(frames, dtype=np.bool_)
2294+
precursor_frames = np.ones(frame_count, dtype=np.bool_)
2295+
2296+
subframes = self.fragment_frames.drop("Frame", axis=1)
2297+
for max_index in range(1, len(subframes)):
2298+
subframe = subframes.iloc[max_index]
2299+
if subframe.equals(subframes.iloc[0]):
2300+
break
22952301
for index, row in self.fragment_frames[:max_index].iterrows():
22962302
frame = int(row.Frame - self.zeroth_frame)
22972303
scan_begin = int(row.ScanNumBegin)
22982304
scan_end = int(row.ScanNumEnd)
22992305
low_mz = row.IsolationMz - row.IsolationWidth / 2
23002306
high_mz = row.IsolationMz + row.IsolationWidth / 2
2301-
# print(low_mz, high_mz)
23022307
cycle[
23032308
frame,
23042309
scan_begin: scan_end,
23052310
] = (low_mz, high_mz)
23062311
precursor_frames[frame] = False
2312+
23072313
cycle[precursor_frames] = (-1, -1)
23082314
cycle = cycle.reshape(
23092315
(
2310-
sub_cycles,
2311-
frames // sub_cycles,
2316+
subcycle_count,
2317+
subcycle_length,
23122318
*cycle.shape[1:]
23132319
)
23142320
)

misc/bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 1.0.3
2+
current_version = 1.0.4
33
commit = True
44
tag = False
55
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<build>\d+))?

misc/one_click_linux/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: AlphaTims
2-
Version: 1.0.3
2+
Version: 1.0.4
33
Architecture: all
44
Maintainer: Mann Labs <[email protected]>
55
Description: AlphaTims GUI

misc/one_click_linux/create_installer_linux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ rm -rf dist
1212
rm -rf build
1313
python setup.py sdist bdist_wheel
1414
cd misc/one_click_linux
15-
pip install "../../dist/alphatims-1.0.3-py3-none-any.whl[plotting-stable,stable,legacy-stable]"
15+
pip install "../../dist/alphatims-1.0.4-py3-none-any.whl[plotting-stable,stable,legacy-stable]"
1616
pip install pyinstaller==4.10
1717
pyinstaller ../pyinstaller/alphatims.spec -y
1818
conda deactivate

misc/one_click_macos/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
<key>CFBundleIconFile</key>
1010
<string>alpha_logo.icns</string>
1111
<key>CFBundleIdentifier</key>
12-
<string>alphatims.1.0.3</string>
12+
<string>alphatims.1.0.4</string>
1313
<key>CFBundleShortVersionString</key>
14-
<string>1.0.3</string>
14+
<string>1.0.4</string>
1515
<key>CFBundleInfoDictionaryVersion</key>
1616
<string>6.0</string>
1717
<key>CFBundleName</key>

misc/one_click_macos/create_installer_macos.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ rm -rf build
1717
python setup.py sdist bdist_wheel
1818
cd misc/one_click_macos
1919
pip install pyinstaller==4.10
20-
pip install "../../dist/alphatims-1.0.3-py3-none-any.whl[plotting-stable,stable,legacy-stable]"
20+
pip install "../../dist/alphatims-1.0.4-py3-none-any.whl[plotting-stable,stable,legacy-stable]"
2121
conda list
2222
pyinstaller ../pyinstaller/alphatims.spec -y
2323
conda deactivate
@@ -34,7 +34,7 @@ if false; then
3434
# https://scriptingosx.com/2019/09/notarize-a-command-line-tool/
3535
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
3636
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
37-
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)"
37+
pkgbuild --root dist/alphatims --identifier de.mpg.biochem.alphatims.app --version 1.0.4 --install-location /Applications/AlphaTims.app --scripts scripts alphatims.pkg --sign "Developer ID Installer: Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (7QSY5527AQ)"
3838
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)"
3939
requestUUID=$(xcrun altool --notarize-app --primary-bundle-id "de.mpg.biochem.alphatims.app" --username "[email protected]" --password "@keychain:Alphatims-develop" --asc-provider 7QSY5527AQ --file dist/alphatims_gui_installer_macos.pkg 2>&1 | awk '/RequestUUID/ { print $NF; }')
4040
request_status="in progress"
@@ -46,6 +46,6 @@ if false; then
4646
xcrun altool --notarization-info "$requestUUID" --username "[email protected]" --password "@keychain:Alphatims-develop"
4747
xcrun stapler staple dist/alphatims_gui_installer_macos.pkg
4848
else
49-
pkgbuild --root dist/alphatims --identifier de.mpg.biochem.alphatims.app --version 1.0.3 --install-location /Applications/AlphaTims.app --scripts scripts alphatims.pkg
49+
pkgbuild --root dist/alphatims --identifier de.mpg.biochem.alphatims.app --version 1.0.4 --install-location /Applications/AlphaTims.app --scripts scripts alphatims.pkg
5050
productbuild --distribution distribution.xml --resources Resources --package-path alphatims.pkg dist/alphatims_gui_installer_macos.pkg
5151
fi

misc/one_click_macos/distribution.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8" standalone="no"?>
22
<installer-script minSpecVersion="1.000000">
3-
<title>AlphaTims 1.0.3</title>
3+
<title>AlphaTims 1.0.4</title>
44
<background mime-type="image/png" file="alpha_logo.png" scaling="proportional"/>
55
<welcome file="welcome.html" mime-type="text/html" />
66
<conclusion file="conclusion.html" mime-type="text/html" />

misc/one_click_windows/alphatims_innoinstaller.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
33

44
#define MyAppName "AlphaTims"
5-
#define MyAppVersion "1.0.3"
5+
#define MyAppVersion "1.0.4"
66
#define MyAppPublisher "Max Planck Institute of Biochemistry, Mann department"
77
#define MyAppURL "https://github.com/MannLabs/alphatims"
88
#define MyAppExeName "alphatims_gui.exe"

misc/one_click_windows/create_installer_windows.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ call rmdir dist /s /q
1515
call rmdir build /s /q
1616
call python setup.py sdist bdist_wheel
1717
call cd misc/one_click_windows
18-
call pip install "../../dist/alphatims-1.0.3-py3-none-any.whl[plotting-stable,stable,legacy-stable]"
18+
call pip install "../../dist/alphatims-1.0.4-py3-none-any.whl[plotting-stable,stable,legacy-stable]"
1919
call pip install pyinstaller==4.10
2020
call pyinstaller ../pyinstaller/alphatims.spec -y
2121
call conda deactivate

0 commit comments

Comments
 (0)