R Under development (unstable) (2026-10-22 r90747) -- "Unsuffered Consequences" Copyright (C) 2026 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > pkgname <- "opentimsr" > source(file.path(R.home("share"), "R", "examples-header.R")) > options(warn = 1) > library('opentimsr') > > base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') > base::assign(".old_wd", base::getwd(), pos = 'CheckExEnv') > cleanEx() > nameEx("CloseTIMS") > ### * CloseTIMS > > flush(stderr()); flush(stdout()) > > ### Name: CloseTIMS > ### Title: Close the TIMS data handle and release all resources. > ### Aliases: CloseTIMS > > ### ** Examples > > path.d = system.file("extdata", "test.d", package = "opentimsr") > setup_opensource() > D = OpenTIMS(path.d) > CloseTIMS(D) > > > > cleanEx() > nameEx("MS1") > ### * MS1 > > flush(stderr()); flush(stdout()) > > ### Name: MS1 > ### Title: Get MS1 frame numbers. > ### Aliases: MS1 > > ### ** Examples > > path.d = system.file("extdata", "test.d", package = "opentimsr") > setup_opensource() > D = OpenTIMS(path.d) > MS1(D) [1] 1 > CloseTIMS(D) > > > > cleanEx() > nameEx("OpenTIMS") > ### * OpenTIMS > > flush(stderr()); flush(stdout()) > > ### Name: OpenTIMS > ### Title: Get OpenTIMS data representation. > ### Aliases: OpenTIMS > > ### ** Examples > > path.d = system.file("extdata", "test.d", package = "opentimsr") > setup_opensource() > D = OpenTIMS(path.d) > D[1] # first frame frame scan tof intensity 1 1 33 268877 10 2 1 49 36849 10 3 1 53 356994 87 4 1 59 366925 10 5 1 62 103614 80 > CloseTIMS(D) > > > > cleanEx() > nameEx("download_bruker_proprietary_code") > ### * download_bruker_proprietary_code > > flush(stderr()); flush(stdout()) > > ### Name: download_bruker_proprietary_code > ### Title: Get Bruker's code needed for running proprietary time of flight > ### to mass over charge and scan to drift time conversion. > ### Aliases: download_bruker_proprietary_code > > ### ** Examples > > > > > cleanEx() > nameEx("explore.tdf.tables") > ### * explore.tdf.tables > > flush(stderr()); flush(stdout()) > > ### Name: explore.tdf.tables > ### Title: Explore the contentents of the sqlite .tdf database. > ### Aliases: explore.tdf.tables > > ### ** Examples > > path.d = system.file("extdata", "test.d", package = "opentimsr") > setup_opensource() > D = OpenTIMS(path.d) > if (interactive()) explore.tdf.tables(D) > CloseTIMS(D) > > > > cleanEx() > nameEx("get_separate_frames") > ### * get_separate_frames > > flush(stderr()); flush(stdout()) > > ### Name: get_separate_frames > ### Title: Get frames as separate data frames. > ### Aliases: get_separate_frames > > ### ** Examples > > path.d = system.file("extdata", "test.d", package = "opentimsr") > setup_opensource() > D = OpenTIMS(path.d) > frames = get_separate_frames(D, c(1, 2)) opentims_core/opentims.cpp:92:14: runtime error: load of misaligned address 0x7fa9e742005a for type 'const uint32_t', which requires 4 byte alignment 0x7fa9e742005a: note: pointer points here 63 1c 60 01 54 00 00 00 96 03 00 00 28 b5 2f fd 60 80 0d 15 02 00 94 02 96 00 02 00 02 00 02 00 ^ #0 0x7ba9da47b70f in TimsFrame::decompress(char*, ZSTD_DCtx_s*) opentims_core/opentims.cpp:92 #1 0x7ba9da4b7c4d in operator() opentims_core/opentims.cpp:731 #2 0x7ba9da4b7c4d in __invoke_impl&):: > /usr/include/c++/16/bits/invoke.h:63 #3 0x7ba9da4b7c4d in __invoke&):: > /usr/include/c++/16/bits/invoke.h:98 #4 0x7ba9da4b7c4d in _M_invoke<0> /usr/include/c++/16/bits/std_thread.h:303 #5 0x7ba9da4b7c4d in operator() /usr/include/c++/16/bits/std_thread.h:310 #6 0x7ba9da4b7c4d in _M_run /usr/include/c++/16/bits/std_thread.h:255 #7 0x7fa9e6051475 in execute_native_thread_routine (/lib64/libstdc++.so.6+0x51475) (BuildId: 19730e8a5f72329cd19c291b10a0ee4275294ed5) #8 0x7fa9e7c2b606 in asan_thread_start(void*) (/lib64/libasan.so.8+0x2b606) (BuildId: 61e8165ca90f7a4f06b73f064a938c76deaae079) #9 0x7fa9e6479c41 in start_thread (/lib64/libc.so.6+0x72c41) (BuildId: 85075e2ae2e13352a1413d41c327dacf6461526c) #10 0x7fa9e64fd5ab in __GI___clone3 (/lib64/libc.so.6+0xf65ab) (BuildId: 85075e2ae2e13352a1413d41c327dacf6461526c) > names(frames) [1] "1" "2" > head(frames[["2"]]) frame scan tof intensity mz inv_ion_mobility retention_time 1 2 54 399169 10 1481.0866 1.541176 0.751175 2 2 56 205746 51 541.1614 1.538998 0.751175 3 2 73 205657 10 540.8356 1.520479 0.751175 4 2 80 66533 10 151.4643 1.512854 0.751175 5 2 83 315625 10 1018.2569 1.509586 0.751175 > get_separate_frames(D, 1, columns=c('scan','intensity')) # only 'scan' and 'intensity' $`1` scan intensity 1 33 10 2 49 10 3 53 87 4 59 10 5 62 80 > CloseTIMS(D) > > > > cleanEx() > nameEx("length-OpenTIMS-method") > ### * length-OpenTIMS-method > > flush(stderr()); flush(stdout()) > > ### Name: length,OpenTIMS-method > ### Title: Get the overall number of peaks. > ### Aliases: length,OpenTIMS-method > > ### ** Examples > > path.d = system.file("extdata", "test.d", package = "opentimsr") > setup_opensource() > D = OpenTIMS(path.d) > length(D) # number of peaks in the dataset [1] 10 > CloseTIMS(D) > > > > cleanEx() > nameEx("min_max_measurements") > ### * min_max_measurements > > flush(stderr()); flush(stdout()) > > ### Name: min_max_measurements > ### Title: Get border values for measurements. > ### Aliases: min_max_measurements > > ### ** Examples > > path.d = system.file("extdata", "test.d", package = "opentimsr") > setup_opensource() > D = OpenTIMS(path.d) > min_max_measurements(D) # small data frame with min and max values stat frame scan intensity retention.time inv_ion_mobility mz 1 min 1 1 0 0.644238 0.6 50 2 max 2 918 87 0.751175 1.6 1700 > CloseTIMS(D) > > > > cleanEx() > nameEx("opentims_set_threads") > ### * opentims_set_threads > > flush(stderr()); flush(stdout()) > > ### Name: opentims_set_threads > ### Title: Set the number of threads to be used for data processing by > ### OpenTIMS > ### Aliases: opentims_set_threads > > ### ** Examples > > opentims_set_threads(1) > > > > cleanEx() > nameEx("peaks_per_frame_cnts") > ### * peaks_per_frame_cnts > > flush(stderr()); flush(stdout()) > > ### Name: peaks_per_frame_cnts > ### Title: Get the number of peaks per frame. > ### Aliases: peaks_per_frame_cnts > > ### ** Examples > > path.d = system.file("extdata", "test.d", package = "opentimsr") > setup_opensource() > D = OpenTIMS(path.d) > peaks_per_frame_cnts(D) [1] 5 5 > CloseTIMS(D) > > > > cleanEx() > nameEx("query") > ### * query > > flush(stderr()); flush(stdout()) > > ### Name: query > ### Title: Query for raw data. > ### Aliases: query > > ### ** Examples > > path.d = system.file("extdata", "test.d", package = "opentimsr") > setup_opensource() > D = OpenTIMS(path.d) > query(D, c(1, 2)) # extract all columns frame scan tof intensity mz inv_ion_mobility retention_time 1 1 33 268877 10 796.99852 1.564052 0.644238 2 1 49 36849 10 99.42108 1.546623 0.644238 3 1 53 356994 87 1236.63334 1.542266 0.644238 4 1 59 366925 10 1292.21184 1.535730 0.644238 5 1 62 103614 80 231.80937 1.532462 0.644238 6 2 54 399169 10 1481.08660 1.541176 0.751175 7 2 56 205746 51 541.16139 1.538998 0.751175 8 2 73 205657 10 540.83557 1.520479 0.751175 9 2 80 66533 10 151.46434 1.512854 0.751175 10 2 83 315625 10 1018.25694 1.509586 0.751175 > query(D, c(1, 2), columns=c('scan','intensity')) # only 'scan' and 'intensity' scan intensity 1 33 10 2 49 10 3 53 87 4 59 10 5 62 80 6 54 10 7 56 51 8 73 10 9 80 10 10 83 10 > CloseTIMS(D) > > > > cleanEx() > nameEx("query_slice") > ### * query_slice > > flush(stderr()); flush(stdout()) > > ### Name: query_slice > ### Title: Query for raw data. > ### Aliases: query_slice > > ### ** Examples > > path.d = system.file("extdata", "test.d", package = "opentimsr") > setup_opensource() > D = OpenTIMS(path.d) > query_slice(D, 1, 2) # frames 1 to 2 frame scan tof intensity mz inv_ion_mobility retention_time 1 1 33 268877 10 796.99852 1.564052 0.644238 2 1 49 36849 10 99.42108 1.546623 0.644238 3 1 53 356994 87 1236.63334 1.542266 0.644238 4 1 59 366925 10 1292.21184 1.535730 0.644238 5 1 62 103614 80 231.80937 1.532462 0.644238 6 2 54 399169 10 1481.08660 1.541176 0.751175 7 2 56 205746 51 541.16139 1.538998 0.751175 8 2 73 205657 10 540.83557 1.520479 0.751175 9 2 80 66533 10 151.46434 1.512854 0.751175 10 2 83 315625 10 1018.25694 1.509586 0.751175 > query_slice(D, 1, 2, 2) # every second frame between 1 and 2 frame scan tof intensity mz inv_ion_mobility retention_time 1 1 33 268877 10 796.99852 1.564052 0.644238 2 1 49 36849 10 99.42108 1.546623 0.644238 3 1 53 356994 87 1236.63334 1.542266 0.644238 4 1 59 366925 10 1292.21184 1.535730 0.644238 5 1 62 103614 80 231.80937 1.532462 0.644238 > query_slice(D, 1, 2, columns=c('scan','intensity')) # only 'scan' and 'intensity' scan intensity 1 33 10 2 49 10 3 53 87 4 59 10 5 62 80 6 54 10 7 56 51 8 73 10 9 80 10 10 83 10 > CloseTIMS(D) > > > > cleanEx() > nameEx("range-OpenTIMS-method") > ### * range-OpenTIMS-method > > flush(stderr()); flush(stdout()) > > ### Name: range,OpenTIMS-method > ### Title: Select a range of frames to extract. > ### Aliases: range,OpenTIMS-method > > ### ** Examples > > path.d = system.file("extdata", "test.d", package = "opentimsr") > setup_opensource() > D = OpenTIMS(path.d) > head(range(D, 1, 3)) # frames 1 and 2 frame scan tof intensity 1 1 33 268877 10 2 1 49 36849 10 3 1 53 356994 87 4 1 59 366925 10 5 1 62 103614 80 6 2 54 399169 10 > head(range(D, 1, 3, 2)) # every second frame, i.e. only frame 1 frame scan tof intensity 1 1 33 268877 10 2 1 49 36849 10 3 1 53 356994 87 4 1 59 366925 10 5 1 62 103614 80 > CloseTIMS(D) > > > > cleanEx() > nameEx("retention_times") > ### * retention_times > > flush(stderr()); flush(stdout()) > > ### Name: retention_times > ### Title: Get the retention time for each frame. > ### Aliases: retention_times > > ### ** Examples > > path.d = system.file("extdata", "test.d", package = "opentimsr") > setup_opensource() > D = OpenTIMS(path.d) > retention_times(D) [1] 0.644238 0.751175 > CloseTIMS(D) > > > > cleanEx() > nameEx("rt_query") > ### * rt_query > > flush(stderr()); flush(stdout()) > > ### Name: rt_query > ### Title: Get the retention time for each frame. > ### Aliases: rt_query > > ### ** Examples > > path.d = system.file("extdata", "test.d", package = "opentimsr") > setup_opensource() > D = OpenTIMS(path.d) > rt_query(D, 0.6, 0.7) # frames recorded between 0.6 and 0.7 seconds frame scan tof intensity mz inv_ion_mobility retention_time 1 1 33 268877 10 796.99852 1.564052 0.644238 2 1 49 36849 10 99.42108 1.546623 0.644238 3 1 53 356994 87 1236.63334 1.542266 0.644238 4 1 59 366925 10 1292.21184 1.535730 0.644238 5 1 62 103614 80 231.80937 1.532462 0.644238 > CloseTIMS(D) > > > > cleanEx() > nameEx("setup_bruker_so") > ### * setup_bruker_so > > flush(stderr()); flush(stdout()) > > ### Name: setup_bruker_so > ### Title: Dynamically link Bruker's DLL to enable tof-mz and > ### scan-inv_ion_mobility conversion. > ### Aliases: setup_bruker_so > > ### ** Examples > > > > > cleanEx() > nameEx("setup_opensource") > ### * setup_opensource > > flush(stderr()); flush(stdout()) > > ### Name: setup_opensource > ### Title: Use the built-in open-source tof-to-mz and > ### scan-to-inv_ion_mobility converters. > ### Aliases: setup_opensource > > ### ** Examples > > setup_opensource() > > > > cleanEx() > nameEx("sub-OpenTIMS-method") > ### * sub-OpenTIMS-method > > flush(stderr()); flush(stdout()) > > ### Name: [,OpenTIMS-method > ### Title: Get some frames of data. > ### Aliases: [,OpenTIMS-method > > ### ** Examples > > path.d = system.file("extdata", "test.d", package = "opentimsr") > setup_opensource() > D = OpenTIMS(path.d) > head(D[1]) # first frame frame scan tof intensity 1 1 33 268877 10 2 1 49 36849 10 3 1 53 356994 87 4 1 59 366925 10 5 1 62 103614 80 > head(D[1:2]) # frames 1 and 2 frame scan tof intensity 1 1 33 268877 10 2 1 49 36849 10 3 1 53 356994 87 4 1 59 366925 10 5 1 62 103614 80 6 2 54 399169 10 > CloseTIMS(D) > > > > cleanEx() > nameEx("table2df") > ### * table2df > > flush(stderr()); flush(stdout()) > > ### Name: table2df > ### Title: Extract tables from sqlite database analysis.tdf. > ### Aliases: table2df > > ### ** Examples > > path.d = system.file("extdata", "test.d", package = "opentimsr") > setup_opensource() > D = OpenTIMS(path.d) > head(table2df(D, "Frames")$Frames) # extract table "Frames" Id Time Polarity ScanMode MsMsType TimsId MaxIntensity SummedIntensities 1 1 0.644238 + 9 0 0 87 197 2 2 0.751175 + 9 9 90 51 91 NumScans NumPeaks MzCalibration T1 T2 TimsCalibration 1 918 5 1 25.38175 26.21541 1 2 918 5 1 25.38175 26.21541 1 PropertyGroup AccumulationTime RampTime Pressure 1 1 100 99.953 2.665126 2 1 100 99.953 2.665126 > CloseTIMS(D) > > > > cleanEx() > nameEx("tables_names") > ### * tables_names > > flush(stderr()); flush(stdout()) > > ### Name: tables_names > ### Title: Extract tables from sqlite database analysis.tdf. > ### Aliases: tables_names > > ### ** Examples > > path.d = system.file("extdata", "test.d", package = "opentimsr") > setup_opensource() > D = OpenTIMS(path.d) > tables_names(D) [1] "CalibrationInfo" "CollisionEnergySweepingInfo" [3] "DiaFrameMsMsInfo" "DiaFrameMsMsWindowGroups" [5] "DiaFrameMsMsWindows" "ErrorLog" [7] "FrameMsMsInfo" "FrameProperties" [9] "Frames" "GlobalMetadata" [11] "GroupProperties" "MzCalibration" [13] "PrmFrameMeasurementMode" "PrmFrameMsMsInfo" [15] "PrmTargets" "Properties" [17] "PropertyDefinitions" "PropertyGroups" [19] "Segments" "TimsCalibration" > CloseTIMS(D) > > > > cleanEx() > nameEx("use_inv_ion_mobility_lookup") > ### * use_inv_ion_mobility_lookup > > flush(stderr()); flush(stdout()) > > ### Name: use_inv_ion_mobility_lookup > ### Title: Use a lookup table for inverse ion mobility conversion with > ### Bruker's library. > ### Aliases: use_inv_ion_mobility_lookup > > ### ** Examples > > > > > cleanEx() > nameEx("use_mz_lookup") > ### * use_mz_lookup > > flush(stderr()); flush(stdout()) > > ### Name: use_mz_lookup > ### Title: Use a lookup table for m/z conversion with Bruker's library. > ### Aliases: use_mz_lookup > > ### ** Examples > > > > > ### *