Skip to content

Commit 0e72e12

Browse files
authored
Merge pull request #81 from cpanse/master
#75 replace mono by dotnet
2 parents 8719697 + 84d1290 commit 0e72e12

21 files changed

+478
-826
lines changed

DESCRIPTION

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: rawrr
22
Type: Package
33
Title: Direct Access to Orbitrap Data and Beyond
4-
Version: 1.15.1
4+
Version: 1.15.3
55
Authors@R: c(person("Christian", "Panse",
66
email = "[email protected]",
77
role = c("aut", "cre"),
@@ -25,20 +25,20 @@ Suggests:
2525
rmarkdown,
2626
tartare (>= 1.5),
2727
testthat
28-
Description: This package wraps the functionality
29-
of the RawFileReader .NET assembly. Within the R environment,
28+
Description: This package wraps the functionality of the
29+
Thermo Fisher Scientic RawFileReader .NET 8.0 assembly.
30+
Within the R environment,
3031
spectra and chromatograms are represented by S3 objects.
3132
The package provides basic functions to download and install
3233
the required third-party libraries.
3334
The package is developed, tested, and used at the Functional
3435
Genomics Center Zurich, Switzerland.
3536
License: GPL-3
36-
SystemRequirements: mono-runtime 4.x or higher (including System.Data library)
37-
on Linux/macOS, .Net Framework (>= 4.5.1) on Microsoft Windows.
37+
SystemRequirements: .NET 8.0
3838
URL: https://github.com/fgcz/rawrr/
3939
BugReports: https://github.com/fgcz/rawrr/issues
4040
Encoding: UTF-8
4141
NeedsCompilation: no
42-
RoxygenNote: 7.3.1
42+
RoxygenNote: 7.3.2
4343
biocViews: MassSpectrometry, Proteomics, Metabolomics, Infrastructure, Software
4444
VignetteBuilder: knitr

INSTALL

+35-45
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,73 @@
11
# System requirements
22

3-
## Linux (debian:10/ubuntu:20.04)
3+
The `rawrr` executable will run out of the box.
44

5-
In case you prefer to compile `rawrr.exe` from C# source code, please install
6-
the mono compiler and xbuild by installing the following Linux packages:
5+
I you want to build on your own follow the text below.
76

8-
```{sh}
9-
sudo apt-get install mono-mcs mono-xbuild
10-
```
7+
## Compile and Link yourself
118

12-
Otherwise, to execute the precompiled code, the following Linux packages are
13-
sufficient:
9+
In case you prefer to compile `rawrr.exe` from C# source code, please install
10+
the .NET 8.0
1411

15-
```{sh}
16-
sudo apt-get install mono-runtime libmono-system-data4.0-cil -y
17-
```
12+
### Linux (debian:10/ubuntu:20.04) (debian:12/ubuntu:24)
1813

19-
## macOS (Catalina/BigSur)
2014

15+
```{sh}
16+
## DEPRECIATED: sudo apt-get install mono-mcs mono-xbuild
17+
sudo apt-get install dotnet-sdk-8.0
2118
```
22-
brew install mono
23-
```
24-
25-
or install from
2619

27-
https://www.mono-project.com/
20+
### macOS (Catalina/BigSur/.../Sequoia)
2821

29-
## Microsoft Windows
22+
https://dotnet.microsoft.com/en-us/download
3023

31-
Running the `rawrr.exe` will run out of the box.
24+
### Microsoft Windows
3225

33-
If the native C# compiler is not available install mono from:
26+
https://dotnet.microsoft.com/en-us/download
3427

35-
https://www.mono-project.com/
28+
## Install the .NET assemblies
3629

30+
assemblies aka Common Intermediate Language bytecode
3731

38-
# Install the .NET assemblies
32+
In general, ThermoFisher.CommonCore dlls can be obtained through:
3933

40-
assemblies aka Common Intermediate Language bytecode
34+
https://github.com/thermofisherlsms/RawFileReader
4135

42-
the following files are required in
43-
`r tools::R_user_dir("rawrr", which='cache')`
44-
or in the `MONO_PATH`
36+
or
4537

46-
```
47-
ThermoFisher.CommonCore.Data.dll
48-
ThermoFisher.CommonCore.MassPrecisionEstimator.dll
49-
ThermoFisher.CommonCore.RawFileReader.dll
50-
```
38+
by contacting Jim Shofstahl using
5139

52-
The download and install can be done on all platforms using the command:
53-
`r rawrr::installRawFileReaderDLLs()`
40+
5441

55-
The in the package included C# source code that can compile into a rawrr.exe
56-
file by calling `r rawrr:::buildRawrrExe()`. (is executed when the package
57-
is loaded)
5842

59-
if no C# compile and build tool is available, run
43+
## build
6044

61-
`r rawrr::installRawrrExe()` to download the rawrr.exe assembly.
45+
* source nuget pkgs
6246

63-
On Windows, the decimal symbol has to be configured as a '.'!
47+
* add libraries
6448

65-
In general, ThermoFisher.CommonCore dlls can be obtained through:
49+
* (cross)-dcompile and link
6650

67-
https://github.com/thermofisherlsms/RawFileReader
51+
```
52+
dotnet publish rawrr-dotnet.csproj --os osx -a x64 --output /Users/cp/Library/Caches/org.R-project.R/R/rawrr/rawrrassembly/osx-x64
53+
dotnet publish rawrr-dotnet.csproj --os win -a x64 --output /Users/cp/Library/Caches/org.R-project.R/R/rawrr/rawrrassembly/win-x64
54+
dotnet publish rawrr-dotnet.csproj --os linux -a x64 --output /Users/cp/Library/Caches/org.R-project.R/R/rawrr/rawrrassembly/linux-x64
6855

69-
or
7056

71-
by contacting Jim Shofstahl using
57+
## generates a ~110MB BLOB
58+
dotnet publish -c Release -r linux-x64 -p PublishReadyToRun=true
59+
dotnet publish -c Release -r win-x64 -p PublishReadyToRun=true
60+
```
7261

73-
7462

63+
## Docker
7564

7665
The `Dockerfile` performing `R CMD build` and `R CMD check` requires
7766

7867
```
7968
from bioconductor/bioconductor_docker:devel
8069
run apt-get update && apt-get install mono-mcs mono-xbuild -y
81-
run apt-get install texlive-base texlive-latex-extra texinfo texlive-fonts-extra -y
70+
run apt-get install dotnet-sdk-8.0
8271
run R -q -e "BiocManager::install(c('BiocStyle', 'ExperimentHub', 'knitr', 'protViz', 'rmarkdown', 'tartare', 'testthat'))"
8372
```
73+

NAMESPACE

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,10 @@ S3method(plot,rawrrSpectrum)
66
S3method(print,rawrrSpectrum)
77
S3method(summary,rawrrChromatogram)
88
S3method(summary,rawrrSpectrum)
9-
export(.checkDllInMonoPath)
10-
export(.thermofisherlsmsUrl)
119
export(basePeak)
1210
export(buildRawrrExe)
1311
export(dependentScan)
1412
export(faimsVoltageOn)
15-
export(installRawFileReaderDLLs)
1613
export(installRawrrExe)
1714
export(is.rawrrChromatogram)
1815
export(is.rawrrSpectrum)
@@ -39,8 +36,10 @@ importFrom(graphics,text)
3936
importFrom(stats,lm)
4037
importFrom(stats,na.omit)
4138
importFrom(stats,predict)
39+
importFrom(tools,R_user_dir)
4240
importFrom(utils,download.file)
4341
importFrom(utils,head)
42+
importFrom(utils,object.size)
4443
importFrom(utils,packageVersion)
4544
importFrom(utils,read.csv2)
4645
importFrom(utils,read.table)

R/benchmark.R

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#R
2+
3+
#' @importFrom utils object.size
4+
# f <- "/Users/cp/Library/Caches/org.R-project.R/R/ExperimentHub/46314c3933e2_4590.raw"
5+
.benchmark <- function(f){
6+
stopifnot(file.exists(f))
7+
8+
rawrr::readFileHeader(f)$`Number of scans` -> n
9+
10+
2**(seq(0, floor(log(n, 2)))) |>
11+
lapply(FUN = function(i){
12+
sample(n, size = i) |> sort() -> idx
13+
message("Reading ", i, "random scans from ", f)
14+
start.time <- Sys.time()
15+
rawrr::readSpectrum(f, scan = idx) -> S
16+
end.time <- Sys.time()
17+
message("in ", end.time - start.time)
18+
data.frame(count = i,
19+
size = object.size(S) |> as.integer(),
20+
runTimeInSec = as.double(difftime(end.time, start.time, units='secs')))
21+
}) |> Reduce(f = rbind)
22+
}

0 commit comments

Comments
 (0)