Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
cpanse committed Mar 15, 2024
2 parents d51b74f + d47ccb6 commit 1b97b4a
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 7 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Authors@R: c(person(given = "Christian",
comment = c(ORCID = "0000-0003-0288-9619")))
Depends: R (>= 4.1), methods, Spectra (>= 1.5.8)
Imports:
ProtGenerics (>= 1.35.3),
MsCoreUtils,
S4Vectors,
IRanges,
Expand Down Expand Up @@ -40,7 +41,7 @@ BugReports: https://github.com/fgcz/MsBackendRawFileReader/issues
Encoding: UTF-8
NeedsCompilation: yes
biocViews: MassSpectrometry, Proteomics, Metabolomics
RoxygenNote: 7.1.2
RoxygenNote: 7.3.1
License: GPL-3
SystemRequirements: mono-runtime 4.x or higher (including System.Data library)
on Linux/macOS, .Net Framework (>= 4.5.1) on Microsoft Windows.
Expand Down
15 changes: 15 additions & 0 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,18 @@
Please follow the install notes of the rawrr package.

https://bioconductor.org/packages/rawrr/

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

```
from bioconductor/bioconductor_docker:devel
run apt-get update && apt-get install mono-mcs mono-xbuild -y
run apt-get install texlive-base texlive-latex-extra texinfo texlive-fonts-extra -y
run R -q -e "BiocManager::install(c('BiocStyle', 'ExperimentHub', 'knitr', 'protViz', 'rmarkdown', 'tartare', 'testthat'))"
run R -q -e "BiocManager::install(c('rawrr', 'ggplot2', 'hexbin', 'BiocParallel', 'reshape2', 'scales'))"
run R -q -e "BiocManager::install(c('MsCoreUtils', 'S4Vectors', 'IRanges', 'utils', 'Spectra'))"
run R -q -e "BiocManager::install(c('mzR', 'MsBackendMgf'))"
```



7 changes: 6 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ exportMethods("[")
exportMethods(filterScan)
exportMethods(intensity)
exportMethods(scanType)
import(Spectra)
importClassesFrom(IRanges,NumericList)
importClassesFrom(Spectra,MsBackendDataFrame)
importFrom(BiocParallel,bpparam)
importFrom(IRanges,NumericList)
importFrom(MsCoreUtils,i2index)
importFrom(MsCoreUtils,rbindFill)
importFrom(S4Vectors,DataFrame)
importFrom(S4Vectors,extractROWS)
importFrom(methods,"slot<-")
importFrom(methods,callNextMethod)
Expand All @@ -21,3 +22,7 @@ importFrom(rawrr,readIndex)
importFrom(utils,packageVersion)
importMethodsFrom(BiocParallel,bplapply)
importMethodsFrom(BiocParallel,bpmapply)
importMethodsFrom(ProtGenerics,backendInitialize)
importMethodsFrom(ProtGenerics,dataStorage)
importMethodsFrom(ProtGenerics,intensity)
importMethodsFrom(ProtGenerics,peaksData)
6 changes: 4 additions & 2 deletions R/MsBackendRawFileReader-functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ NULL
)


#' @importFrom S4Vectors DataFrame
#'
.MsBackendRawFileReader_header <- function(x = character()) {
if (length(x) != 1)
stop("'x' should have length 1")
Expand Down Expand Up @@ -75,8 +77,8 @@ NULL

## Remove core spectra variables that contain only `NA`
hdr <- S4Vectors::DataFrame(hdr[, !(MsCoreUtils::vapply1l(hdr, function(z) all(is.na(z))) &
colnames(hdr) %in%
names(.SPECTRA_DATA_COLUMNS))
colnames(hdr) %in%
names(.SPECTRA_DATA_COLUMNS))
])
.post_process_header(hdr)
}
Expand Down
11 changes: 10 additions & 1 deletion R/MsBackendRawFileReader.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ NULL
#'
#'
#' @author Christian Panse (2019-2021)
#' @import Spectra
#'
#' @importClassesFrom Spectra MsBackendDataFrame
#'
#' @examples
#' beRaw <- Spectra::backendInitialize(MsBackendRawFileReader::MsBackendRawFileReader(),
#' files = rawrr::sampleFilePath())
Expand Down Expand Up @@ -44,6 +46,8 @@ setValidity("MsBackendRawFileReader", function(object) {
#'
#' @importMethodsFrom BiocParallel bpmapply bplapply
#'
#' @importMethodsFrom ProtGenerics backendInitialize
#'
#' @importFrom BiocParallel bpparam
#' @importFrom rawrr readIndex
setMethod("backendInitialize", "MsBackendRawFileReader",
Expand Down Expand Up @@ -85,6 +89,10 @@ setMethod("show", "MsBackendRawFileReader", function(object) {
})

#' @rdname hidden_aliases
#'
#' @importMethodsFrom ProtGenerics peaksData
#'
#' @importMethodsFrom ProtGenerics dataStorage
setMethod("peaksData", "MsBackendRawFileReader",
function(object, ..., BPPARAM = bpparam()) {
if (!length(object))
Expand Down Expand Up @@ -140,6 +148,7 @@ setMethod("[", "MsBackendRawFileReader", function(x, i, j, ..., drop = FALSE) {

#' @importClassesFrom IRanges NumericList
#' @rdname hidden_aliases
#' @importMethodsFrom ProtGenerics intensity
#' @exportMethod intensity
setMethod("intensity", "MsBackendRawFileReader", function(object, ..., BPPARAM = bpparam()) {
IRanges::NumericList(lapply(peaksData(object, BPPARAM = BPPARAM), "[", , 2), compress = FALSE)
Expand Down
4 changes: 2 additions & 2 deletions man/ioBenchmark.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1b97b4a

Please sign in to comment.