Skip to content

Commit

Permalink
Merge pull request #53 from aberHRML/devel
Browse files Browse the repository at this point in the history
v2.6.0
  • Loading branch information
jasenfinch committed Sep 29, 2021
2 parents 2181bda + 94ea8bf commit 4238c1b
Show file tree
Hide file tree
Showing 65 changed files with 589 additions and 484 deletions.
75 changes: 25 additions & 50 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches:
- master
- devel
branches: [main, master, devel]
pull_request:
branches:
- master
branches: [main, master]
schedule:
- cron: '0 0 * * *'

Expand All @@ -23,69 +20,47 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1
with:
r-version: ${{ matrix.config.r }}

- uses: r-lib/actions/setup-pandoc@v1

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v2
- uses: r-lib/actions/setup-r@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true
- name: Install system dependencies
if: runner.os == 'Linux'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
sudo apt install libnetcdf-dev libgit2-dev
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran(c("rcmdcheck","goodpractice"))
metaboData::downloadDataSet('FIE-HRMS','BdistachyonEcotypes',ask = FALSE)
shell: Rscript {0}
- uses: r-lib/actions/setup-r-dependencies@v1
with:
extra-packages: rcmdcheck

- name: Check
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}

- name: Good practice
run: goodpractice::goodpractice()
shell: Rscript {0}

- uses: r-lib/actions/check-r-package@v1

- name: Test coverage
run: covr::codecov()
shell: Rscript {0}

- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ binneR.Rcheck
inst/doc
doc
Meta
/doc/
/Meta/
30 changes: 8 additions & 22 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: binneR
Title: Spectral Processing for High Resolution Flow Infusion Mass Spectrometry
Version: 2.5.3
Version: 2.6.0
Authors@R: person("Jasen", "Finch", email = "[email protected]", role = c("aut", "cre"))
Description: A spectral binning approach for high resolution flow infusion mass spectrometry data.
biocViews: MassSpectrometry, Metabolomics
Expand All @@ -26,25 +26,13 @@ Imports:
furrr
License: GPL-3
Encoding: UTF-8
RoxygenNote: 7.1.1
Collate:
allGenerics.R
allClasses.R
binneRlyse.R
binParameters.R
spectralBinning-method.R
show-method.R
get.R
calc.R
readFiles.R
binneR.R
plot.R
detect.R
binMeasures.R
singleSample.R
readBinningParameters.R
reexports.R
access.R
RoxygenNote: 7.1.2
Collate: allGenerics.R allClasses.R binneRlyse.R
binParameters.R spectralBinning-method.R
show-method.R get.R calc.R readFiles.R
binneR.R plot.R detect.R binMetrics.R
singleSample.R readBinningParameters.R
reexports.R access.R internals.R
Suggests:
knitr,
rmarkdown,
Expand All @@ -55,6 +43,4 @@ Suggests:
covr,
testthat,
gifski
LazyData: true
VignetteBuilder: knitr
Remotes: aberHRML/metaboData
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ importFrom(stats,median)
importFrom(stringr,regex)
importFrom(stringr,str_c)
importFrom(stringr,str_detect)
importFrom(stringr,str_extract)
importFrom(stringr,str_remove_all)
importFrom(stringr,str_replace_all)
importFrom(stringr,str_sub)
Expand All @@ -107,6 +108,7 @@ importFrom(tibble,rowid_to_column)
importFrom(tibble,tibble)
importFrom(tidyr,gather)
importFrom(tidyr,spread)
importFrom(tools,file_path_sans_ext)
importFrom(utils,capture.output)
importFrom(utils,packageVersion)
importFrom(yaml,read_yaml)
20 changes: 18 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# binneR 2.6.0

* Removed the `LazyData` field from the DESCRIPTION file.

* Replaced the `Remotes` field in the DESCRIPTION file with `Additional_repositories` for the installation of the [`metaboData`](https://aberhrml.github.io/metaboData/) dependency.

* The number of decimal places used for spectral binning can now be specified using the `binner_dp` global option or the `BINNER_DP` environment variable.

* The vignette example now uses the `BdistachyonTechnical` data set from [`metaboData`](https://aberhrml.github.io/metaboData/).

* An in-package example data file is now used for documentation examples.

* The vignette chunks that require the [`metaboData`](https://aberhrml.github.io/metaboData/) package are no longer executed to avoid GitHub API rate limit issues.

* The file header gathering iostream error is now fixed for large data sets (> 1000 samples).

# binneR 2.5.3

* Removed the potential for errors during build of the intensity matrices if identical accurate m/z are retrieved for a bin from multiple samples.
Expand All @@ -22,7 +38,7 @@

* `version` and `creation_date` slots added to [`Binalysis`](https://aberhrml.github.io/binneR/reference/Binalysis-class.html) S4 class.

* Added additional accessor [methods](file:///home/jasen/Documents/tools/R-package-dev/binneR/docs/reference/results.html) for the [`Binalysis`](https://aberhrml.github.io/binneR/reference/Binalysis-class.html) S4 class.
* Added additional accessor [methods](https://aberhrml.github.io/binneR/reference/results.html) for the [`Binalysis`](https://aberhrml.github.io/binneR/reference/Binalysis-class.html) S4 class.

* Fixed declaration of generics to ensure they are declared as standard generics.

Expand Down Expand Up @@ -57,4 +73,4 @@
* Parallel processing in `binneR` is now implemented using the [`future`](https://cran.r-project.org/package=future) package.
Information on how this can now be used is available in the usage vignette.

* `plan()` from the [`future`](https://cran.r-project.org/web/packages/future/index.html) package is now re-exported.
* `plan()` from the [`future`](https://cran.r-project.org/package=future) package is now re-exported.
File renamed without changes.
11 changes: 8 additions & 3 deletions R/binneRlyse.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@
#' Parallel processing is managed by the \code{future} package. This can
#' be specified using the \code{plan() function}. See the example below
#' and \code{?future::plan} for details on how this can be specified.
#'
#' By default, spectral binning is performed at the recommended 2 decimal
#' places. This can be altered by setting either the global option
#' \code{binner_dp} or the environment variable \code{BINNER_DP}.
#'
#' @seealso \code{\link{Binalysis-class}}, \code{\link{binParameters}},
#' \code{\link{sampleInfo}}, \code{\link{binnedData}}, \code{\link{accurateData}}
#' @examples
#' \dontrun{
#' files <- metaboData::filePaths('FIE-HRMS','BdistachyonEcotypes')
#' files <- metaboData::filePaths('FIE-HRMS','BdistachyonTechnical')
#'
#' info <- metaboData::runinfo('FIE-HRMS','BdistachyonEcotypes')
#' info <- metaboData::runinfo('FIE-HRMS','BdistachyonTechnical')
#'
#' parameters <- detectParameters(files)
#' cls(parameters) <- 'class'
Expand All @@ -27,7 +32,7 @@
#' analysis <- binneRlyse(files,
#' info,
#' parameters = parameters)
#' }
#' }
#' @importFrom dplyr ungroup n
#' @importFrom magrittr %>%
#' @importFrom crayon blue red green
Expand Down
8 changes: 6 additions & 2 deletions R/calc.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ calcBinMeasures <- function(pks,cls){
cls,
'polarity',
'bin')))) %>%
summarise(purity = binPurity(mz,intensity),
centrality = binCentrality(mz,intensity),
summarise(purity = binPurity(mz,
intensity,
dp = binnerDP()),
centrality = binCentrality(mz,
intensity,
dp = binnerDP()),
.groups = 'drop')

return(binMeasures)
Expand Down
12 changes: 5 additions & 7 deletions R/detect.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
#' @return Numeric vector of detected infusion scans.
#' @seealso \code{\link{detectParameters}}
#' @examples
#' if (requireNamespace("metaboData", quietly = TRUE)) {
#' detectInfusionScans(
#' metaboData::filePaths('FIE-HRMS',
#' 'BdistachyonEcotypes')[1])
#' }
#' file_paths <- system.file('example-data/1.mzML.gz',package = 'binneR')
#'
#' detectInfusionScans(file_paths)
#' @importFrom mzR openMSfile header
#' @importFrom dplyr group_by summarise
#' @export
Expand Down Expand Up @@ -70,8 +68,8 @@ detectInfusionScans <- function(files,
#' @param files character vector of file paths
#' @return S4 object of class BinParameters
#' @examples
#' files <- metaboData::filePaths('FIE-HRMS','BdistachyonEcotypes')
#' parameters <- detectParameters(files[1])
#' file_paths <-system.file('example-data/1.mzML.gz',package = 'binneR')
#' parameters <- detectParameters(file_paths)
#' @seealso \code{\link{BinParameters-class}}, \code{\link{binParameters}}
#' @export

Expand Down
Loading

0 comments on commit 4238c1b

Please sign in to comment.