Skip to content

small sample sizes failing at batch correction #194

@kcgfarb

Description

@kcgfarb

CCA and RPCA k.weight default is 100. If a sample has < 100 cells then integration by these methods fails.

Perhaps need way to override the k.weight default when there are samples with very few QC'd cells?

Example of error below where 3 samples in the data set had 56 -79 cells:

ERROR ~ Error executing process > 'GEX_EXQC:BATCH_CORRECT_CCA (PBMC-Blood-Cytology-CTC-Biopsy-Autopsy-AutopsyNormal)'

Caused by:
  Process `GEX_EXQC:BATCH_CORRECT_CCA (PBMC-Blood-Cytology-CTC-Biopsy-Autopsy-AutopsyNormal)` terminated with an error exit status (1)


Command executed:

  Rscript -e 'rmarkdown::render("batch_correction_cca.Rmd",
      params=list(gid="PBMC-Blood-Cytology-CTC-Biopsy-Autopsy-AutopsyNormal",
          mergedObj="PBMC-Blood-Cytology-CTC-Biopsy-Autopsy-AutopsyNormal_seurat_merged.rds",
          species="hg38",
          npcs="50",
          vars_to_regress="NULL",
          resolution_list="0.1,0.2,0.3,0.5,0.6,0.8,1",
          Rlib_dir="/data/CCBR_Pipeliner/db/PipeDB/Rlibrary_4.3_scRNA_RHEL8",
          Rpkg_config="Rpack.config",
          scRNA_functions="scRNA_functions.R",
          testing="N"),
      output_file = "PBMC-Blood-Cytology-CTC-Biopsy-Autopsy-AutopsyNormal_batch_correction_cca.html")'

Command exit status:
  1

Command output:
  1/8              
  2/8 [prep_args]  
  3/8              
  4/8 [handle_pkg] 
  5/8              
  6/8 [processing] 

Command error:
    |                                                                            
    |===================================                                   |  50%
    |                                                                            
    |====================================================                  |  75%
    |                                                                            
    |======================================================================| 100%

    |                                                                            
    |                                                                      |   0%
    |                                                                            
    |==================                                                    |  25%
    |                                                                            
    |===================================                                   |  50%
    |                                                                            
    |====================================================                  |  75%
    |                                                                            
    |======================================================================| 100%

    |                                                                            
    |                                                                      |   0%
    |                                                                            
    |==================                                                    |  25%
    |                                                                            
    |===================================                                   |  50%
    |                                                                            
    |====================================================                  |  75%
    |                                                                            
    |======================================================================| 100%

    |                                                                            
    |                                                                      |   0%
    |                                                                            
    |==================                                                    |  25%
    |                                                                            
    |===================================                                   |  50%
    |                                                                            
    |====================================================                  |  75%
    |                                                                            
    |======================================================================| 100%

  Quitting from lines  at lines 66-79 [processing] (batch_correction_cca.Rmd)
  Error:
  ! k.weight (100) is set larger than the number of cells in the smallest object (56). Please choose a smaller k.weight.
  Backtrace:
   1. global MAIN_BATCH_CORRECTION(...)
   2. Seurat::IntegrateLayers(...)
   3. Seurat (local) method(...)
   5. Seurat:::IntegrateEmbeddings.IntegrationAnchorSet(...)
   6. Seurat:::ValidateParams_IntegrateEmbeddings_IntegrationAnchors(...)
  Execution halted

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions