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

Peak detected but not integrated #785

Open
DKruttika opened this issue Jan 25, 2025 · 0 comments
Open

Peak detected but not integrated #785

DKruttika opened this issue Jan 25, 2025 · 0 comments

Comments

@DKruttika
Copy link

Hi,

I am analyzing data from 908 devices - zipchip data - from Thermo. I converted the .raw files to centroid mode using msconvert. I am able to use xcms to to untargeted analysis on the files but sometimes the peaks are not getting integrated, but when I plot the EICs, I see the peaks. This is my code:

datapath <-  "path/to/mzml files"
datafiles_list <- list.files(datapath, recursive = FALSE, full.names = TRUE, pattern = ".mzML")


raw_data <- readMsExperiment(datafiles_list)

# I set a range for filtering things because I am looking for certain compounds within a window
RT1 <- ((min(std_mz_list$RT))*60) - 120
RT2 <- ((max(std_mz_list$RT))*60) + 120

if (RT1 <= 0) {
  
  RT1 <- min(raw_data@spectra@backend@spectraData$rtime)
  
}

raw_data_filt <- filterRt(raw_data, rt = c(RT1,	RT2))

cwp_zipchip_lowppm <-  CentWaveParam(peakwidth = c(1, 20), ppm = 20, mzdiff = 0.002,
                                     snthresh = 10, noise = 1000, prefilter = c(2,400), 
                                     verboseBetaColumns = TRUE)

raw_data_processed <- findChromPeaks(raw_data_filt, param = cwp_zipchip, BPPARAM = param)
mpp <- MergeNeighboringPeaksParam(expandRt = 2, minProp = 0.8)
raw_data_processed_mp <- refineChromPeaks(raw_data_processed, mpp)

### plotting chromatograms for certain files
# I filtered for the 8 files I am interested in:
raw_data_processed2_mp_filt <- filterFile(raw_data_processed2_mp, file = c(grep("R1", datafiles_list),
                                                                           grep("R4", datafiles_list)))
# I then extracted the chromatograms 
chr_glycine <- chromatogram(raw_data_processed2_mp_filt, 
                           mz = c( 76.0355, 76.0431), # 50 ppm 
                           rt = c(200, 300),
                           BPPARAM = param)


plot(chr_glycine[[5]]) # this shows a peak thats integrated
plot(chr_glycine[[6]]) # this shows a peak thats not integrated

Please let me know if there is something I am doing thats wrong.

sessioninfo()
R version 4.4.0 (2024-04-24 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows Server 2019 x64 (build 17763)

Matrix products: default

attached base packages:
[1] parallel  stats4    stats     graphics  grDevices utils     datasets 
[8] methods   base     

other attached packages:
 [1] readxl_1.4.3        doParallel_1.0.17   iterators_1.0.14   
 [4] foreach_1.5.2       MsExperiment_1.6.0  Matrix_1.7-0       
 [7] lubridate_1.9.3     forcats_1.0.0       stringr_1.5.1      
[10] dplyr_1.1.4         purrr_1.0.2         readr_2.1.5        
[13] tidyr_1.3.1         tibble_3.2.1        ggplot2_3.5.1      
[16] tidyverse_2.0.0     xcms_4.2.2          BiocParallel_1.38.0
[19] MSnbase_2.30.1      ProtGenerics_1.36.0 S4Vectors_0.42.0   
[22] mzR_2.38.0          Rcpp_1.0.12         Biobase_2.64.0     
[25] BiocGenerics_0.50.0

loaded via a namespace (and not attached):
 [1] DBI_1.2.3                   rlang_1.1.4                
 [3] magrittr_2.0.3              clue_0.3-65                
 [5] MassSpecWavelet_1.70.0      matrixStats_1.3.0          
 [7] compiler_4.4.0              vctrs_0.6.5                
 [9] reshape2_1.4.4              pkgconfig_2.0.3            
[11] MetaboCoreUtils_1.12.0      crayon_1.5.2               
[13] XVector_0.44.0              utf8_1.2.4                 
[15] tzdb_0.4.0                  UCSC.utils_1.0.0           
[17] preprocessCore_1.66.0       MultiAssayExperiment_1.30.2
[19] zlibbioc_1.50.0             GenomeInfoDb_1.40.1        
[21] jsonlite_1.8.8              progress_1.2.3             
[23] DelayedArray_0.30.1         prettyunits_1.2.0          
[25] cluster_2.1.6               R6_2.5.1                   
[27] stringi_1.8.4               RColorBrewer_1.1-3         
[29] limma_3.60.2                cellranger_1.1.0           
[31] GenomicRanges_1.56.0        SummarizedExperiment_1.34.0
[33] snow_0.4-4                  IRanges_2.38.0             
[35] timechange_0.3.0            igraph_2.0.3               
[37] tidyselect_1.2.1            rstudioapi_0.16.0          
[39] abind_1.4-5                 codetools_0.2-20           
[41] affy_1.82.0                 lattice_0.22-6             
[43] plyr_1.8.9                  withr_3.0.0                
[45] Spectra_1.14.1              pillar_1.9.0               
[47] affyio_1.74.0               BiocManager_1.30.23        
[49] MatrixGenerics_1.16.0       MALDIquant_1.22.2          
[51] ncdf4_1.22                  generics_0.1.3             
[53] hms_1.1.3                   munsell_0.5.1              
[55] scales_1.3.0                glue_1.7.0                 
[57] MsFeatures_1.12.0           lazyeval_0.2.2             
[59] tools_4.4.0                 mzID_1.42.0                
[61] QFeatures_1.14.1            vsn_3.72.0                 
[63] fs_1.6.4                    XML_3.99-0.16.1            
[65] grid_4.4.0                  impute_1.78.0              
[67] MsCoreUtils_1.16.0          colorspace_2.1-0           
[69] GenomeInfoDbData_1.2.12     PSMatch_1.8.0              
[71] cli_3.6.2                   fansi_1.0.6                
[73] S4Arrays_1.4.1              AnnotationFilter_1.28.0    
[75] pcaMethods_1.96.0           gtable_0.3.5               
[77] digest_0.6.35               SparseArray_1.4.8          
[79] lifecycle_1.0.4             httr_1.4.7                 
[81] statmod_1.5.0               MASS_7.3-60.2 

Image
Image

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