Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: SpectriPy
Title: Enhancing Cross-Language Mass Spectrometry Data Analysis with R and Python
Version: 1.1.5
Version: 1.1.7
Description: The SpectriPy package allows integration of Python-based MS
analysis code with the Spectra package. Spectra objects can be converted
into Python MS data structures. In addition, SpectriPy integrates
Expand Down Expand Up @@ -61,7 +61,8 @@ Imports:
MsCoreUtils,
ProtGenerics,
methods,
data.table
data.table,
snakecase
Suggests:
testthat,
quarto,
Expand Down
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export(select_by_intensity)
export(select_by_mz)
export(setSpectraVariableMapping)
exportMethods("spectraData<-")
exportMethods("spectraNames<-")
exportMethods("spectraVariableMapping<-")
exportMethods(compareSpectriPy)
exportMethods(filterSpectriPy)
Expand Down Expand Up @@ -53,10 +54,12 @@ importFrom(reticulate,py_run_string)
importFrom(reticulate,py_set_attr)
importFrom(reticulate,py_to_r)
importFrom(reticulate,r_to_py)
importFrom(snakecase,to_snake_case)
importMethodsFrom(ProtGenerics,"intensity<-")
importMethodsFrom(ProtGenerics,"mz<-")
importMethodsFrom(ProtGenerics,"peaksData<-")
importMethodsFrom(ProtGenerics,"spectraData<-")
importMethodsFrom(ProtGenerics,"spectraNames<-")
importMethodsFrom(ProtGenerics,acquisitionNum)
importMethodsFrom(ProtGenerics,backendInitialize)
importMethodsFrom(ProtGenerics,centroided)
Expand Down
21 changes: 21 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# SpectriPy 1.1

## Changes in 1.1.7

- Improved `$<-` operation: only replace the values for the selected spectra
variable.
- Improved `peaksData<-`, `mz<-` and `intensity<-` implementations: only
replace the respective data, but not the full spectra data (including
metadata).
- Improved `lengths()` implementation: retrieves the number of peaks directly in
Python.
- Documentation updates.

## Changes in 1.1.6

- Automatic renaming and remapping of upper case or *camelCase* spectra
variables to *snake_case* metadata fields in `backendInitialize()`,
`spectraData<-` and `$<-`.
- Full support of the *Spectra* test suite.
- Add `spectraNames<-` method for `MsBackendPy` and support getting/setting
spectrum names. They are stored in a metadata field (spectra variable)
*spectrum_name*.

## Changes in 1.1.5

- Fix `$<-`, `spectraData()<-` and related replacement methods for
Expand Down
405 changes: 326 additions & 79 deletions R/MsBackendPython.R

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions R/conversion.R
Original file line number Diff line number Diff line change
Expand Up @@ -696,3 +696,18 @@ pyspec_to_rspec <- function(x, mapping = spectraVariableMapping(),
"for i in _i_:\n",
" _res_.append(np.column_stack((",x,"[i].mz,",x,"[i].intensity)))")
}

## .var_name <- function(x) {
## i <- 0
## if (any(ls(envir = .GlobalEnv) == x)) {
## xs <- strsplit(x, "_", fixed = TRUE)[[1L]]
## if (!is.na(suppressWarnings(i2 <- as.integer(xs[length(xs)]))))
## i <- i2
## x <- .var_name(paste0(c(xs[1:(length(xs) - 1)], i + 1L),
## collapse = "_"))
## }
## x
## }

## .var_name("a")
## a_1 <- 2
59 changes: 28 additions & 31 deletions man/MsBackendPy.Rd

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

Loading
Loading