Skip to content

Commit

Permalink
Merge pull request #51 from aberHRML/devel
Browse files Browse the repository at this point in the history
v2.5.2
  • Loading branch information
Jasen Finch authored Mar 6, 2021
2 parents 0861c11 + e3c1199 commit 749922e
Show file tree
Hide file tree
Showing 45 changed files with 208 additions and 132 deletions.
2 changes: 1 addition & 1 deletion 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.1
Version: 2.5.2
Authors@R: person("Jasen", "Finch", email = "jsf9@aber.ac.uk", role = c("aut", "cre"))
Description: A spectral binning approach for high resolution flow infusion mass spectrometry data.
biocViews: MassSpectrometry, Metabolomics
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ importFrom(magrittr,"%>%")
importFrom(magrittr,set_colnames)
importFrom(magrittr,set_names)
importFrom(methods,show)
importFrom(mzR,close)
importFrom(mzR,header)
importFrom(mzR,openMSfile)
importFrom(mzR,peaks)
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# binneR v2.5.2

* Fixed I/O issues for sample sets over ~1200.

* Minor alteration to console output

# binneR v2.5.1

* Performance and memory usage gains through ensuring 0 values are not read from raw files.
Expand Down
8 changes: 6 additions & 2 deletions R/detect.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@ detectInfusionScans <- function(files,

ms <- files %>%
future_map(~{
.x %>%
openMSfile() %>%
ms <- .x %>%
openMSfile()

file_header <- ms %>%
header()

return(file_header)
}) %>%
set_names(files)

Expand Down
15 changes: 10 additions & 5 deletions R/get.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#' @importFrom mzR openMSfile peaks
#' @importFrom stats aggregate
#' @importFrom dplyr bind_rows group_by summarise
#' @importFrom magrittr %>%
Expand All @@ -13,7 +12,7 @@ sampProcess <- function(file,scans,dp){
return(pl)
}

#' @importFrom mzR openMSfile peaks
#' @importFrom mzR openMSfile peaks close
#' @importFrom purrr map
#' @importFrom dplyr bind_rows
#' @importFrom tibble as_tibble
Expand All @@ -32,7 +31,7 @@ getFile <- function(file,scans){
hd$polarity[hd$polarity == 0] <- 'n'
hd$polarity[hd$polarity == 1] <- 'p'

ms %>%
file_peaks <- ms %>%
peaks() %>%
.[hd$seqNum] %>%
map(~{
Expand All @@ -47,6 +46,8 @@ getFile <- function(file,scans){
mutate(seqNum = as.numeric(seqNum)) %>%
left_join(hd, by = "seqNum") %>%
select(-filterString,-seqNum)

return(file_peaks)
}

#' @importFrom parallel makeCluster stopCluster parLapply clusterExport
Expand All @@ -68,9 +69,13 @@ getHeaders <- function(files){

headers <- files %>%
future_map(~{
.x %>%
openMSfile(backend = 'pwiz') %>%
ms <- .x %>%
openMSfile(backend = 'pwiz')

file_header <- ms %>%
header()

return(file_header)
}) %>%
set_names(files) %>%
bind_rows(.id = 'FileName') %>%
Expand Down
5 changes: 3 additions & 2 deletions R/spectralBinning-method.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ setMethod("spectralBinning",
if (isTRUE(verbose)) message('Reading raw data')
pks <- getPeaks(files,scans(x))

if (isTRUE(verbose)) message('Calculating bins')
if (isTRUE(verbose)) message('Gathering bins')
bin_list <- calcBinList(pks)

if (isTRUE(verbose)) message('Removing single scan events')
Expand Down Expand Up @@ -65,7 +65,7 @@ setMethod("spectralBinning",
}) %>%
bind_rows()

if (isTRUE(verbose)) message('Calculating bin measures')
if (isTRUE(verbose)) message('Calculating bin metrics')
bin_measures <- calcBinMeasures(pks,
cls)

Expand Down Expand Up @@ -96,6 +96,7 @@ setMethod("spectralBinning",
select(-fileName,-polarity)
})

if (isTRUE(verbose)) message('Gathering file headers')
headers <- getHeaders(files)

binnedData(x) <- binned_data
Expand Down
9 changes: 6 additions & 3 deletions docs/404.html

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

44 changes: 22 additions & 22 deletions docs/LICENSE.html

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

38 changes: 23 additions & 15 deletions docs/articles/binneR.html

Large diffs are not rendered by default.

Binary file modified docs/articles/binneR_files/figure-html/FIEfingerprint-.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/articles/binneR_files/figure-html/analysisChromatogram-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/articles/binneR_files/figure-html/analysisFingerprints-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/articles/binneR_files/figure-html/analysisTICs-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/articles/binneR_files/figure-html/binCentrality-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/articles/binneR_files/figure-html/binPurity-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/articles/binneR_files/figure-html/exampleChromatograms-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/articles/binneR_files/figure-html/plotBin-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions docs/articles/binneR_files/header-attrs-2.7/header-attrs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Pandoc 2.9 adds attributes on both header and div. We remove the former (to
// be compatible with the behavior of Pandoc < 2.8).
document.addEventListener('DOMContentLoaded', function(e) {
var hs = document.querySelectorAll("div.section[class*='level'] > :first-child");
var i, h, a;
for (i = 0; i < hs.length; i++) {
h = hs[i];
if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6
a = h.attributes;
while (a.length > 0) h.removeAttribute(a[0].name);
}
});
6 changes: 3 additions & 3 deletions docs/articles/index.html

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

6 changes: 3 additions & 3 deletions docs/authors.html

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

6 changes: 3 additions & 3 deletions docs/index.html

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

15 changes: 12 additions & 3 deletions docs/news/index.html

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

4 changes: 2 additions & 2 deletions docs/pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pandoc: 2.7.3
pandoc: 2.11.2
pkgdown: 1.6.1
pkgdown_sha: ~
articles:
binneR: binneR.html
last_built: 2020-11-20T02:16Z
last_built: 2021-03-06T01:01Z

Loading

0 comments on commit 749922e

Please sign in to comment.