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

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

Closed
sgibb opened this issue Jun 8, 2013 · 2 comments
Assignees
Milestone

Comments

@sgibb
Copy link
Owner

sgibb commented Jun 8, 2013

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
@ghost ghost assigned sgibb Jun 8, 2013
@sgibb
Copy link
Owner Author

sgibb commented Jun 9, 2013

Introduced in #21.

sgibb added a commit that referenced this issue Jun 9, 2013
@sgibb sgibb closed this as completed in 1d54996 Jun 9, 2013
@sgibb
Copy link
Owner Author

sgibb commented Jan 10, 2014

Since MALDIquant 1.8.16 minFrequency and minNumber could be vectors so this
is not needed any more and we could use minFrequency > 1 and minNumber > n as feature to
remove all peaks (or avoid the generation of a whitelist if mergeWhitelists=TRUE (MALDIquant 1.8.17))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant