Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean and finalize removal of the basilisk dependencies #50

Merged
merged 39 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
df87dc0
Minor typos and comment formatting
bittremieux Feb 5, 2025
8a411e5
Don't use basilisk context
bittremieux Feb 5, 2025
9a1ccdc
Reticulate is used to manage Python dependencies directly
bittremieux Feb 5, 2025
0a0fdee
Remove basilisk
bittremieux Feb 5, 2025
ecebf9b
Format with styler
bittremieux Feb 5, 2025
138e226
Some formatting
bittremieux Feb 5, 2025
7fd51ac
Minor simplification
bittremieux Feb 5, 2025
4e94c99
4 spaces indentation
bittremieux Feb 5, 2025
b944539
Move onLoad to separate file
bittremieux Feb 6, 2025
7e3c7c0
Move spectrum conversion code
bittremieux Feb 6, 2025
c41faa6
Update namespace
bittremieux Feb 6, 2025
f9ebf38
Fix import name
bittremieux Feb 6, 2025
e9222ec
Update documentation to reflect removed `spectraVariableMapping`
bittremieux Feb 6, 2025
80ba9b8
Move Python environment code
bittremieux Feb 6, 2025
b76ee08
Reformat
bittremieux Feb 6, 2025
6de2ec1
Support virtualenv, conda, and system Python
bittremieux Feb 6, 2025
90324ee
Remove basilisk configuration
bittremieux Feb 6, 2025
413dddc
Update dependency installation
bittremieux Feb 6, 2025
d546d15
Add as contributor
bittremieux Feb 6, 2025
11225e4
Merge pull request #38 from bittremieux/without_basilisk
jorainer Feb 6, 2025
0ac5e6d
Merge branch 'main' into without_basilisk
jorainer Feb 11, 2025
7ff7b72
refactor: improve the r-to-Python translation of MS data
jorainer Feb 13, 2025
07dd046
refactor: finalize conversion unit tests and documentation
jorainer Feb 14, 2025
fb90f85
refactor: complete removal of basilisk dependencies
jorainer Feb 18, 2025
5f497ba
docs: add vignettes and move previous documentation
jorainer Feb 19, 2025
d23235c
ci: install python through reticulate
jorainer Feb 19, 2025
6c65ee4
ci: install reticulate in first step
jorainer Feb 19, 2025
f3cc654
ci: macOS install python 3.12 and install also miniconda
jorainer Feb 19, 2025
01f245f
ci: reconfigure miniconda installation
jorainer Feb 19, 2025
3ff238b
ci: install mzR
jorainer Feb 19, 2025
7a55d13
immediately import Python libraries
jorainer Feb 19, 2025
6d0a794
refactor: add msdata to Suggests
jorainer Feb 19, 2025
521b6e2
docs: cleanup vignette
jorainer Feb 19, 2025
6b2ab14
docs: expand installation vignette
jorainer Feb 20, 2025
501f028
ci: update GHA
jorainer Feb 21, 2025
aabf33b
docs: add missing reference
jorainer Feb 21, 2025
eaa2c8c
refactor: change the onLoad method
jorainer Feb 21, 2025
9c79db9
ci: fix rcmdcheck::rcmdcheck() call
jorainer Feb 21, 2025
468819d
refactor: address Phili's comments
jorainer Feb 25, 2025
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
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ _pkgdown.yml
.BBSoptions
^\.vscode
devnotes.md
temp_doc/*
36 changes: 26 additions & 10 deletions .github/workflows/check-bioc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ jobs:
fail-fast: false
matrix:
config:
- { os: ubuntu-latest, r: '4.4', bioc: '3.20', cont: "bioconductor/bioconductor_docker:RELEASE_3_20", rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest" }
- { os: macOS-latest, r: '4.4', bioc: '3.20'}
- { os: windows-latest, r: '4.4', bioc: '3.20'}
- { os: ubuntu-latest, r: 'devel', bioc: '3.21', cont: "bioconductor/bioconductor_docker:devel", rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest" }
- { os: macOS-latest, r: 'devel', bioc: '3.21'}
- { os: windows-latest, r: 'devel', bioc: '3.21'}
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
Expand All @@ -77,7 +77,7 @@ jobs:
## https://github.com/r-lib/actions/blob/master/examples/check-standard.yaml
## If they update their steps, we will also need to update ours.
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v4

## R is already included in the Bioconductor docker images
- name: Setup R from r-lib
Expand All @@ -86,17 +86,35 @@ jobs:
with:
r-version: ${{ matrix.config.r }}

## Install R dependencies using R-lib
- name: Setup R dependencies from r-lib
if: runner.os != 'Linux'
uses: r-lib/actions/setup-r-dependencies@v2

## pandoc is already included in the Bioconductor docker images
- name: Setup pandoc from r-lib
if: runner.os != 'Linux'
uses: r-lib/actions/setup-pandoc@v2

- name: Install quarto
if: runner.os != 'Linux'
uses: quarto-dev/quarto-actions/setup@v2

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
shell: Rscript {0}

- name: Install Miniconda
run: |
Rscript -e "install.packages('reticulate')"
Rscript -e "reticulate::install_miniconda()"

- name: Fix conda for macOS
if: runner.os == 'macOS'
run: echo "options(reticulate.conda_binary = reticulate:::miniconda_conda())" >> .Rprofile

- name: Cache R packages
if: "!contains(github.event.head_commit.message, '/nocache') && runner.os != 'Linux'"
uses: actions/cache@v2
Expand Down Expand Up @@ -137,9 +155,6 @@ jobs:
## For installing usethis's dependency gert
brew install libgit2

## Python
brew install [email protected]

- name: Install Windows system dependencies
if: runner.os == 'Windows'
run: |
Expand Down Expand Up @@ -179,8 +194,9 @@ jobs:
remotes::install_local(dependencies = TRUE, repos = BiocManager::repositories(), build_vignettes = FALSE, upgrade = TRUE)

message(paste('****', Sys.time(), 'force installation of selected packages ****'))
BiocManager::install(c("BiocStyle", "rmarkdown", "magick"))
BiocManager::install(c("BiocStyle"))

BiocManager::install("mzR")
BiocManager::install("Spectra")
## For running the checks
message(paste('****', Sys.time(), 'installing rcmdcheck and BiocCheck ****'))
Expand Down Expand Up @@ -219,7 +235,7 @@ jobs:
_R_CHECK_CRAN_INCOMING_: false
run: |
rcmdcheck::rcmdcheck(
args = c("--no-build-vignettes", "--no-manual", "--timings"),
args = c("--no-manual", "--timings"),
build_args = c("--no-manual", "--no-resave-data"),
error_on = "warning",
check_dir = "check"
Expand Down Expand Up @@ -276,4 +292,4 @@ jobs:
uses: actions/upload-artifact@master
with:
name: ${{ runner.os }}-biocversion-devel-r-devel-results
path: check
path: check
43 changes: 25 additions & 18 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Package: SpectriPy
Title: Integrating Spectra with Python's matchms
Version: 0.2.1
Version: 0.3.1
Description: The SpectriPy package allows integration of Python-based MS
analysis code with the Spectra package. Spectra objects can be converted
into Python's matchms Spectrum objects. In addition, SpectriPy integrates
and wraps the similarity scoring and processing/filtering functions
and wraps the similarity scoring and processing/filtering functions
from the matchms package into R.
Authors@R: c(person(given = "Michael", family = "Witting",
role = c("aut"),
Expand All @@ -20,47 +20,54 @@ Authors@R: c(person(given = "Michael", family = "Witting",
comment = c(ORCID = "0000-0002-9355-8948")),
person(given = "Helge", family = "Hecht",
email = "[email protected]",
role = c("aut"),
role = c("ctb"),
comment = c(ORCID = "0000-0001-6744-996X")),
person(given = "Marilyn", family = "De Graeve",
email = "[email protected]",
role = c("ctb"),
role = c("aut"),
comment = c(ORCID = "0000-0001-6916-401X")),
person(given = "Thomas", family = "Naake",
person(given = "Wout", family = "Bittremieux",
email = "[email protected]",
role = c("aut"),
comment = c(ORCID = "0000-0002-3105-1359")),
person(given = "Thomas", family = "Naake",
email = "[email protected]",
role = c("ctb"),
role = c("aut"),
comment = c(ORCID = "0000-0001-7917-5580")),
person(given = "Victor", family = "Chrone",
email = "[email protected]",
role = c("ctb"),
comment = c(ORCID = "0009-0007-2121-4066")),
person(given = "Matthias", family = "Anagho-Mattanovich",
person(given = "Matthias", family = "Anagho-Mattanovich",
email = "[email protected]",
role = c("ctb"),
comment = c(ORCID = "0000-0001-7561-7898")))
comment = c(ORCID = "0000-0001-7561-7898"))
)
Depends:
R (>= 4.1.0)
R (>= 4.1.0),
reticulate
Imports:
Spectra (>= 1.5.8),
basilisk,
reticulate,
IRanges,
S4Vectors,
BiocParallel,
ProtGenerics,
MsCoreUtils,
methods
Suggests:
testthat,
quarto,
MsBackendMgf,
msdata,
mzR,
knitr,
BiocStyle,
rmarkdown
BiocStyle
License: Artistic-2.0
VignetteBuilder: knitr
BugReports: https://github.com/RforMassSpectrometry/SpectriPy/issues
URL: https://github.com/RforMassSpectrometry/SpectriPy
biocViews: Infrastructure, Metabolomics, MassSpectrometry
Encoding: UTF-8
StagedInstall: no
SystemRequirements: python (>= 3.9)
SystemRequirements:
python (>= 3.10),
pandoc
VignetteBuilder: quarto
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
34 changes: 22 additions & 12 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,38 +1,48 @@
# Generated by roxygen2: do not edit by hand

export(CosineGreedyParam)
export(CosineHungarianParam)
export(ModifiedCosineParam)
export(NeutralLossesCosineParam)
S3method(r_to_py,Spectra)
export(CosineGreedy)
export(CosineHungarian)
export(ModifiedCosine)
export(NeutralLossesCosine)
export(compareSpectriPy)
export(defaultSpectraVariableMapping)
export(filterSpectriPy)
export(normalize_intensities)
export(pyspec_to_rspec)
export(remove_peaks_around_precursor_mz)
export(rspec_to_pyspec)
export(select_by_intensity)
export(select_by_mz)
export(setSpectraVariableMapping)
exportMethods(compareSpectriPy)
exportMethods(filterSpectriPy)
exportMethods(spectraVariableMapping)
importClassesFrom(ProtGenerics,Param)
importFrom(BiocParallel,SerialParam)
importFrom(BiocParallel,bplapply)
importFrom(IRanges,NumericList)
importFrom(MsCoreUtils,rbindFill)
importFrom(S4Vectors,DataFrame)
importFrom(Spectra,concatenateSpectra)
importFrom(basilisk,BasiliskEnvironment)
importFrom(basilisk,basiliskRun)
importFrom(basilisk,basiliskStart)
importFrom(basilisk,basiliskStop)
importFrom(Spectra,MsBackendMemory)
importFrom(Spectra,spectrapply)
importFrom(methods,is)
importFrom(methods,new)
importFrom(reticulate,conda_create)
importFrom(reticulate,conda_list)
importFrom(reticulate,import)
importFrom(reticulate,iterate)
importFrom(reticulate,np_array)
importFrom(reticulate,py)
importFrom(reticulate,py_available)
importFrom(reticulate,py_dict)
importFrom(reticulate,py_install)
importFrom(reticulate,py_module_available)
importFrom(reticulate,py_run_string)
importFrom(reticulate,py_to_r)
importFrom(reticulate,r_to_py)
importFrom(reticulate,use_condaenv)
importFrom(reticulate,use_virtualenv)
importFrom(reticulate,virtualenv_create)
importFrom(reticulate,virtualenv_exists)
importFrom(reticulate,virtualenv_remove)
importMethodsFrom(Spectra,Spectra)
importMethodsFrom(Spectra,intensity)
importMethodsFrom(Spectra,mz)
Expand Down
17 changes: 16 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# SpectriPy 0.3

## Changes in 0.3.1

- Add `filterSpectriPy()` function for spectra filtering using *matchms*.
- Add a new example MGF file to the package.
- Add a new quarto vignette.

## Changes in 0.3.0

- Add changes and results introduced a the EuBIC 2024 r-python hackathon in
Neustift, Italy.
- Remove dependency from *basilisk* and base the package entirely on
*reticulate*.

# SpectriPy 0.2

## Changes in 0.2.1
Expand Down Expand Up @@ -29,4 +44,4 @@
- Add `basilisk` environment.
- Add `spectraVariableMapping`.
- Refactor functions to convert between R and python spectrum objects and add
unit tests.
unit tests.
6 changes: 0 additions & 6 deletions R/basilisk.R

This file was deleted.

Loading
Loading