Load pre-existing Seurat objects into the immunopipe pipeline instead of starting from raw count matrices via SampleInfo...
Load pre-existing Seurat objects into the immunopipe pipeline instead of starting from raw count matrices via SampleInfo. This enables analysis on already processed single-cell RNA-seq data stored in Seurat R objects.
[LoadingRNAFromSeurat]
cache = true
[LoadingRNAFromSeurat.in]
# Path to Seurat object file (RDS or qs/qs2 format)
# Can be single file or array of files for multiple samples
infile = ["path/to/seurat_object.rds"]
# Alternative: can use 'srtobj' alias (same as infile)
# srtobj = ["path/to/seurat_object.rds"]
[LoadingRNAFromSeurat.envs]
# Whether the Seurat object is well-prepared for the pipeline
# - If true: SeuratPreparing process will be skipped
# - If false: SeuratPreparing will run for QC, normalization, integration
prepared = false
# Whether the Seurat object is already clustered
# - If true: SeuratClustering (or SeuratClusteringOfAllCells) and SeuratMap2Ref will be skipped
# - Forces 'prepared' to be true if set to true
clustered = false
# Column name in Seurat object's meta.data that contains sample identifiers
# Used to create a "Sample" column in the output
# Default is "Sample" - if meta.data already has "Sample", no action is taken
# If column exists but named differently, specify here (e.g., "orig.ident", "sample_id")
sample = "Sample"
[LoadingRNAFromSeurat]
[LoadingRNAFromSeurat.in]
infile = ["path/to/sample1.rds"]
[LoadingRNAFromSeurat]
[LoadingRNAFromSeurat.in]
infile = ["data/preprocessed_seurat.rds"]
[LoadingRNAFromSeurat.envs]
# Object already normalized, QC'd, integrated - skip SeuratPreparing
prepared = true
[LoadingRNAFromSeurat]
[LoadingRNAFromSeurat.in]
infile = ["data/clustered_seurat.rds"]
[LoadingRNAFromSeurat.envs]
# Object is fully prepared and clustered
# Skip both SeuratPreparing and SeuratClustering
clustered = true
# 'prepared' automatically set to true when clustered = true
[LoadingRNAFromSeurat]
[LoadingRNAFromSeurat.in]
infile = ["data/seurat_objects/sample1.rds", "data/seurat_objects/sample2.rds"]
[LoadingRNAFromSeurat.envs]
# Seurat object uses "orig.ident" column for sample names
sample = "orig.ident"
[LoadingRNAFromSeurat]
[LoadingRNAFromSeurat.in]
infile = [
"data/sample1.rds",
"data/sample2.rds",
"data/sample3.rds"
]
[LoadingRNAFromSeurat.envs]
# Each object must have the sample column specified
# Objects will be integrated by SeuratPreparing if prepared = false
sample = "Sample"
# Use LoadingRNAFromSeurat for RNA data
[LoadingRNAFromSeurat]
[LoadingRNAFromSeurat.in]
infile = ["data/rna_seurat.rds"]
[LoadingRNAFromSeurat.envs]
prepared = true
# Still use SampleInfo for TCR/BCR data paths
[SampleInfo.in]
infile = ["sample_info.txt"]
# sample_info.txt should contain TCRData/BCRData columns (not RNAData)
[LoadingRNAFromSeurat]
[LoadingRNAFromSeurat.in]
infile = ["data/seurat.rds"]
# SeuratPreparing will run for QC, normalization, integration
# SeuratClustering will run for clustering
[SeuratClustering]
[SeuratClusterStats]
[LoadingRNAFromSeurat]
[LoadingRNAFromSeurat.in]
infile = ["data/prepared_seurat.rds"]
[LoadingRNAFromSeurat.envs]
prepared = true # Skip SeuratPreparing
# Jump directly to clustering and marker analysis
[SeuratClustering]
[ClusterMarkers]
[SeuratClusterStats]
[LoadingRNAFromSeurat]
[LoadingRNAFromSeurat.in]
infile = ["data/final_seurat.rds"]
[LoadingRNAFromSeurat.envs]
clustered = true # Skip SeuratPreparing AND SeuratClustering
# Jump directly to downstream analyses
[CellTypeAnnotation]
[ScFGSEA]
[LoadingRNAFromSeurat]
[LoadingRNAFromSeurat.in]
infile = ["data/rna_seurat.rds"]
[LoadingRNAFromSeurat.envs]
prepared = true
# Still load TCR/BCR data
[ScRepLoading]
# Continue with TCR-specific analyses
[TOrBCellSelection]
[CDR3Clustering]
[ClonalStats]
[LoadingRNAFromSeurat]
[LoadingRNAFromSeurat.in]
infile = [
"data/patient1.rds",
"data/patient2.rds",
"data/patient3.rds"
]
[LoadingRNAFromSeurat.envs]
# Each object has a "patient_id" column for sample identification
sample = "patient_id"
# SeuratPreparing will integrate multiple samples
[SeuratPreparing]
[SeuratClustering]
SampleInfo when TCR/BCR data is present (SampleInfo provides VDJ paths)prepared = false)clustered = false)saveRDS() / readRDS()) or qs/qs2 (qs::qsave() / qs::qread())sample parameter is not "Sample", the specified column must exist in object@meta.datameta.data already contains a "Sample" column and sample = "Sample":sample column doesn't exist:sample column exists with custom name (not "Sample"):clustered = true → automatically sets prepared = true (forced dependency)sample column must exist in Seurat object metadatatrue/false (case-insensitive in TOML)Cause: The specified sample column name doesn't exist in object@meta.data
Solution:
[LoadingRNAFromSeurat.envs]
# Check your Seurat object's metadata:
# colnames(seurat_obj@meta.data)
sample = "actual_column_name" # Use the exact column name
prepared = trueCause: Configuration syntax error or caching issue Solution:
[LoadingRNAFromSeurat] cache = "force"python -m immunopipe.validate_config config.tomlCause: Sample column mapping incorrect or objects don't have the specified column Solution:
[LoadingRNAFromSeurat.in]
infile = ["sample1.rds", "sample2.rds"]
[LoadingRNAFromSeurat.envs]
# Verify each object has this column before running
sample = "orig.ident" # Common alternative to "Sample"
Cause: Unclear how to specify TCR data paths Solution: Use both processes:
[LoadingRNAFromSeurat.in]
infile = ["rna_seurat.rds"]
[SampleInfo.in]
infile = ["sample_info.txt"]
# sample_info.txt only needs TCRData/BCRData columns (not RNAData)
Cause: Trying to create symlink when file exists Solution: This is handled automatically by the script - it removes existing file before creating symlink
Cause: Need additional metadata columns
Solution: Use SeuratPreparing.envs.mutaters to add columns:
[SeuratPreparing.envs]
mutaters = {
"Condition" = "metadata$Condition",
"Batch" = "metadata$Batch"
}
object@meta.dataprepared = true for re-analysis: Skip unnecessary preprocessing when objects are already preparedclustered = true cautiously: Only skip clustering if you're satisfied with existing clusteringpython -m immunopipe.validate_config config.toml before executing pipeline| Feature | SampleInfo | LoadingRNAFromSeurat |
|---|---|---|
| Input format | Raw count matrices (10X, loom) | Pre-processed Seurat objects |
| Data preparation | Always requires SeuratPreparing | Optional (can skip with prepared = true) |
| Metadata source | Sample info text file | Embedded in Seurat object |
| Multi-sample handling | Specified in text file | Multiple input files or single multi-sample object |
| TCR/BCR data support | Provides paths for RNA + VDJ | Only RNA (use SampleInfo for VDJ) |
| Integration | Required step | Depends on prepared setting |
LoadingRNAFromSeurat replaces the standard SampleInfo → SeuratPreparing entry point:
Standard workflow (raw data):
SampleInfo → SeuratPreparing → SeuratClustering → downstream analyses
With LoadingRNAFromSeurat (prepared data):
LoadingRNAFromSeurat → SeuratClustering → downstream analyses
With LoadingRNAFromSeurat (fully processed):
LoadingRNAFromSeurat → downstream analyses (skip SeuratClustering)
With TCR data:
LoadingRNAFromSeurat (RNA) + SampleInfo (VDJ paths) → ScRepLoading → TCR analyses