MASHUOA / HiTMaP

An R package of High-resolution Informatics Toolbox for Maldi-imaging Proteomics
GNU General Public License v3.0
15 stars 12 forks source link

Error in "PCA" function #14

Open SA-coder-netizen opened 1 week ago

SA-coder-netizen commented 1 week ago

Hi HiTMaP team, I was trying to run the code using my data and encountered an error not sure how to fix it. any help would be greatly appreciated. my code 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 = 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="uniprotkb_proteome_UP000005640_AND_revi_2024_11_07.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=TRUE,
           output_candidatelist=T,

==============The pre-processing param

           preprocess=preprocess,

==============Set the parameters for image segmentation

           spectra_segments_per_file=9,
           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=TRUE,
           ClusterID_colname="Protein",
           componentID_colname="Peptide",
           Protein_desc_of_interest= ".",
           Rotate_IMG=NULL,
           )
         This is the output

4 Cores detected, 4 threads will be used for computing

1 files were selected and will be used for Searching

uniprotkb_proteome_UP000005640_AND_revi_2024_11_07.fasta was selected as database. Candidates will be generated through Proteomics mode

Found enzyme: trypsin

Found rule: ""

Found customized rule: ""

Candidate list has been loaded.

uniprotkb_proteome_UP000005640_AND_revi_2024_11_07.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: 20241023-sharat-52059-dhb-500shot.imzML

Preparing image data for statistical analysis: 20241023-sharat-52059-dhb-500shot.imzML

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

Warning message: “no pending processing steps to apply” Using image data: 20241023-sharat-52059-dhb-500shot.imzML

Segmentation in progress...

Performing forced peak alignment before segmentation...

preprocess$peakAlign$tolerance set as 5

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

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

Error in data.frame(Component = 1:length(PCA_imdata@model[["sdev"]]), : no slot of name "model" for this object of class "PCA2" Traceback:

  1. IMS_data_process(datafile = datafile, workdir = workdir, Peptide_Summary_searchlist = Peptide_Summary_searchlist, . segmentation_num = spectra_segments_per_file, threshold = threshold, . rotate = Rotate_IMG, ppm = ppm, mzrange = mzrange, Segmentation = Segmentation, . Segmentation_ncomp = Segmentation_ncomp, PMFsearch = PMFsearch, . Virtual_segmentation_rankfile = Virtual_segmentation_rankfile, . BPPARAM = BPPARAM, Bypass_generate_spectrum = Bypass_generate_spectrum, . score_method = score_method, Decoy_mode = Decoy_mode, Decoy_search = Decoy_search, . adjust_score = adjust_score, peptide_ID_filter = peptide_ID_filter, . Protein_desc_of_interest = Protein_desc_of_interest, plot_matching_score_t = plot_matching_score, . FDR_cutoff = FDR_cutoff, Segmentation_def = Segmentation_def, . Segmentation_variance_coverage = Segmentation_variance_coverage, . preprocess = preprocess)
  2. Preprocessing_segmentation(datafile = datafile[z], workdir = workdir[z], . segmentation_num = segmentation_num, ppm = ppm, import_ppm = import_ppm, . Bypass_Segmentation = Bypass_Segmentation, mzrange = mzrange, . Segmentation = Segmentation, Segmentation_def = Segmentation_def, . Segmentation_ncomp = Segmentation_ncomp, Segmentation_variance_coverage = Segmentation_variance_coverage, . Smooth_range = Smooth_range, colorstyle = colorstyle, Virtual_segmentation_rankfile = Virtual_segmentation_rankfile, . rotate = rotate, BPPARAM = BPPARAM, preprocess = preprocess)
  3. PCA_ncomp_selection(imdata_stats, variance_coverage = Segmentation_variance_coverage, . outputdir = paste0(getwd(), "/"))
  4. data.frame(Component = 1:length(PCA_imdata@model[["sdev"]]), . Standard.deviation = PCA_imdata@model[["sdev"]])
  5. .handleSimpleError(function (cnd) . { . watcher$capture_plot_and_output() . cnd <- sanitize_call(cnd) . watcher$push(cnd) . switch(on_error, continue = invokeRestart("eval_continue"), . stop = invokeRestart("eval_stop"), error = invokeRestart("eval_error", . cnd)) . }, "no slot of name \"model\" for this object of class \"PCA2\"", . base::quote(data.frame(Component = 1:length(PCA_imdata@model[["sdev"]]), . Standard.deviation = PCA_imdata@model[["sdev"]])))