HiTMaP icon indicating copy to clipboard operation
HiTMaP copied to clipboard

Error in summarize(., mean = mean(Score))

Open MT0104 opened this issue 5 months ago • 2 comments

Hi HiTMaP team, I really like this code, I am running it with your example data to get it ready for my project, and it is giving me the output of: Error in summarize(., mean = mean(Score)) : Input must be a hitmap_project object after Ranking mz feature: 15445 unique candidates mz, 1200 aligned mz feature I think the code may not be reading one of the input files. Could you please help me out? Thank you so much!

Here is my full input:

preprocess = list(force_preprocess=TRUE, use_preprocessRDS=FALSE, smoothSignal=list(method = c("Disable", "gaussian", "sgolay", "ma")[1]), reduceBaseline=list(method = c("Disable", "locmin", "median")[1]), peakPick=list(method=c("diff", "sd", "mad", "quantile", "filter", "cwt")[3]), peakAlign=list(tolerance=5, units="ppm", level=c("local","global")[1], method=c("Enable","Disable")[1]), normalize=list(method=c("Disable","rms","tic","reference")[1], mz=NULL) )

imaging_identification( #==============Choose the imzml raw data file(s) to process make sure the fasta file in the same folder datafile=paste0(wd,datafile), threshold=0.005, ppm=5, FDR_cutoff = 0.05, #==============specify the digestion enzyme specificity Digestion_site="trypsin", #==============specify the range of missed Cleavages missedCleavages=0:1, #==============Set the target fasta file Fastadatabase="uniprot-bovin.fasta", #==============Set the possible adducts and fixed modifications adducts=c("M+H"), Modifications=list(fixed=NULL,fixmod_position=NULL,variable=NULL,varmod_position=NULL), #==============The decoy mode: could be one of the "adducts", "elements" or "isotope" Decoy_mode = "isotope", use_previous_candidates=F, output_candidatelist=T, #==============The pre-processing param preprocess=preprocess, #==============Set the parameters for image segmentation spectra_segments_per_file=4, Segmentation="spatialKMeans", Smooth_range=1, Virtual_segmentation=FALSE, Virtual_segmentation_rankfile=NULL, #==============Set the Score method for hi-resolution isotopic pattern matching score_method="SQRTP", peptide_ID_filter=2, #==============Summarise the protein and peptide features across the project the result can be found at the summary folder Protein_feature_summary=TRUE, Peptide_feature_summary=TRUE, Region_feature_summary=TRUE, #==============The parameters for Cluster imaging. Specify the annotations of interest, the program will perform a case-insensitive search on the result file, extract the protein(s) of interest and plot them in the cluster imaging mode plot_cluster_image_grid=FALSE, ClusterID_colname="Protein", componentID_colname="Peptide", Protein_desc_of_interest=c("Crystallin","Actin"), Rotate_IMG=NULL, )

And here is my output from it: 12 Cores detected, 4 threads will be used for computing 1 files were selected and will be used for Searching uniprot-bovin.fasta was selected as database. Candidates will be generated through Proteomics mode Found enzyme: trypsin Found rule: "" Found customized rule: "" Testing fasta sequances for degestion site: (KR)|((?<=W)K(?=P))|((?<=M)R(?=P)) Generated 37948 Proteins in total. Computing exact masses... Generating peptide formula... Generating peptide formula with adducts: M+H Calculating peptide mz with adducts: M+H Candidate list has been exported. uniprot-bovin.fasta was selected as database Spectrum intensity threshold: 0.50% mz tolerance: 5 ppm Segmentation method: spatialKMeans Manual segmentation def file: None Bypass spectrum generation: FALSE Found rotation info Loading raw image data for statistical analysis: Bovin_lens.imzML parsing imzML file: ‘C:\Users\tanji\OneDrive - Johns Hopkins\Documents\Summary_Error_Test\Bovinlens_Trypsin_FT\Bovin_lens.imzML’ detected 'processed' imzML creating MSImagingExperiment applying profile m/z-values to all spectra using mass.range 700 to 4000 using resolution 5 ppm binning intensity from mz 700 to 3999.9828 with relative resolution 5e-06 returning MSImagingExperiment Preparing image data for statistical analysis: Bovin_lens.imzML queued: height peak picking processing: height peak picking

processing chunk 1/20 (131 items | 2.46 MB)

processing chunk 2/20 (131 items | 3.11 MB)

processing chunk 3/20 (131 items | 3.33 MB)

processing chunk 4/20 (131 items | 3.4 MB)

processing chunk 5/20 (131 items | 3.33 MB)

processing chunk 6/20 (131 items | 3.16 MB)

processing chunk 7/20 (130 items | 3.06 MB)

processing chunk 8/20 (131 items | 2.97 MB)

processing chunk 9/20 (131 items | 2.75 MB)

processing chunk 10/20 (131 items | 2.68 MB)

processing chunk 11/20 (131 items | 2.54 MB)

processing chunk 12/20 (131 items | 2.19 MB)

processing chunk 13/20 (131 items | 2.36 MB)

processing chunk 14/20 (130 items | 2.22 MB)

processing chunk 15/20 (131 items | 2.08 MB)

processing chunk 16/20 (131 items | 2.05 MB)

processing chunk 17/20 (131 items | 2.25 MB)

processing chunk 18/20 (131 items | 2.21 MB)

processing chunk 19/20 (131 items | 2.03 MB)

processing chunk 20/20 (131 items | 2.05 MB)

collecting 2618 results from 20 chunks

output spectra: intensity Using image data: Bovin_lens.imzML parsing imzML file: ‘C:\Users\tanji\OneDrive - Johns Hopkins\Documents\Summary_Error_Test\Bovinlens_Trypsin_FT\Bovin_lens.imzML’ detected 'processed' imzML creating MSImagingExperiment applying profile m/z-values to all spectra using mass.range 700 to 4000 using resolution 5 ppm binning intensity from mz 700 to 3999.9828 with relative resolution 5e-06 returning MSImagingExperiment Segmentation in progress... Performing forced peak alignment before segmentation... preprocess$peakAlign$tolerance set as 5 detected ~881.6 peaks per spectrum using bin ratio of 2 to create peak bins (per tolerance half-window) using peak bins with relative resolution of 2.5e-06 binning peaks to create shared reference

processing 20 chunks (~130 items per chunk | ~929.5 KB per chunk)

|============================================================================================================================================| 100%

collecting 2618 results from 20 chunks

merging peak bins with relative centroid differences <= 5e-06 aligned to 23945 reference peaks with relative tolerance 5e-06 (5 ppm) computing gaussian weights using custom weights fitting FastMap component 1 |====================================================================================| 100%

iteration 1: max pivot distance (2347, 1573) = 28060511 |====================================================================================| 100%

iteration 2: max pivot distance (1573, 800) = 28174693 |============================================================================================================================================| 100%

iteration 3: max pivot distance (800, 1573) = 29026404 projecting component 1 using pivots: 1573, 800 fitting FastMap component 2 |============================================================================================================================================| 100%

iteration 1: max pivot distance (2087, 1578) = 20459505 |============================================================================================================================================| 100%

iteration 2: max pivot distance (2087, 1578) = 20459505 projecting component 2 using pivots: 2087, 1578 fitting FastMap component 3 |============================================================================================================================================| 100%

iteration 1: max pivot distance (1200, 1467) = 16922397 |============================================================================================================================================| 100%

iteration 2: max pivot distance (2377, 13) = 18340724 |============================================================================================================================================| 100%

iteration 3: max pivot distance (1314, 1467) = 18623114 |============================================================================================================================================| 100%

iteration 4: max pivot distance (1314, 1467) = 18623114 projecting component 3 using pivots: 1314, 1467 fitting FastMap component 4 |============================================================================================================================================| 100%

iteration 1: max pivot distance (2499, 13) = 17863708 |============================================================================================================================================| 100%

iteration 2: max pivot distance (2499, 13) = 17863708 projecting component 4 using pivots: 2499, 13 returning FastMap projection fitting k-means for k = 4 calculating cluster centers

processing 20 chunks (~130 items per chunk | ~1.86 MB per chunk)

|============================================================================================================================================| 100%

collecting 2618 results from 20 chunks

calculating spatial correlations with clusters

processing 20 chunks (~145 items per chunk | ~1.86 MB per chunk)

|============================================================================================================================================| 100%

collecting 2915 results from 20 chunks

returning spatial k-means spatialKMeans finished: Bovin_lens workflow successfully completed Got Protein_feature_list from global environment. PMFsearch Bovin_lens region 4 Found. region 1 Found. region 2 Found. region 3 Found. IMS_analysis Bovin_lens region 4 preprocess$peakAlign$tolerance set as 5 detected ~1000.4 peaks per spectrum using bin ratio of 2 to create peak bins (per tolerance half-window) using peak bins with relative resolution of 2.5e-06 binning peaks to create shared reference

processing 20 chunks (~23 items per chunk | ~188.81 KB per chunk)

|============================================================================================================================================| 100%

collecting 469 results from 20 chunks

merging peak bins with relative centroid differences <= 5e-06 aligned to 16828 reference peaks with relative tolerance 5e-06 (5 ppm)

processing 20 chunks (~23 items per chunk | ~377.62 KB per chunk)

|============================================================================================================================================| 100%

collecting 469 results from 20 chunks

1250 mz features subjected to 1st PMF search PMF 1st search... Summarizing peptide information... 1st run returns 44958 peptide candidates |============================================================================================================================================| 100%

|============================================================================================================================================| 100%

Ranking mz feature: 15445 unique candidates mz, 1200 aligned mz feature Error in summarize(., mean = mean(Score)) : Input must be a hitmap_project object In addition: Warning message: In .local(object, ...) : '.local' is deprecated. Use 'subsetFeatures' instead. See help("Deprecated")

MT0104 avatar Jul 23 '25 15:07 MT0104