Skip to content

Commit

Permalink
all examples now use the BdistachyonTechnical data set from metaboData
Browse files Browse the repository at this point in the history
  • Loading branch information
jasenfinch committed Sep 27, 2021
1 parent 56422f9 commit 1551a16
Show file tree
Hide file tree
Showing 21 changed files with 35 additions and 40 deletions.
1 change: 0 additions & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ jobs:
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran(c("rcmdcheck","goodpractice"))
metaboData::downloadDataSet('FIE-HRMS','BdistachyonEcotypes',ask = FALSE)
shell: Rscript {0}

- name: Check
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Imports:
furrr
License: GPL-3
Encoding: UTF-8
RoxygenNote: 7.1.1
RoxygenNote: 7.1.2
Collate:
allGenerics.R
allClasses.R
Expand Down
6 changes: 2 additions & 4 deletions R/binneRlyse.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
#' @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 @@ -32,7 +31,6 @@
#' analysis <- binneRlyse(files,
#' info,
#' parameters = parameters)
#' }
#' @importFrom dplyr ungroup n
#' @importFrom magrittr %>%
#' @importFrom crayon blue red green
Expand Down
4 changes: 2 additions & 2 deletions R/detect.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' if (requireNamespace("metaboData", quietly = TRUE)) {
#' detectInfusionScans(
#' metaboData::filePaths('FIE-HRMS',
#' 'BdistachyonEcotypes',
#' 'BdistachyonTechnical',
#' ask = FALSE)[1])
#' }
#' @importFrom mzR openMSfile header
Expand Down Expand Up @@ -71,7 +71,7 @@ detectInfusionScans <- function(files,
#' @param files character vector of file paths
#' @return S4 object of class BinParameters
#' @examples
#' files <- metaboData::filePaths('FIE-HRMS','BdistachyonEcotypes')
#' files <- metaboData::filePaths('FIE-HRMS','BdistachyonTechnical')
#' parameters <- detectParameters(files[1])
#' @seealso \code{\link{BinParameters-class}}, \code{\link{binParameters}}
#' @export
Expand Down
2 changes: 1 addition & 1 deletion R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ setMethod('plotChromatogram',signature = 'Binalysis',
#' @param files character vector of file paths to use
#' @param scans specify scans to highlight within the plot
#' @examples
#' plotChromFromFile(metaboData::filePaths('FIE-HRMS','BdistachyonEcotypes')[1],
#' plotChromFromFile(metaboData::filePaths('FIE-HRMS','BdistachyonTechnical')[1],
#' scans = c(6,18))
#' @export

Expand Down
2 changes: 1 addition & 1 deletion R/readFiles.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#' @examples
#' ## Example file path
#' file_paths <- metaboData::filePaths('FIE-HRMS',
#' 'BdistachyonEcotypes')[1]
#' 'BdistachyonTechnical')[1]
#'
#' ## Optionally declare parallel processing backend
#' # plan(future::multisession,workers = 2)
Expand Down
2 changes: 1 addition & 1 deletion R/singleSample.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#' \code{binner_dp} or the environment variable \code{BINNER_DP}.
#'
#' @examples
#' file_path <- metaboData::filePaths('FIE-HRMS','BdistachyonEcotypes')[1]
#' file_path <- metaboData::filePaths('FIE-HRMS','BdistachyonTechnical')[1]
#'
#' ## Optionally declare parallel processing backend
#' # plan(future::multisession,workers = 2)
Expand Down
6 changes: 2 additions & 4 deletions man/binneRlyse.Rd

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

2 changes: 1 addition & 1 deletion man/detectInfusionScans.Rd

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

2 changes: 1 addition & 1 deletion man/detectParameters.Rd

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

2 changes: 1 addition & 1 deletion man/plotChromFromFile.Rd

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

2 changes: 1 addition & 1 deletion man/readFiles.Rd

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

2 changes: 1 addition & 1 deletion man/singleSample.Rd

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

2 changes: 1 addition & 1 deletion tests/testthat/test-binneRlyse.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
context('binneRlyse')

file <- metaboData::filePaths('FIE-HRMS',
'BdistachyonEcotypes',
'BdistachyonTechnical',
ask = FALSE)[1]

info <- tibble::tibble(fileOrder = 1,
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-detectInfusionScans.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ context('detectInfusionScans')

test_that('detectInfusionScans works',{
file <- metaboData::filePaths('FIE-HRMS',
'BdistachyonEcotypes',
'BdistachyonTechnical',
ask = FALSE)[1]

scans <- detectInfusionScans(file)
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-detectParameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ context('detectParameters')

test_that('detectParameters works',{
files <- metaboData::filePaths('FIE-HRMS',
'BdistachyonEcotypes',
'BdistachyonTechnical',
ask = FALSE)

parameters <- detectParameters(files[1])
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-getPeaks.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
context('getPeaks')

file <- metaboData::filePaths('FIE-HRMS',
'BdistachyonEcotypes',
'BdistachyonTechnical',
ask = FALSE)[1]

test_that('sampProcess works',{
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-plotting.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

context('measures plots')

file <- metaboData::filePaths('FIE-HRMS','BdistachyonEcotypes')[1]
file <- metaboData::filePaths('FIE-HRMS','BdistachyonTechnical')[1]

info <- tibble::tibble(fileOrder = 1,
injOrder = 1,
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-readFiles.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ context('readFiles')

test_that('readFiles works',{
file <- metaboData::filePaths('FIE-HRMS',
'BdistachyonEcotypes',
'BdistachyonTechnical',
ask = FALSE)[1]

res <- readFiles(file,dp = 2,scans = 5:13)
Expand Down
10 changes: 5 additions & 5 deletions tests/testthat/test-singleSample.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ context('singleSample')

test_that('single sample works',{
file <- metaboData::filePaths('FIE-HRMS',
'BdistachyonEcotypes',
'BdistachyonTechnical',
ask = FALSE)[1]
bd <- singleSample(file,class = 'test',verbose = TRUE)

Expand All @@ -12,7 +12,7 @@ test_that('single sample works',{

test_that('single sample works with no class specified',{
file <- metaboData::filePaths('FIE-HRMS',
'BdistachyonEcotypes',
'BdistachyonTechnical',
ask = FALSE)[1]
bd <- singleSample(file,verbose = TRUE)

Expand All @@ -21,23 +21,23 @@ test_that('single sample works with no class specified',{

test_that('single samples errors with > 1 file',{
file <- metaboData::filePaths('FIE-HRMS',
'BdistachyonEcotypes',
'BdistachyonTechnical',
ask = FALSE)[1:2]

expect_error(singleSample(file,verbose = FALSE))
})

test_that('single samples errors with > 1 file',{
file <- metaboData::filePaths('FIE-HRMS',
'BdistachyonEcotypes',
'BdistachyonTechnical',
ask = FALSE)[1:2]

expect_error(singleSample(file,verbose = FALSE))
})

test_that('single samples errors with > 1 class',{
file <- metaboData::filePaths('FIE-HRMS',
'BdistachyonEcotypes',
'BdistachyonTechnical',
ask = FALSE)[1]

expect_error(singleSample(file,class = c('wrong','incorrect'),verbose = FALSE))
Expand Down
18 changes: 9 additions & 9 deletions vignettes/binneR.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ library(magrittr)
```{r check_example_data,include=FALSE}
example_data_status <- metaboData::availableDataSets() %>%
filter(technique == 'FIE-HRMS',
`data set` == 'BdistachyonEcotypes') %>%
`data set` == 'BdistachyonTechnical') %>%
.$status
if (example_data_status != 'available'){
metaboData::downloadDataSet('FIE-HRMS','BdistachyonEcotypes',ask = FALSE)
metaboData::downloadDataSet('FIE-HRMS','BdistachyonTechnical',ask = FALSE)
}
```

Expand All @@ -58,7 +58,7 @@ FIE-HRMS data consists of a 'plug flow', across which MS signal intensities can

```{r FIEfingerprint, echo=FALSE, fig.width=7,fig.height=5,fig.align='center',fig.show='animate',animation.hook = 'gifski',interval=0.1,dev='png',aniopts=('controls,loop'),message=FALSE}
file <- filePaths('FIE-HRMS','BdistachyonEcotypes')[1]
file <- filePaths('FIE-HRMS','BdistachyonTechnical')[1]
ms <- openMSfile(file)
chrom <- mzR::header(ms)
Expand Down Expand Up @@ -156,7 +156,7 @@ For a set of specified file paths, the range of infusion scans can be detected u

```{r infusionScanDetection}
infusionScans <- detectInfusionScans(
metaboData::filePaths('FIE-HRMS','BdistachyonEcotypes')[1],
metaboData::filePaths('FIE-HRMS','BdistachyonTechnical')[1],
thresh = 0.5
)
infusionScans
Expand All @@ -167,7 +167,7 @@ The infusion scans can also be plotted by supplying the range to the scans argum

```{r exampleChromatograms, fig.width=7,fig.height=5,fig.align='center'}
plotChromFromFile(
metaboData::filePaths('FIE-HRMS','BdistachyonEcotypes')[1],
metaboData::filePaths('FIE-HRMS','BdistachyonTechnical')[1],
scans = infusionScans
)
```
Expand All @@ -180,7 +180,7 @@ Spectral binning can be performed using the `readFiles()` function as shown belo
The example file within the package can be specified using the following.

```{r fileList}
file <- metaboData::filePaths('FIE-HRMS','BdistachyonEcotypes')[1]
file <- metaboData::filePaths('FIE-HRMS','BdistachyonTechnical')[1]
```

Then the data can be spectrally binned using:
Expand All @@ -203,16 +203,16 @@ Some bin measures are also computed that allow the assessment of the quality of
Subsequent analyses of these data can easily be applied using the [*metabolyseR*](https://github.com/jasenfinch/metabolyseR) package.
The [*metaboWorkflows*](https://github.com/jasenfinch/metaboWorkflows) package also provides customisable wrapper workflows for high resolution FIE-MS analyses.

The example data used here is from the [*metaboData*](https://github.com/aberHRML/metaboData) package and consists of a comparison of leaf tissue from four *B. distachyon* ecotypes.
The example data used here is from the [*metaboData*](https://github.com/aberHRML/metaboData) package and consists 10 replicate injections of a leaf tissue extract from the model grass species *Brachypodium distachyon*.

### Basic Usage

Firstly the file paths and sample information can be loaded for the example data set using the following:

```{r exampleFiles}
info <- metaboData::runinfo('FIE-HRMS','BdistachyonEcotypes')
info <- metaboData::runinfo('FIE-HRMS','BdistachyonTechnical')
files <- metaboData::filePaths('FIE-HRMS','BdistachyonEcotypes')
files <- metaboData::filePaths('FIE-HRMS','BdistachyonTechnical')
```

There are two main functions for processing experimental data:
Expand Down

0 comments on commit 1551a16

Please sign in to comment.