Giter Club home page Giter Club logo

maldiquant's People

Contributors

lgatto avatar paoloinglese avatar sgibb avatar siggismara avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

maldiquant's Issues

enhance workflow demo file

  • add arguments (default arguments, too)
  • explain the need to adjust different arguments (e.g. halfWindowSize)

mergeMassSpectra throws an error for empty MassSpectrum objects

library("MALDIquant")

s <- c(createMassSpectrum(1:5, 1:5),
       createMassSpectrum(double(), double()))
m <- mergeMassSpectra(s)
# Error in approxfun(x = x@mass, y = x@intensity, method = method, yleft = yleft,  : need at least two non-NA values to interpolate
# In addition: Warning message:
# In max(x@intensity) : no non-missing arguments to max; returning -Inf

filterPeaks: minNumber must not be higher than the maximal number of MassPeaks objects

minNumber should be reduced to the maximal number of MassPeaks objects in the current label otherwise all peaks will removed:

library("MALDIquant")

p <- c(createMassPeaks(1:3, 1:3),
       createMassPeaks(1:2, 1:2),
       createMassPeaks(1, 1))

filterPeaks(p, minNumber=2, labels=c(1, 2, 2))

# [[1]]
# S4 class type            : MassPeaks
# Number of m/z values     : 0        
# Range of m/z values      : NA       
# Range of intensity values: NA       
# Range of snr values      : NA       
# Memory usage             : 1.234 KiB
# 
# [[2]]
# S4 class type            : MassPeaks
# Number of m/z values     : 1        
# Range of m/z values      : 1 - 1    
# Range of intensity values: 1 - 1    
# Range of snr values      : NA - NA  
# Memory usage             : 1.258 KiB
# 
# [[3]]
# S4 class type            : MassPeaks    
# Number of m/z values     : 1            
# Range of m/z values      : 1 - 1        
# Range of intensity values: 1e+00 - 1e+00
# Range of snr values      : NA - NA      
# Memory usage             : 1.258 KiB 

expected output:

# warning: reduce minNumber for label "1" because minNumber > n doesn't make sense!

# [[1]]
# S4 class type            : MassPeaks
# Number of m/z values     : 3        
# Range of m/z values      : 1 - 3    
# Range of intensity values: 1 - 3    
# Range of snr values      : NA - NA  
# Memory usage             : 1.281 KiB

totalIonCurrent causes "integer overflow"

Some raw files contain integer intensity values (e.g. fid files). Summing all this integers could cause an integer overflow.

totalIonCurrent(g[[1]])
# [1] NA
# Warning message:
# In sum(object@intensity, na.rm = TRUE) :
#   Integer overflow - use sum(as.numeric(.))

.doByLabels doesn't preserve order

To reproduce:

library("MALDIquant")

s <- c(createMassPeaks(1:4, rep(1, 4), metaData=list(name=33)),
       createMassPeaks(1:4, rep(1, 4), metaData=list(name=33)),
       createMassPeaks(1:4, rep(1, 4), metaData=list(name=22)),
       createMassPeaks(1:4, rep(1, 4), metaData=list(name=22)),
       createMassPeaks(1:4, rep(1, 4), metaData=list(name=34)),
       createMassPeaks(1:4, rep(1, 4), metaData=list(name=34)))

f <- factor(rep(c(33, 22, 34), each=2))

p <- mergeMassPeaks(s, f)

sapply(p, function(x)metaData(x)$name)
## order is 22 33 44 instead of 33, 22, 34

fix demo/workflow.R

Adapt to alignSpectra and new intensityMatrix (separate binPeaks call is not needed anymore).

mergeMassSpectra throws warning "MassSpectrum created with missing/filtered mass values."

Since fix #23 mergeMassSpectra throws a warning:

MassSpectrum created with missing/filtered mass values.

(which is not unusal in merging and should not confuse the user)

Seems to be a rounding problem:

> library("MALDIquant")
> createMassSpectrum(1:10, 1:10)
#S4 class type            : MassSpectrum
#Number of m/z values     : 10          
#Range of m/z values      : 1 - 10      
#Range of intensity values: 1 - 10      
> createMassSpectrum((1:10)+0.2, 1:10)
#S4 class type            : MassSpectrum
#Number of m/z values     : 10          
#Range of m/z values      : 1.2 - 10.2  
#Range of intensity values: 1 - 10      
#Warning message:
#In validityMethod(object) :
#  MassSpectrum created with missing/filtered mass values. This may compromise subsequent baseline correction and peak detection.

remove platform-specific call of an interactive device

using R Under development (unstable) (2013-07-02 r63156)
using platform: x86_64-unknown-linux-gnu (64-bit) 

checking R code for possible problems ... NOTE
Found an obsolete/platform-specific call in the following function:
‘.openInteractiveDevice’
Found the platform-specific devices:
‘X11’ ‘windows’
dev.new() is the preferred way to open a new device,
in the unlikely event one is needed. 

R CMD check (R-devel) reports a NOTE about LICENSE file

R CMD check output:

File
LICENSE
is not mentioned in the DESCRIPTION file. 

MALDIquant is distributed under GPL (>=3) which is a supported license. We already use the License: GPL field in DESCRIPTION. That's why the LICENSE file could simply removed (it should be used only for unsupported licenses).

fix TIC calculation

Currently the TIC is calculated by sum(spectrum@intensity) but this is only correct if all spectrum@mass values are equally spaced. For most spectra generated by Bruker devices this isn't true, because the difference between to mass values increases.
Something like (head(intensity, -1)+tail(intensity, -1))/2 * diff(mass) is needed.

Rewrite description

In the future, pls explain

MALDI (11:47)
TOF (11:53)
TopHat (13:37)

in the Description

test for centroided/missing data

Centroided or missing mass values break our window-based baseline correction and peak detection algorithms. That's why the constructor createMassSpectrum has to test for centroided or missing mass values and shows a warning if needed.

filterPeaks should not round minFrequency argument

filterPeaks use floor to determine minimal number of peaks from a given minFrequency argument but it should not round it because this behavior is mostly unexpected.

To reproduce:
minFrequency=2/3;
2/3_3 == 2 (at least 2; mass == 1:4 for group 1);
2/3_4 == 2.6667 (=> at least 3 peaks (mass == 1:4) for group 2; but filterPeaks uses floor and we get mass == 1:5)

library("MALDIquant")

p <- c(createMassPeaks(1:3, 1:3),
       createMassPeaks(1:4, 1:4),
       createMassPeaks(1:5, 1:5),
       createMassPeaks(1:3, 1:3),
       createMassPeaks(1:4, 1:4),
       createMassPeaks(1:5, 1:5),
       createMassPeaks(1:6, 1:6))

sapply(filterPeaks(p, minFrequency=2/3, labels=c(rep(1, 3), rep(2, 4))), mass)

remove .stopIfNotMass*

  • replaced by .stopIfNotIsMass* (don't forget man/MALDIquant-internal.Rd)
  • adapt MALDIquantTools

calibrate/normalize function for MassSpectrum objects

  • TIC
  • Median
  • Probabilistic Quotient Normalization (Huber/Dieterle)

Mark

  • calibrate on matrices
  • standardizeTotalIonCurrent on MassSpectrum objects
  • totalIonCurrent<-

as deprecated.

Documentation

  • calibrateIntensity (TIC, Median, PQN)
  • add calibrateIntensity to workflow example

add averageMassSpectra

averageMassSpectra will replace current mergeMassSpectra (should be marked as deprecated or should really merges spectra) and will work on a mass range that is covered by all spectra.

.doByLabels throws an error if each object has its own label

To reproduce:

library("MALDIquant")
data(fiedler2009subset)
MALDIquant:::.doByLabels(fiedler2009subset[1:4], labels=1:4, function(x)x[[1]])

Error message:

Error in `split<-.default`(`*tmp*`, f, drop = drop, value = value) :
  object of type 'S4' is not subsettable

TIC on specific ranges

It should be possible to use TIC only on a user-defined range.
(If no range is given the largest overlap should be chosen.)

Spectra with zero intensities aren't empty spectra and become invalid.

library("MALDIquant")
s <- createMassSpectrum(mass=1:10, intensity=rep(0, 10))
as.matrix(s)
#     mass intensity
# [1,]    1         0
# [2,]    2         0
# [3,]    3         0
# [4,]    4         0
# [5,]    5         0
# [6,]    6         0
# [7,]    7         0
# [8,]    8         0
# [9,]    9         0
#[10,]   10         0
length(s)
# [1] 10
totalIonCurrent(s) <- 1
as.matrix(s)
#     mass intensity
length(s)
# [1] 0

fix methods NOTE

Package in Depends field not imported from: ‘methods’
These packages needs to imported from for the case when
this namespace is loaded but not attached.
See the information on DESCRIPTION files in the chapter ‘Creating R
packages’ of the ‘Writing R Extensions’ manual.

include tests

cleanup and move tests from ../tests to inst/tests/

parallel support

Use mclapply and mcmapply to allow parallel execution at least on unix based platforms.

ProtGenerics

Would you consider depending on ProtGenerics and use the mass and intensity generics that are defined there? They are defined as follows

setGeneric("intensity", function(object, ...) standardGeneric("intensity"))
setGeneric("mass", function(object, ...) standardGeneric("mass"))

move tests

testthat 0.8 comes with a new recommended structure for storing your tests. To
better meet CRAN recommended practices, testthat now recommend that you to put
your tests in tests/testthat, instead of inst/test (this makes it
possible for users to choose whether or not to install tests). With this
new structure, you'll need to use test_check() instead of test_packages()
in the test file (usually tests/testthat.R) that runs all testthat unit
tests.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.