Code Monkey home page Code Monkey logo

zhanghao-njmu / scp Goto Github PK

View Code? Open in Web Editor NEW
307.0 7.0 65.0 807.35 MB

An end-to-end Single-Cell Pipeline designed to facilitate comprehensive analysis and exploration of single-cell data.

Home Page: https://zhanghao-njmu.github.io/SCP/

License: GNU General Public License v3.0

R 96.79% Python 3.10% C++ 0.11%
single-cell seurat-objects single-cell-analysis single-cell-rna-seq scrna-pipeline scrna-seq scrna-seq-analysis seurat scanpy anndata

scp's Introduction

SCP: Single-Cell Pipeline

version codesize license

SCP provides a comprehensive set of tools for single-cell data processing and downstream analysis.

The package includes the following facilities:

  • Integrated single-cell quality control methods.
  • Pipelines embedded with multiple methods for normalization, feature reduction, and cell population identification (standard Seurat workflow).
  • Pipelines embedded with multiple integration methods for scRNA-seq or scATAC-seq data, including Uncorrected, Seurat, scVI, MNN, fastMNN, Harmony, Scanorama, BBKNN, CSS, LIGER, Conos, ComBat.
  • Multiple single-cell downstream analyses such as identification of differential features, enrichment analysis, GSEA analysis, identification of dynamic features, PAGA, RNA velocity, Palantir, Monocle2, Monocle3, etc.
  • Multiple methods for automatic annotation of single-cell data and methods for projection between single-cell datasets.
  • High-quality data visualization methods.
  • Fast deployment of single-cell data into SCExplorer, a shiny app that provides an interactive visualization interface.

The functions in the SCP package are all developed around the Seurat object and are compatible with other Seurat functions.

R version requirement

  • R >= 4.1.0

Installation in the global R environment

You can install the latest version of SCP from GitHub with:

if (!require("devtools", quietly = TRUE)) {
  install.packages("devtools")
}
devtools::install_github("zhanghao-njmu/SCP")

Create a python environment for SCP

To run functions such as RunPAGA or RunSCVELO, SCP requires conda to create a separate python environment. The default environment name is "SCP_env". You can specify the environment name for SCP by setting options(SCP_env_name="new_name")

Now, you can run PrepareEnv() to create the python environment for SCP. If the conda binary is not found, it will automatically download and install miniconda.

SCP::PrepareEnv()

To force SCP to use a specific conda binary, it is recommended to set reticulate.conda_binary R option:

options(reticulate.conda_binary = "/path/to/conda")
SCP::PrepareEnv()

If the download of miniconda or pip packages is slow, you can specify the miniconda repo and PyPI mirror according to your network region.

SCP::PrepareEnv(
  miniconda_repo = "https://mirrors.bfsu.edu.cn/anaconda/miniconda",
  pip_options = "-i https://pypi.tuna.tsinghua.edu.cn/simple"
)

Available miniconda repositories:

Available PyPI mirrors:

Installation in an isolated R environment using renv

If you do not want to change your current R environment or require reproducibility, you can use the renv package to install SCP into an isolated R environment.

Create an isolated R environment

if (!require("renv", quietly = TRUE)) {
  install.packages("renv")
}
dir.create("~/SCP_env", recursive = TRUE) # It cannot be the home directory "~" !
renv::init(project = "~/SCP_env", bare = TRUE, restart = TRUE)

Option 1: Install SCP from GitHub and create SCP python environment

renv::activate(project = "~/SCP_env")
renv::install("BiocManager")
renv::install("zhanghao-njmu/SCP", repos = BiocManager::repositories())
SCP::PrepareEnv()

Option 2: If SCP is already installed in the global environment, copy SCP from the local library

renv::activate(project = "~/SCP_env")
renv::hydrate("SCP")
SCP::PrepareEnv()

Activate SCP environment first before use

renv::activate(project = "~/SCP_env")

library(SCP)
data("pancreas_sub")
pancreas_sub <- RunPAGA(srt = pancreas_sub, group_by = "SubCellType", linear_reduction = "PCA", nonlinear_reduction = "UMAP")
CellDimPlot(pancreas_sub, group.by = "SubCellType", reduction = "draw_graph_fr")

Save and restore the state of SCP environment

renv::snapshot(project = "~/SCP_env")
renv::restore(project = "~/SCP_env")

Quick Start

Data exploration

The analysis is based on a subsetted version of mouse pancreas data.

library(SCP)
library(BiocParallel)
register(MulticoreParam(workers = 8, progressbar = TRUE))

data("pancreas_sub")
print(pancreas_sub)
#> An object of class Seurat 
#> 47874 features across 1000 samples within 3 assays 
#> Active assay: RNA (15958 features, 3467 variable features)
#>  2 other assays present: spliced, unspliced
#>  2 dimensional reductions calculated: PCA, UMAP
CellDimPlot(
  srt = pancreas_sub, group.by = c("CellType", "SubCellType"),
  reduction = "UMAP", theme_use = "theme_blank"
)

CellDimPlot(
  srt = pancreas_sub, group.by = "SubCellType", stat.by = "Phase",
  reduction = "UMAP", theme_use = "theme_blank"
)

FeatureDimPlot(
  srt = pancreas_sub, features = c("Sox9", "Neurog3", "Fev", "Rbp4"),
  reduction = "UMAP", theme_use = "theme_blank"
)

FeatureDimPlot(
  srt = pancreas_sub, features = c("Ins1", "Gcg", "Sst", "Ghrl"),
  compare_features = TRUE, label = TRUE, label_insitu = TRUE,
  reduction = "UMAP", theme_use = "theme_blank"
)

ht <- GroupHeatmap(
  srt = pancreas_sub,
  features = c(
    "Sox9", "Anxa2", # Ductal
    "Neurog3", "Hes6", # EPs
    "Fev", "Neurod1", # Pre-endocrine
    "Rbp4", "Pyy", # Endocrine
    "Ins1", "Gcg", "Sst", "Ghrl" # Beta, Alpha, Delta, Epsilon
  ),
  group.by = c("CellType", "SubCellType"),
  heatmap_palette = "YlOrRd",
  cell_annotation = c("Phase", "G2M_score", "Cdh2"),
  cell_annotation_palette = c("Dark2", "Paired", "Paired"),
  show_row_names = TRUE, row_names_side = "left",
  add_dot = TRUE, add_reticle = TRUE
)
print(ht$plot)

CellQC

pancreas_sub <- RunCellQC(srt = pancreas_sub)
CellDimPlot(srt = pancreas_sub, group.by = "CellQC", reduction = "UMAP")

CellStatPlot(srt = pancreas_sub, stat.by = "CellQC", group.by = "CellType", label = TRUE)

CellStatPlot(
  srt = pancreas_sub,
  stat.by = c(
    "db_qc", "outlier_qc", "umi_qc", "gene_qc",
    "mito_qc", "ribo_qc", "ribo_mito_ratio_qc", "species_qc"
  ),
  plot_type = "upset", stat_level = "Fail"
)

Standard pipeline

pancreas_sub <- Standard_SCP(srt = pancreas_sub)
CellDimPlot(
  srt = pancreas_sub, group.by = c("CellType", "SubCellType"),
  reduction = "StandardUMAP2D", theme_use = "theme_blank"
)

CellDimPlot3D(srt = pancreas_sub, group.by = "SubCellType")

CellDimPlot3D

FeatureDimPlot3D(srt = pancreas_sub, features = c("Sox9", "Neurog3", "Fev", "Rbp4"))

FeatureDimPlot3D

Integration pipeline

Example data for integration is a subsetted version of panc8(eight human pancreas datasets)

data("panc8_sub")
panc8_sub <- Integration_SCP(srtMerge = panc8_sub, batch = "tech", integration_method = "Seurat")
CellDimPlot(
  srt = panc8_sub, group.by = c("celltype", "tech"), reduction = "SeuratUMAP2D",
  title = "Seurat", theme_use = "theme_blank"
)

UMAP embeddings based on different integration methods in SCP:

Integration-all

Cell projection between single-cell datasets

panc8_rename <- RenameFeatures(
  srt = panc8_sub,
  newnames = make.unique(capitalize(rownames(panc8_sub[["RNA"]]), force_tolower = TRUE)),
  assays = "RNA"
)
srt_query <- RunKNNMap(srt_query = pancreas_sub, srt_ref = panc8_rename, ref_umap = "SeuratUMAP2D")
ProjectionPlot(
  srt_query = srt_query, srt_ref = panc8_rename,
  query_group = "SubCellType", ref_group = "celltype"
)

Cell annotation using bulk RNA-seq datasets

data("ref_scMCA")
pancreas_sub <- RunKNNPredict(srt_query = pancreas_sub, bulk_ref = ref_scMCA, filter_lowfreq = 20)
CellDimPlot(srt = pancreas_sub, group.by = "KNNPredict_classification", reduction = "UMAP", label = TRUE)

Cell annotation using single-cell datasets

pancreas_sub <- RunKNNPredict(
  srt_query = pancreas_sub, srt_ref = panc8_rename,
  ref_group = "celltype", filter_lowfreq = 20
)
CellDimPlot(srt = pancreas_sub, group.by = "KNNPredict_classification", reduction = "UMAP", label = TRUE)

pancreas_sub <- RunKNNPredict(
  srt_query = pancreas_sub, srt_ref = panc8_rename,
  query_group = "SubCellType", ref_group = "celltype",
  return_full_distance_matrix = TRUE
)
CellDimPlot(srt = pancreas_sub, group.by = "KNNPredict_classification", reduction = "UMAP", label = TRUE)

ht <- CellCorHeatmap(
  srt_query = pancreas_sub, srt_ref = panc8_rename,
  query_group = "SubCellType", ref_group = "celltype",
  nlabel = 3, label_by = "row",
  show_row_names = TRUE, show_column_names = TRUE
)
print(ht$plot)

PAGA analysis

pancreas_sub <- RunPAGA(
  srt = pancreas_sub, group_by = "SubCellType",
  linear_reduction = "PCA", nonlinear_reduction = "UMAP"
)
PAGAPlot(srt = pancreas_sub, reduction = "UMAP", label = TRUE, label_insitu = TRUE, label_repel = TRUE)

Velocity analysis

To estimate RNA velocity, you need to have both “spliced” and “unspliced” assays in your Seurat object. You can generate these matrices using velocyto, bustools, or alevin.

pancreas_sub <- RunSCVELO(
  srt = pancreas_sub, group_by = "SubCellType",
  linear_reduction = "PCA", nonlinear_reduction = "UMAP"
)
VelocityPlot(srt = pancreas_sub, reduction = "UMAP", group_by = "SubCellType")

VelocityPlot(srt = pancreas_sub, reduction = "UMAP", plot_type = "stream")

Differential expression analysis

pancreas_sub <- RunDEtest(srt = pancreas_sub, group_by = "CellType", fc.threshold = 1, only.pos = FALSE)
VolcanoPlot(srt = pancreas_sub, group_by = "CellType")

DEGs <- pancreas_sub@tools$DEtest_CellType$AllMarkers_wilcox
DEGs <- DEGs[with(DEGs, avg_log2FC > 1 & p_val_adj < 0.05), ]
# Annotate features with transcription factors and surface proteins
pancreas_sub <- AnnotateFeatures(pancreas_sub, species = "Mus_musculus", db = c("TF", "CSPA"))
ht <- FeatureHeatmap(
  srt = pancreas_sub, group.by = "CellType", features = DEGs$gene, feature_split = DEGs$group1,
  species = "Mus_musculus", db = c("GO_BP", "KEGG", "WikiPathway"), anno_terms = TRUE,
  feature_annotation = c("TF", "CSPA"), feature_annotation_palcolor = list(c("gold", "steelblue"), c("forestgreen")),
  height = 5, width = 4
)
print(ht$plot)

Enrichment analysis(over-representation)

pancreas_sub <- RunEnrichment(
  srt = pancreas_sub, group_by = "CellType", db = "GO_BP", species = "Mus_musculus",
  DE_threshold = "avg_log2FC > log2(1.5) & p_val_adj < 0.05"
)
EnrichmentPlot(
  srt = pancreas_sub, group_by = "CellType", group_use = c("Ductal", "Endocrine"),
  plot_type = "bar"
)

EnrichmentPlot(
  srt = pancreas_sub, group_by = "CellType", group_use = c("Ductal", "Endocrine"),
  plot_type = "wordcloud"
)

EnrichmentPlot(
  srt = pancreas_sub, group_by = "CellType", group_use = c("Ductal", "Endocrine"),
  plot_type = "wordcloud", word_type = "feature"
)

EnrichmentPlot(
  srt = pancreas_sub, group_by = "CellType", group_use = "Ductal",
  plot_type = "network"
)

To ensure that labels are visible, you can adjust the size of the viewer panel on Rstudio IDE.

EnrichmentPlot(
  srt = pancreas_sub, group_by = "CellType", group_use = "Ductal",
  plot_type = "enrichmap"
)

EnrichmentPlot(srt = pancreas_sub, group_by = "CellType", plot_type = "comparison")

Enrichment analysis(GSEA)

pancreas_sub <- RunGSEA(
  srt = pancreas_sub, group_by = "CellType", db = "GO_BP", species = "Mus_musculus",
  DE_threshold = "p_val_adj < 0.05"
)
GSEAPlot(srt = pancreas_sub, group_by = "CellType", group_use = "Endocrine", id_use = "GO:0007186")

GSEAPlot(
  srt = pancreas_sub, group_by = "CellType", group_use = "Endocrine", plot_type = "bar",
  direction = "both", topTerm = 20
)

GSEAPlot(srt = pancreas_sub, group_by = "CellType", plot_type = "comparison")

Trajectory inference

pancreas_sub <- RunSlingshot(srt = pancreas_sub, group.by = "SubCellType", reduction = "UMAP")

FeatureDimPlot(pancreas_sub, features = paste0("Lineage", 1:3), reduction = "UMAP", theme_use = "theme_blank")

CellDimPlot(pancreas_sub, group.by = "SubCellType", reduction = "UMAP", lineages = paste0("Lineage", 1:3), lineages_span = 0.1)

Dynamic features

pancreas_sub <- RunDynamicFeatures(srt = pancreas_sub, lineages = c("Lineage1", "Lineage2"), n_candidates = 200)
ht <- DynamicHeatmap(
  srt = pancreas_sub, lineages = c("Lineage1", "Lineage2"),
  use_fitted = TRUE, n_split = 6, reverse_ht = "Lineage1",
  species = "Mus_musculus", db = "GO_BP", anno_terms = TRUE, anno_keys = TRUE, anno_features = TRUE,
  heatmap_palette = "viridis", cell_annotation = "SubCellType",
  separate_annotation = list("SubCellType", c("Nnat", "Irx1")), separate_annotation_palette = c("Paired", "Set1"),
  feature_annotation = c("TF", "CSPA"), feature_annotation_palcolor = list(c("gold", "steelblue"), c("forestgreen")),
  pseudotime_label = 25, pseudotime_label_color = "red",
  height = 5, width = 2
)
print(ht$plot)

DynamicPlot(
  srt = pancreas_sub, lineages = c("Lineage1", "Lineage2"), group.by = "SubCellType",
  features = c("Plk1", "Hes1", "Neurod2", "Ghrl", "Gcg", "Ins2"),
  compare_lineages = TRUE, compare_features = FALSE
)

FeatureStatPlot(
  srt = pancreas_sub, group.by = "SubCellType", bg.by = "CellType",
  stat.by = c("Sox9", "Neurod2", "Isl1", "Rbp4"), add_box = TRUE,
  comparisons = list(
    c("Ductal", "Ngn3 low EP"),
    c("Ngn3 high EP", "Pre-endocrine"),
    c("Alpha", "Beta")
  )
)

Interactive data visualization with SCExplorer

PrepareSCExplorer(list(mouse_pancreas = pancreas_sub, human_pancreas = panc8_sub), base_dir = "./SCExplorer")
app <- RunSCExplorer(base_dir = "./SCExplorer")
list.files("./SCExplorer") # This directory can be used as site directory for Shiny Server.

if (interactive()) {
  shiny::runApp(app)
}

SCExplorer1 SCExplorer2

Other visualization examples

CellDimPlotExample1 CellStatPlotExample2 FeatureStatPlotExample3 GroupHeatmapExample3

You can also find more examples in the documentation of the function: Integration_SCP, RunKNNMap, RunMonocle3, RunPalantir, etc.

scp's People

Contributors

zhanghao-njmu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

scp's Issues

Velocity analysis

Hi,

When I run Velocity analysis with the pancreas_sub data,

pancreas_sub <- RunSCVELO(
  srt = pancreas_sub, group_by = "SubCellType",
  linear_reduction = "PCA", nonlinear_reduction = "UMAP"
)
VelocityPlot(srt = pancreas_sub, reduction = "UMAP", group_by = "SubCellType")

It reports an error:

'misc' slot is not converted.

'tools' slot is not converted.

Error in py_call_impl(callable, dots$args, dots$keywords): NotImplementedError: Cannot 

Traceback:

1. RunSCVELO(srt = pancreas_sub, group_by = "SubCellType", linear_reduction = "PCA", 
 .     nonlinear_reduction = "UMAP")
2. do.call(SCP_analysis$SCVELO, args)
3. (structure(function (...) 
 . {
 .     dots <- py_resolve_dots(list(...))
 .     result <- py_call_impl(callable, dots$args, dots$keywords)
 .     if (convert) 
 .         result <- py_to_r(result)
 .     if (is.null(result)) 
 .         invisible(result)
 .     else result
 . }, class = c("python.builtin.function", "python.builtin.object"
 . ), py_object = <environment>))(adata = <environment>, h5ad = NULL, 
 .     group_by = "SubCellType", n_jobs = 1L, linear_reduction = "PCA", 
 .     nonlinear_reduction = "UMAP", basis = NULL, mode = "stochastic", 
 .     fitting_by = "stochastic", magic_impute = FALSE, knn = 5L, 
 .     t = 2L, min_shared_counts = 30L, n_pcs = 30L, n_neighbors = 30L, 
 .     approx = TRUE, stream_smooth = NULL, stream_density = 2L, 
 .     arrow_length = 5L, arrow_size = 5L, arrow_density = 0.5, 
 .     denoise = FALSE, denoise_topn = 3L, kinetics = FALSE, kinetics_topn = 100L, 
 .     calculate_velocity_genes = FALSE, show_plot = TRUE, dpi = 300L, 
 .     save = FALSE, dirpath = "./", fileprefix = "")
4. py_call_impl(callable, dots$args, dots$keywords)


RunSCVELO error

I used the latest version of SCP(v0.3.0), error still occurred:

image

Failed to install package

Hi,

I tried to install this beautiful package,but failed how can i fix it? My R version is 4.2.1 64bit

Thank you very much

image

Error: package or namespace load failed for 'SCP' in inDL(x, as.logical(local), as.logical(now), ...):
unable to load shared object 'C:/Program Files/R/R-4.2.1/library/00LOCK-SCP-main/00new/SCP/libs/x64/SCP.dll':
LoadLibrary failure: %1 不是有效的 Win32 应用程序。

Problems in using FeatureHeatmap

When I use the function 'FeatureHeatmap',always failed to connect the dataset (hsapiens_gene_ensembl).Are there anyway to access this dataset locally?Or anyway to connect thee dataset.I recommened some of my friends this package,we all meet the same problem :-(
ht <- FeatureHeatmap(
srt = epi_sub, group.by = "sample.orig", features = DEGs$gene, feature_split = DEGs$group1,
species = "Homo_sapiens", db = c("GO_BP", "KEGG", "WikiPathway"), anno_terms = TRUE,
feature_annotation = c("TF", "SP"), feature_annotation_palcolor = list(c("gold", "steelblue"), c("forestgreen")),
height = 5, width = 4
)
Error in curl::curl_fetch_memory(url, handle = handle) :
Timeout was reached: [feb2021.archive.ensembl.org:443] Operation timed out after 10006 milliseconds with 77102 bytes received

Error on `adata_to_srt` function

Hi,

Thanks for the nice tool. I am trying to convert an anndata object to a seurat object. The ANN file Processed_data_ATAC_processed-count-data.h5ad was downloaded from https://console.cloud.google.com/storage/browser/neuro-dev/Processed_data;tab=objects?pli=1&prefix=&forceOnObjectsSortingFiltering=false

sc <- import("scanpy")

adata <- sc$read_h5ad("Processed_data_ATAC_processed-count-data.h5ad")

It gave me

Error in validObject(.Object) : 
  invalid class “DimReduc” object: invalid object for slot "cell.embeddings" in class "DimReduc": got class "data.frame", should be or extend class "matrix"

Do you have any clue on this error?

Thanks,

BiocParallel errors

Hi @zhanghao-njmu

This may be limited to my system but I have been trying to run the example using the pancreas_sub dataset. Everything works fine until RunEnrichment, RunGSEA, and RunDynamicFeatures which return BiocParallel errors.

The issue occurs on my Macbook with M1 chip. I have tried it with iMACs with M1 and Intel chips and it works fine on both. Do you have an idea of what is going on and how to fix it? Thanks.

Below are the codes and errors.

pancreas_sub <- RunEnrichment( srt = pancreas_sub, group_by = "CellType", db = "GO_BP", species = "Mus_musculus", DE_threshold = "avg_log2FC > 1 & p_val_adj < 0.05" )

``

[2023-02-23 00:53:38] Start Enrichment
Threads used: 8
Species: Mus_musculus
Loaded cached db: GO_BP version:3.16.0 nterm:15992 created:2023-02-20 17:06:24
Permform enrichment...
|=================================================================================| 100%

Error: BiocParallel errors
5 remote errors, element index: 1, 2, 3, 4, 5
0 unevaluated and other errors
first remote error:
Error: Operation not permitted

pancreas_sub <- RunGSEA(srt = pancreas_sub, group_by = "CellType", db = "GO_BP", species = "Mus_musculus", DE_threshold = "p_val_adj < 0.05" )

[2023-02-23 01:11:56] Start GSEA
Threads used: 8
Species: Mus_musculus
Loaded cached db: GO_BP version:3.16.0 nterm:15992 created:2023-02-20 17:06:24
Permform GSEA...
|=====================================================================================| 100%

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

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

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

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

Error: BiocParallel errors
5 remote errors, element index: 1, 2, 3, 4, 5
0 unevaluated and other errors
first remote error:
Error: Operation not permitted

pancreas_sub <- RunDynamicFeatures(srt = pancreas_sub, lineages = c("Lineage1", "Lineage2"), n_candidates = 200)

[2023-02-23 01:15:52] Start RunDynamicFeatures
Threads used: 8
Calculating gene variances
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Number of candidate features(union): 225
Calculate dynamic features for Lineage1...
|=== | 3%Stop worker failed with the error: wrong args for environment subassignment

Error: BiocParallel errors
5 remote errors, element index: 1, 2, 3, 4, 5
219 unevaluated and other errors
first remote error:
Error: Operation not permitted
Timing stopped at: 35.83 8.872 0.673

How many database can we chose in function 'FeatureHeatmap(db = )'

I want to use this command to finifsh function enrichment,using hallmark dataset,but whatever I write ,always report an error.
I tried h/H/hallmark,always report thee error.

  •    ht2 <- FeatureHeatmap(srt = scrun,features = de_g$gene,feature_split = de_g$group1,group.by = 'RNA_snn_res.1.1',
                     species = 'Homo_sapiens',db = 'HallMark',anno_terms = TRUE,anno_keys = T,mirror = 'asia',use_raster = F)
    

[2023-09-01 01:16:08] Start Enrichment
Workers: 125
Species: Homo_sapiens
Permform enrichment...
|=====================================================================================================| 100%

Error: BiocParallel errors
26 remote errors, element index: 1, 2, 3, 4, 5, 6, ...
0 unevaluated and other errors
first remote error:
Error in base::rowSums(x, na.rm = na.rm, dims = dims, ...): 'x' must be an array of at least two dimensions

Question related with package

Hi,

Thank you for such a fantastic tool.

While using the package, I had a few questions in mind.

  • Can we use other databases such as HALLMARK, Reactome, and Kegg apart from GO_DB used in the ExpHeatMap function? Or does the package only support the Gene Ontology database? If so, would you like to add it in future updates?

  • We noticed that the package does not receive a rank file during enrichment. As I understand it, we are using the subset of the genes resulting from the RunDETest function. Shouldn't all genes be included in analyzes like pathway analysis?

Best,
Enes

Package or namespace load failed for ‘SCP’

Hello Hao,

I am experiencing an issue while trying to load the package. The error message I'm receiving is as follows:

Error: package or namespace load failed for ‘SCP’:
 object ‘LayerData<-’ is not exported by 'namespace:SeuratObject'

I attempted to troubleshoot this issue from the Seurat/SeuratObject end but I haven't been successful yet. Any assistance you could provide would be greatly appreciated!

To help reproduce the issue, here is my session info:

R version 4.2.2 (2022-10-31)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Monterey 12.6.5

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
 [1] slingshot_2.6.0             TrajectoryUtils_1.6.0       SingleCellExperiment_1.20.1 SummarizedExperiment_1.28.0
 [5] Biobase_2.58.0              GenomicRanges_1.50.2        GenomeInfoDb_1.34.9         IRanges_2.32.0             
 [9] S4Vectors_0.36.2            BiocGenerics_0.44.0         MatrixGenerics_1.10.0       matrixStats_1.0.0          
[13] princurve_2.1.6             ggthemes_4.2.4              RColorBrewer_1.1-3          patchwork_1.1.2            
[17] lubridate_1.9.2             forcats_1.0.0               stringr_1.5.0               dplyr_1.1.2                
[21] purrr_1.0.1                 readr_2.1.4                 tidyr_1.3.0                 tibble_3.2.1               
[25] ggplot2_3.4.2               tidyverse_2.0.0             SCpubr_1.1.2.9000           harmony_0.1.1              
[29] Rcpp_1.0.11                 data.table_1.14.8           SeuratObject_4.1.3          Seurat_4.3.0               
[33] CytoTRACE_0.3.3            

loaded via a namespace (and not attached):
  [1] scattermore_1.1           R.methodsS3_1.8.2         ragg_1.2.5                bit64_4.0.5              
  [5] irlba_2.3.5.1             DelayedArray_0.24.0       R.utils_2.12.2            KEGGREST_1.38.0          
  [9] RCurl_1.98-1.12           doParallel_1.0.17         generics_0.1.3            callr_3.7.3              
 [13] cowplot_1.1.1             usethis_2.1.6             RSQLite_2.3.1             RANN_2.6.1               
 [17] future_1.32.0             bit_4.0.5                 tzdb_0.4.0                HiClimR_2.2.1            
 [21] spatstat.data_3.0-1       httpuv_1.6.11             hms_1.1.3                 promises_1.2.0.1         
 [25] DEoptimR_1.1-0            fansi_1.0.4               igraph_1.5.0              DBI_1.1.3                
 [29] htmlwidgets_1.6.2         spacexr_2.2.1             spatstat.geom_3.2-1       ellipsis_0.3.2           
 [33] annotate_1.76.0           sparseMatrixStats_1.10.0  deldir_1.0-9              vctrs_0.6.3              
 [37] remotes_2.4.2             here_1.0.1                ROCR_1.0-11               abind_1.4-5              
 [41] cachem_1.0.8              withr_2.5.0               robustbase_0.99-0         progressr_0.13.0         
 [45] sctransform_0.3.5         prettyunits_1.1.1         goftest_1.2-3             cluster_2.1.4            
 [49] lazyeval_0.2.2            crayon_1.5.2              genefilter_1.80.3         spatstat.explore_3.2-1   
 [53] edgeR_3.40.2              pkgconfig_2.0.3           labeling_0.4.2            nlme_3.1-162             
 [57] pkgload_1.3.2.1           devtools_2.4.5            rlang_1.1.1               globals_0.16.2           
 [61] lifecycle_1.0.3           miniUI_0.1.1.1            rsvd_1.0.5                rprojroot_2.0.3          
 [65] polyclip_1.10-4           lmtest_0.9-40             Matrix_1.5-4              zoo_1.8-12               
 [69] ggridges_0.5.4            GlobalOptions_0.1.2       processx_3.8.2            png_0.1-8                
 [73] viridisLite_0.4.2         rjson_0.2.21              bitops_1.0-7              R.oo_1.25.0              
 [77] KernSmooth_2.23-21        Biostrings_2.66.0         DelayedMatrixStats_1.20.0 blob_1.2.4               
 [81] shape_1.4.6               parallelly_1.36.0         spatstat.random_3.1-5     R.cache_0.16.0           
 [85] scales_1.2.1              memoise_2.0.1             magrittr_2.0.3            plyr_1.8.8               
 [89] ica_1.0-3                 zlibbioc_1.44.0           compiler_4.2.2            clue_0.3-64              
 [93] fitdistrplus_1.1-11       Rsamtools_2.14.0          cli_3.6.1                 XVector_0.38.0           
 [97] urlchecker_1.0.1          SeuratWrappers_0.3.1      listenv_0.9.0             pbapply_1.7-0            
[101] ps_1.7.5                  MASS_7.3-60               mgcv_1.8-42               tidyselect_1.2.0         
[105] stringi_1.7.12            textshaping_0.3.6         locfit_1.5-9.7            ggrepel_0.9.3            
[109] grid_4.2.2                tools_4.2.2               timechange_0.2.0          future.apply_1.11.0      
[113] parallel_4.2.2            circlize_0.4.15           rstudioapi_0.14           ccaPP_0.3.3              
[117] foreach_1.5.2             gridExtra_2.3             farver_2.1.1              Rtsne_0.16               
[121] digest_0.6.33             BiocManager_1.30.20       shiny_1.7.4.1             later_1.3.1              
[125] RcppAnnoy_0.0.20          ncdf4_1.21                httr_1.4.6                AnnotationDbi_1.60.2     
[129] ComplexHeatmap_2.15.4     colorspace_2.1-0          XML_3.99-0.14             fs_1.6.2                 
[133] tensor_1.5                reticulate_1.30           splines_4.2.2             uwot_0.1.14              
[137] RcppRoll_0.3.0            spatstat.utils_3.0-3      sp_1.6-1                  plotly_4.10.2            
[141] sessioninfo_1.2.2         systemfonts_1.0.4         xtable_1.8-4              jsonlite_1.8.7           
[145] R6_2.5.1                  profvis_0.3.8             pillar_1.9.0              htmltools_0.5.5          
[149] mime_0.12                 nnls_1.4                  glue_1.6.2                fastmap_1.1.1            
[153] BiocParallel_1.32.6       codetools_0.2-19          pkgbuild_1.4.0            pcaPP_2.0-3              
[157] mvtnorm_1.2-2             utf8_1.2.3                lattice_0.21-8            spatstat.sparse_3.0-1    
[161] sva_3.46.0                curl_5.0.1                leiden_0.4.3              survival_3.5-5           
[165] limma_3.54.2              munsell_0.5.0             GetoptLong_1.0.5          GenomeInfoDbData_1.2.9   
[169] iterators_1.0.14          reshape2_1.4.4            gtable_0.3.3 

Also I have the following versions of the "SCP", "Seurat" and "SeuratObject" packages installed:

> packageVersion("SCP")
[1] ‘0.4.7.9000’
> packageVersion("Seurat")
[1] ‘4.3.0’
> packageVersion("SeuratObject")
[1] ‘4.1.3’

Thank you in advance for any help!

Error installing and compiling

Hi,

Thank you for creating this very promising resource! I would love to be able to use and test the package. I keep running into the error below when I install SCP per the documentation instructions using:

if (!require("devtools", quietly = TRUE)) {
install.packages("devtools")
}
devtools::install_github("zhanghao-njmu/SCP")

I tried installing scmap using bioconductor but the error persisted. Any idea or recommendation that might be causing this?

ERROR: dependency ‘scmap’ is not available for package ‘SCP’

  • removing ‘/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/SCP’
    Warning messages:
    1: In i.p(...) : installation of package ‘scmap’ had non-zero exit status
    2: In i.p(...) :
    installation of package ‘/var/folders/y5/6jm834dx4l1ddxtcsnjyrf2r0000gp/T//Rtmp72LD66/filee033c8d1512/SCP_0.2.0.tar.gz’ had non-zero exit status

could not find function "PrepareVirtualEnv"

This is really great pakage thank you @zhanghao-njmu . Howevere I am unable to run PrepareVirtualEnv commend. .

PrepareVirtualEnv(python = py, pipy_mirror = "https://pypi.tuna.tsinghua.edu.cn/simple", remove_old = TRUE)
Error in PrepareVirtualEnv(python = py, pipy_mirror = "https://pypi.tuna.tsinghua.edu.cn/simple",  : 
  could not find function "PrepareVirtualEnv"

I belove this is due to above issue am i right ?
Error: object 'ExpHeatmapPlot' not found

Could you advise me how can i fix this?

Few questions/issues with SCP

Hoping to get your help on few issues in SCP:

  1. Can pathway enrichment be done for other than GO_BP? Seems GO_Bp is only option and couldn't find in description if other pathways can be tested

  2. When running “pancreas_sub <- RunCellQC(srt = pancreas_sub)  this results in list of cells that “failed” versus those that passed. Does the new Seurat object contain only those that passed the QC? Or do we have to add additional step to subset?

  3. ExpHeatmap function:
    a. Issues with figure dimensions and outputting as png in good size. Tried different settings but the proportions are always way off.
    b. How to choose a db other than GO_BP
    c. I don’t think its showing all the cells as columns. We hav 24,000 in the object but the output seems to show much less.

  4. RunGSEA: does this function take only the differentially genes? Or the whole ranked list (i.e. any gene detected with any p value?))

  5. RunEnrichment: is GO_BP the only database?

  6. DynamicHeatmap:
    Error in DynamicHeatmap(srt = del7, lineages = c("Lineage1", "Lineage2"), :
    No dynamic features found in the meta.data or in the assay: RNA

However, my object has Lineage1 and lineage2 and I had already run the slingshot and RunDynamicFeatures without error. I get 2 lineages

Thanks much!

Question relative to zscore

Hi,
I have a question about zscore in the GroupHeatmap.
Are the zscore compute for each gene, so i can compare the expression of one gene across all my group ? Or compute for each group so i compare the expression of multiple genes in one group ?

Thanks

Citation

Hi developer,
We wish to cite this method for using some of its functions in our analysis. Is there a link for it? Thanks
Best wishes,
Max

错误: “ident”类别里包含的子类别("character")不对;类别定义从‘dbplyr’中被删除

library(SCP)
Error in completeSubclasses(classDef2, class1, obj, where) :
trying to get slot "subclasses" from an object of a basic class ("NULL") with no slots
Error: package or namespace load failed for ‘SCP’:
loadNamespace()里算'dbplyr'时.onLoad失败了,详细内容:
调用: setClass(cl, contains = c(prevClass, "VIRTUAL"), where = where)
错误: “ident”类别里包含的子类别("character")不对;类别定义从‘dbplyr’中被删除

The problem of installation

I have installed the SCP packages in R and created the SCP python environment following the instructions on Github. But in Rstuio, some packages were not installed successfully. So I installed them manually. But it doesn't work. How can I solve this problem? Thanks.

image

pip list in SCP_env
Package Version
------------------- ---------`
anndata 0.9.1
annoy 1.17.3
backports.zoneinfo 0.2.1
blosc2 2.0.0
click 8.1.5
cmake 3.26.4
contourpy 1.1.0
cycler 0.11.0
Cython 0.29.36
fcsparser 0.2.4
fonttools 4.41.0
future 0.18.3
h5py 3.9.0
igraph 0.10.2
imageio 2.31.1
importlib-metadata 6.8.0
importlib-resources 6.0.0
jax 0.4.13
jaxlib 0.4.13
jaxopt 0.7
joblib 1.3.1
kiwisolver 1.4.4
lazy_loader 0.3
leidenalg 0.10.0
llvmlite 0.38.1
loompy 3.0.7
matplotlib 3.6.3
mellon 1.3.1
ml-dtypes 0.2.0
msgpack 1.0.5
natsort 8.4.0
ndindex 1.7
networkx 3.1
numba 0.55.2
numexpr 2.8.4
numpy 1.21.6
numpy-groupies 0.9.22
opt-einsum 3.3.0
packaging 23.1
palantir 1.3.0
pandas 1.3.5
patsy 0.5.3
Pillow 10.0.0
pip 23.1.2
progressbar2 4.2.0
py-cpuinfo 9.0.0
pygam 0.8.0
pynndescent 0.5.10
pyparsing 3.1.0
python-dateutil 2.8.2
python-igraph 0.10.2
python-utils 3.7.0
pytz 2023.3
PyWavelets 1.4.1
scanpy 1.9.3
scikit-image 0.21.0
scikit-learn 1.1.2
scipy 1.10.1
scrublet 0.2.3
scvelo 0.2.5
seaborn 0.12.2
session-info 1.0.0
setuptools 68.0.0
six 1.16.0
statsmodels 0.14.0
stdlib-list 0.9.0
tables 3.8.0
texttable 1.6.7
threadpoolctl 3.2.0
tifffile 2023.7.10
tqdm 4.65.0
typing_extensions 4.7.1
tzdata 2023.3
tzlocal 5.0.1
umap-learn 0.5.3
versioned-hdf5 1.3.13
wheel 0.38.4
zipp 3.16.1

adata_to_srt Error

Hi ! I did

library(SCP)
data("pancreas_sub")
print(pancreas_sub)
library(parallel)
SCP::PrepareEnv(python_version = 3.9)
pancreas_sub <- RunSCVELO(
  srt = pancreas_sub, group_by = "SubCellType",
  linear_reduction = "PCA", nonlinear_reduction = "UMAP", n_jobs = detectCores(), return_seurat = T
)

adata_to_srt(pancreas_sub)

and I got

Error in validObject(.Object) : 
  invalid class “dgCMatrix” object: 'Dim' slot does not have length 2
Capture d’écran 2023-07-19 à 15 17 58

Can you fix it's please ?

thanks a lot

Install error 'OPENSSL_3.0.0' not found

Hi,

Thanks for open sourcing this code. I would love to be able to use the codes.

While I installed the packages,
'''
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/anaconda3/envs/R4.2/lib/R/library/HDF5Array/libs/HDF5Array.so':
/anaconda3/envs/R4.2/lib/R/library/rhdf5/libs/../../../../libcrypto.so.1.1: version `OPENSSL_3.0.0' not found (required by /anaconda3/envs/R4.2/lib/R/library/HDF5Array/libs/HDF5Array.so)

Calls: ... asNamespace -> loadNamespace -> library.dynam -> dyn.load
Execution halted
'''
I found my envs has OPENSSL_1.0.0 installed.
May I ask which version of R you tested this under ?

Resolving 'subscript out of bounds' Error in PAGA Analysis

Hello there,
I encountered an error while running PAGA analysis:

######PAGA analysis#######
pancreas_sub <- RunPAGA(
srt = scRNA, group_by = "celltype",
linear_reduction = "PCA", nonlinear_reduction = "UMAP"
)
Error in (function (cond) :
error in evaluating the argument 'x' in selecting a method for function 't': subscript out of bounds

How should I solve this error?
Thank you very much for your reply.

RunDEtest Error

Hi I am getting the following error, please help to fix it

DIS_sub <- RunDEtest(srt = DIS_n, group_by = "Cell_Type", fc.threshold = 1, only.pos = FALSE)
[2023-08-20 16:44:07] Start DEtest
Workers: 14
Error:
! The slot argument of Assays() was deprecated in SeuratObject 5.0.0 and is now defunct.
ℹ Please use LayerData() instead.

Error in devtools::install_local('SCP-main.zip'):Error: package or namespace load failed for 'SCP' in inDL(x, as.logical(local), as.logical(now), ...): unable to load shared object 'D:/R-4.2.2/library/00LOCK-SCP-main/00new/SCP/libs/x64/SCP.dll': LoadLibrary failure: %1 不是有效的 Win32 应用程序。

devtools::install_local('SCP-main.zip')
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?

1: All
2: CRAN packages only
3: None
4: ggtree (3.4.0 -> b51cece3b...) [GitHub]

Enter one or more numbers, or an empty line to skip updates: 4
ggtree (3.4.0 -> b51cece3b...) [GitHub]
Downloading GitHub repo YuLab-SMU/ggtree@HEAD
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?

1: All
2: CRAN packages only
3: None
4: treeio (1.22.0 -> a83c6c146...) [GitHub]

Enter one or more numbers, or an empty line to skip updates: 4
treeio (1.22.0 -> a83c6c146...) [GitHub]
Downloading GitHub repo GuangchuangYu/treeio@HEAD

  • installing source package 'treeio' ...
    ** using staged installation
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    ** help
    *** installing help indices
    *** copying figures
    ** building package indices
    ** installing vignettes
    ** testing if installed package can be loaded from temporary location
    ** testing if installed package can be loaded from final location
    ** testing if installed package keeps a record of temporary installation path
  • DONE (treeio)
  • installing source package 'ggtree' ...
    ** using staged installation
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    ** help
    *** installing help indices
    ** building package indices
    ** installing vignettes
    ** testing if installed package can be loaded from temporary location
    ** testing if installed package can be loaded from final location
    ** testing if installed package keeps a record of temporary installation path
  • DONE (ggtree)
  • installing source package 'SCP' ...
    ** using staged installation
    ** libs
    g++ -std=gnu++11 -shared -s -static-libgcc -o SCP.dll tmp.def RcppExports.o asMatrix.o -LD:/rtools42/x86_64-w64-mingw32.static.posix/lib/x64 -LD:/rtools42/x86_64-w64-mingw32.static.posix/lib -LD:/R-4.2.2/bin/x64 -lR
    collect2.exe: error: ld returned 5 exit status
    installing to D:/R-4.2.2/library/00LOCK-SCP-main/00new/SCP/libs/x64
    ** R
    ** data
    *** moving datasets to lazyload DB
    ** inst
    ** byte-compile and prepare package for lazy loading
    ** help
    *** installing help indices
    ** building package indices
    ** testing if installed package can be loaded from temporary location
    Error: package or namespace load failed for 'SCP' in inDL(x, as.logical(local), as.logical(now), ...):
    unable to load shared object 'D:/R-4.2.2/library/00LOCK-SCP-main/00new/SCP/libs/x64/SCP.dll':
    LoadLibrary failure: %1 不是有效的 Win32 应用程序。

ValueError: Did not find PCA in `.obsm.keys()

Hi there,
Thanks for the great pipeline!

I encountered this error when I try to run RunSCVELO. Here is error message

Warning: sparse->dense coercion: allocating vector of size 1.1 GiBAssay 'integrated' is in the srt object but not converted.
Assay 'ambiguous' is in the srt object but not converted.
'misc' slot is not converted.
'tools' slot is not converted.
posx and posy should be finite values
posx and posy should be finite values
posx and posy should be finite values
posx and posy should be finite values
Filtered out 13400 genes that are detected 30 counts (shared).
Normalized count data: X, spliced, unspliced.
WARNING: Did not modify X as it looks preprocessed already.
computing neighbors
Error: ValueError: Did not find PCA in `.obsm.keys()`. You need to compute it first.

I have tried to re-run Standard_SCP or RunPCA, but neither works.

Thanks in advance for the help!

Minjie

BiocParallel errors while running RunDynamicFeatures

I am facing BiocParallel errors while running RunDynamicFeatures. I am using ubuntu HPC server. Do you have any clue why is it happening? Thanks
cortex <- RunDynamicFeatures(srt = cortex, lineages = c("Lineage3", "Lineage7"), n_candidates = 200)

Calculating gene variances
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Number of candidate features(union): 228
Calculate dynamic features for Lineage3...
|====================================================================================================================| 100%

Calculate dynamic features for Lineage7...
|========================================================================================================= | 91%Stop worker failed with the error: reached CPU time limit

Error: BiocParallel errors
4 remote errors, element index: 66, 77, 82, 88
26 unevaluated and other errors
first remote error:
Error in eigen(crossprod(Rm %*% B)/b$sig2, symmetric = TRUE, only.values = TRUE): infinite or missing values in 'x'
Timing stopped at: 455.2 2414 47.66

sessionInfo()
R version 4.2.0 (2022-04-22)
Platform: x86_64-conda-linux-gnu (64-bit)
Running under: Ubuntu 22.04.2 LTS

Matrix products: default
BLAS/LAPACK: /home/basu/miniconda3/envs/env_R/lib/libopenblasp-r0.3.21.so

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8
[6] LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

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

other attached packages:
[1] SCP_0.4.2 lubridate_1.9.2 forcats_1.0.0 stringr_1.5.0 dplyr_1.1.0 purrr_1.0.1 readr_2.1.4
[8] tidyr_1.3.0 tibble_3.2.0 ggplot2_3.4.1 tidyverse_2.0.0 SeuratObject_4.1.3 Seurat_4.3.0

loaded via a namespace (and not attached):
[1] utf8_1.2.3 spatstat.explore_3.1-0 reticulate_1.28 R.utils_2.12.2
[5] tidyselect_1.2.0 RSQLite_2.3.0 AnnotationDbi_1.60.1 htmlwidgets_1.6.1
[9] grid_4.2.0 BiocParallel_1.32.5 Rtsne_0.16 scatterpie_0.1.8
[13] munsell_0.5.0 codetools_0.2-18 ica_1.0-3 future_1.32.0
[17] miniUI_0.1.1.1 withr_2.5.0 spatstat.random_3.1-4 colorspace_2.1-0
[21] GOSemSim_2.24.0 progressr_0.13.0 Biobase_2.58.0 filelock_1.0.2
[25] rstudioapi_0.14 SingleCellExperiment_1.20.0 stats4_4.2.0 ROCR_1.0-11
[29] tensor_1.5 DOSE_3.24.2 listenv_0.9.0 MatrixGenerics_1.10.0
[33] GenomeInfoDbData_1.2.9 polyclip_1.10-4 farver_2.1.1 bit64_4.0.5
[37] rprojroot_2.0.3 downloader_0.4 treeio_1.23.1 parallelly_1.34.0
[41] vctrs_0.5.2 generics_0.1.3 gson_0.1.0 timechange_0.2.0
[45] BiocFileCache_2.6.1 R6_2.5.1 doParallel_1.0.17 GenomeInfoDb_1.34.9
[49] graphlayouts_0.8.4 clue_0.3-64 DelayedArray_0.24.0 gridGraphics_0.5-1
[53] fgsea_1.24.0 bitops_1.0-7 spatstat.utils_3.0-2 cachem_1.0.7
[57] promises_1.2.0.1 scales_1.2.1 ggraph_2.1.0 enrichplot_1.18.3
[61] gtable_0.3.1 globals_0.16.2 goftest_1.2-3 tidygraph_1.2.3
[65] rlang_1.0.6 RcppRoll_0.3.0 GlobalOptions_0.1.2 splines_4.2.0
[69] lazyeval_0.2.2 princurve_2.1.6 spatstat.geom_3.1-0 reshape2_1.4.4
[73] abind_1.4-5 httpuv_1.6.9 qvalue_2.30.0 clusterProfiler_4.6.2
[77] tools_4.2.0 ggplotify_0.1.0 ellipsis_0.3.2 RColorBrewer_1.1-3
[81] BiocGenerics_0.44.0 ggridges_0.5.4 Rcpp_1.0.10 plyr_1.8.8
[85] progress_1.2.2 zlibbioc_1.44.0 RCurl_1.98-1.10 TrajectoryUtils_1.6.0
[89] prettyunits_1.1.1 deldir_1.0-6 viridis_0.6.2 pbapply_1.7-0
[93] GetoptLong_1.0.5 cowplot_1.1.1 S4Vectors_0.36.2 zoo_1.8-11
[97] SummarizedExperiment_1.28.0 ggrepel_0.9.3 cluster_2.1.3 here_1.0.1
[101] magrittr_2.0.3 data.table_1.14.8 scattermore_0.8 circlize_0.4.15
[105] lmtest_0.9-40 RANN_2.6.1 parallelDist_0.2.6 ggnewscale_0.4.8
[109] fitdistrplus_1.1-8 Signac_1.9.0 R.cache_0.16.0 matrixStats_0.63.0
[113] hms_1.1.2 patchwork_1.1.2 mime_0.12 xtable_1.8-4
[117] HDO.db_0.99.1 XML_3.99-0.13 IRanges_2.32.0 gridExtra_2.3
[121] shape_1.4.6 compiler_4.2.0 biomaRt_2.54.0 shadowtext_0.1.2
[125] KernSmooth_2.23-20 crayon_1.5.2 R.oo_1.25.0 htmltools_0.5.4
[129] mgcv_1.8-42 ggfun_0.0.9 later_1.3.0 tzdb_0.3.0
[133] aplot_0.1.10 RcppParallel_5.1.7 DBI_1.1.3 tweenr_2.0.2
[137] slingshot_2.6.0 dbplyr_2.3.1 ComplexHeatmap_2.15.1 MASS_7.3-57
[141] rappdirs_0.3.3 Matrix_1.5-3 cli_3.6.0 R.methodsS3_1.8.2
[145] parallel_4.2.0 igraph_1.4.1 GenomicRanges_1.50.2 pkgconfig_2.0.3
[149] sp_1.6-0 plotly_4.10.1 spatstat.sparse_3.0-1 xml2_1.3.3
[153] foreach_1.5.2 ggtree_3.7.1.003 XVector_0.38.0 yulab.utils_0.0.6
[157] digest_0.6.31 sctransform_0.3.5 RcppAnnoy_0.0.20 spatstat.data_3.0-1
[161] Biostrings_2.66.0 leiden_0.4.3 fastmatch_1.1-3 tidytree_0.4.2
[165] uwot_0.1.14 curl_5.0.0 shiny_1.7.4 Rsamtools_2.14.0
[169] rjson_0.2.21 lifecycle_1.0.3 nlme_3.1-157 jsonlite_1.8.4
[173] viridisLite_0.4.1 fansi_1.0.4 pillar_1.8.1 lattice_0.20-45
[177] KEGGREST_1.38.0 fastmap_1.1.1 httr_1.4.5 survival_3.3-1
[181] GO.db_3.16.0 glue_1.6.2 png_0.1-8 iterators_1.0.14
[185] bit_4.0.5 ggforce_0.4.1 stringi_1.7.12 blob_1.2.3
[189] memoise_2.0.1 ape_5.7-1 irlba_2.3.5.1 future.apply_1.10.0

scp::ExpDimPlot

Hi developer
I wonder if SCP::ExpDimPlot has parameters like min.cutoff and max.cutoff in seruat::featureplot.

Some functions not found

I have problems with some functions and want to seek your opinions. I installed SCP from Github and ran some examples. However, some functions are not supported, e.g. could not find function "GroupHeatmap".

Thank you!

An Error occurs when using SCP::PrepareVirtualEnv function

Hi!

I'm recently trying your package SCP, it's really good and useful!

But when I try to install the SCP virtualenv by using SCP::PrepareVirtualEnv function, an error occurs:

======================== SCP python config ========================
python:         /home/jinhang/.virtualenvs/SCP/bin/python
libpython:      /home/jinhang/.pyenv/versions/3.8.8/lib/libpython3.8.so
pythonhome:     /home/jinhang/.virtualenvs/SCP:/home/jinhang/.virtualenvs/SCP
version:        3.8.8 (default, Dec 13 2022, 00:50:51)  [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
numpy:          /home/jinhang/.virtualenvs/SCP/lib/python3.8/site-packages/numpy
numpy_version:  1.21.6

NOTE: Python version was forced by RETICULATE_PYTHON
===================================================================
ImportError: The `scipy` install you are using seems to be broken, (extension modules cannot be imp), please try reinstalling.
Error in value[[3L]](cond) :
  Failed to run 'import scanpy'. Please check manually.

Also, when I try to reinstall scipy in the virtualenv, that error remains:
图片

I didn't know what brings up that error actually. Is there any soultion to this error?

Thanks!

R version 4.2.1 (2022-06-23)
Platform: x86_64-conda-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /home/jinhang/miniconda3/envs/R4.2/lib/libopenblasp-r0.3.21.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
[1] reticulate_1.26    RcppParallel_5.1.5 SCP_0.2.4         

loaded via a namespace (and not attached):
  [1] rappdirs_0.3.3              rtracklayer_1.58.0         
  [3] pbdZMQ_0.3-8                scattermore_0.8            
  [5] intrinsicDimension_1.2.0    princurve_2.1.6            
  [7] R.methodsS3_1.8.2           SeuratObject_4.1.3         
  [9] tidyr_1.2.1                 ggplot2_3.4.0              
 [11] bit64_4.0.5                 irlba_2.3.5.1              
 [13] DelayedArray_0.24.0         R.utils_2.12.2             
 [15] data.table_1.14.6           TrajectoryUtils_1.6.0      
 [17] KEGGREST_1.38.0             RCurl_1.98-1.9             
 [19] doParallel_1.0.17           generics_0.1.3             
 [21] BiocGenerics_0.44.0         ScaledMatrix_1.6.0         
 [23] cowplot_1.1.1               RSQLite_2.2.19             
 [25] RANN_2.6.1                  proxy_0.4-27               
 [27] future_1.29.0               bit_4.0.5                  
 [29] spatstat.data_3.0-0         xml2_1.3.3                 
 [31] httpuv_1.6.6                SummarizedExperiment_1.28.0
 [33] assertthat_0.2.1            viridis_0.6.2              
 [35] hms_1.1.2                   evaluate_0.18              
 [37] promises_1.2.0.1            fansi_1.0.3                
 [39] restfulr_0.0.15             progress_1.2.2             
 [41] dbplyr_2.2.1                igraph_1.3.5               
 [43] DBI_1.1.3                   htmlwidgets_1.5.4          
 [45] spatstat.geom_3.0-3         stats4_4.2.1               
 [47] purrr_0.3.5                 ellipsis_0.3.2             
 [49] crosstalk_1.2.0             dplyr_1.0.10               
 [51] ggnewscale_0.4.8            biomaRt_2.54.0             
 [53] deldir_1.0-6                sparseMatrixStats_1.10.0   
 [55] MatrixGenerics_1.10.0       vctrs_0.5.1                
 [57] SingleCellExperiment_1.20.0 Biobase_2.58.0             
 [59] here_1.0.1                  Cairo_1.6-0                
 [61] ROCR_1.0-11                 abind_1.4-5                
 [63] cachem_1.0.6                withr_2.5.0                
 [65] progressr_0.11.0            sctransform_0.3.5          
 [67] GenomicAlignments_1.34.0    prettyunits_1.1.1          
 [69] scran_1.26.0                goftest_1.2-3              
 [71] cluster_2.1.4               IRdisplay_1.1              
 [73] lazyeval_0.2.2              crayon_1.5.2               
 [75] spatstat.explore_3.0-5      edgeR_3.40.0               
 [77] pkgconfig_2.0.3             labeling_0.4.2             
 [79] units_0.8-1                 GenomeInfoDb_1.34.4        
 [81] nlme_3.1-160                vipor_0.4.5                
 [83] rlang_1.0.6                 globals_0.16.2             
 [85] lifecycle_1.0.3             miniUI_0.1.1.1             
 [87] filelock_1.0.2              BiocFileCache_2.6.0        
 [89] rsvd_1.0.5                  rprojroot_2.0.3            
 [91] polyclip_1.10-4             matrixStats_0.63.0         
 [93] lmtest_0.9-40               Matrix_1.5-3               
 [95] IRkernel_1.3.1.9000         zoo_1.8-11                 
 [97] base64enc_0.1-3             beeswarm_0.4.0             
 [99] ggridges_0.5.4              GlobalOptions_0.1.2        
[101] png_0.1-8                   viridisLite_0.4.1          
[103] rjson_0.2.21                bitops_1.0-7               
[105] R.oo_1.25.0                 KernSmooth_2.23-20         
[107] Biostrings_2.66.0           blob_1.2.3                 
[109] DelayedMatrixStats_1.20.0   shape_1.4.6                
[111] classInt_0.4-8              stringr_1.5.0              
[113] slingshot_2.6.0             parallelly_1.32.1          
[115] spatstat.random_3.0-1       R.cache_0.16.0             
[117] S4Vectors_0.36.1            beachmat_2.14.0            
[119] scales_1.2.1                memoise_2.0.1              
[121] magrittr_2.0.3              plyr_1.8.8                 
[123] ica_1.0-3                   zlibbioc_1.44.0            
[125] compiler_4.2.1              dqrng_0.3.0                
[127] BiocIO_1.8.0                RColorBrewer_1.1-3         
[129] clue_0.3-63                 fitdistrplus_1.1-8         
[131] Rsamtools_2.14.0            cli_3.4.1                  
[133] XVector_0.38.0              listenv_0.8.0              
[135] patchwork_1.1.2             pbapply_1.6-0              
[137] MASS_7.3-58.1               tidyselect_1.2.0           
[139] ggupset_0.3.0               stringi_1.7.8              
[141] yaml_2.3.6                  locfit_1.5-9.6             
[143] BiocSingular_1.14.0         ggrepel_0.9.2              
[145] grid_4.2.1                  tools_4.2.1                
[147] future.apply_1.10.0         parallel_4.2.1             
[149] parallelDist_0.2.6          circlize_0.4.15            
[151] uuid_1.1-0                  bluster_1.8.0              
[153] foreach_1.5.2               yaImpute_1.0-33            
[155] metapod_1.6.0               gridExtra_2.3              
[157] farver_2.1.1                Rtsne_0.16                 
[159] proxyC_0.3.3                BiocManager_1.30.19        
[161] digest_0.6.31               shiny_1.7.3                
[163] Rcpp_1.0.9                  GenomicRanges_1.50.1       
[165] scuttle_1.8.1               harmony_0.1.1              
[167] later_1.3.0                 RcppAnnoy_0.0.20           
[169] httr_1.4.4                  AnnotationDbi_1.60.0       
[171] sf_1.0-7                    ComplexHeatmap_2.15.1      
[173] colorspace_2.0-3            XML_3.99-0.13              
[175] tensor_1.5                  IRanges_2.32.0             
[177] splines_4.2.1               statmod_1.4.37             
[179] uwot_0.1.14                 spatstat.utils_3.0-1       
[181] scater_1.26.1               sp_1.5-1                   
[183] xgboost_1.6.0.1             plotly_4.10.1              
[185] xtable_1.8-4                jsonlite_1.8.4             
[187] R6_2.5.1                    pillar_1.8.1               
[189] htmltools_0.5.4             mime_0.12                  
[191] glue_1.6.2                  fastmap_1.1.0              
[193] BiocParallel_1.32.4         BiocNeighbors_1.16.0       
[195] class_7.3-20                codetools_0.2-18           
[197] utf8_1.2.2                  lattice_0.20-45            
[199] spatstat.sparse_3.0-0       tibble_3.1.8               
[201] curl_4.3.3                  ggbeeswarm_0.6.0           
[203] leiden_0.4.3                scDblFinder_1.12.0         
[205] limma_3.54.0                survival_3.4-0             
[207] repr_1.1.4                  munsell_0.5.0              
[209] e1071_1.7-12                GetoptLong_1.0.5           
[211] GenomeInfoDbData_1.2.9      iterators_1.0.14           
[213] reshape2_1.4.4              gtable_0.3.1               
[215] Seurat_4.3.0               

Error in RunDEtest

Hi,
when I run follow code
NK<- RunDEtest(srt = NK, group_by = "celltype", fc.threshold = 1,only.pos = FALSE,norm.method = "LogNormalize")
I got a error
image
NK is a seurat object
image

Documentaion for the functions

Thanks for creating the package and making wrappers for a bunch of useful functions. I was trying to find more documentation for functions but have not had much success. For example, I need to learn more about RunDE(), but could not find materials.
Could you please indicate where to refer to get more hints on the functions?
Thanks,
Hamid

Error running scVelo and PAGA error related to issue #21

Hi Zhanghaoe,

I have the same problem I have an integrated Seurat object with spliced and unspoiled counts but those counts are not similar to the counts in the RNA or SCT assays?. I am not sure if they should be similar or not as they are produced from different processing for example spliced and unspoiled were run on the fastq files but there are filtering steps to obtain the the counts in the RNA or SCT assays so I don't think they are expected to be similar. Is there anything I can do please?
hanks

Questions regarding the input data for scVelo

Hi @zhanghao-njmu,

Thank you for the package!

Related to #109, I hope to get some clarification regarding the input data.

I had loom objects for different samples generated by velocyto, and a Seurat object that had been fully analysed (with clustering and UMAP etc).

I was able to concatenate my loom objects into 1 object and converted it to Seurat object, but this object has not been in anyway processed (e.g., normalise etc that are typically done in scVelo pipeline).

Q1. Do I need to process the spliced and unspliced counts somehow before or after adding to my Seurat cluster object?

Q2. How might I add the ambiguous, matrix, spliced, unspliced to my Seurat GEX cluster object? Do I do as below?

test[["ambiguous"]] <- CreateAssayObject(counts = concat_adata_Seurat@assays$ambiguous)
test[["matrix"]] <- CreateAssayObject(counts = concat_adata_Seurat@assays$matrix)
test[["spliced"]] <- CreateAssayObject(counts = concat_adata_Seurat@assays$splice)

Thank you for your help!

My Seurat GEX cluster object:
Screenshot 2023-05-04 at 18 55 55

My loom-converted Seurat object:
Screenshot 2023-05-04 at 18 56 04

RunSCVELO

Hi, I'm trying to run the SCVelo but I'm facing the following error:

Error:SystemExit: None

How can I fix that?

Thanks!

Hi! Disturb you!

RunSCVELO is too slow. About three hours using your provided data. How can I fix it?

Typo in RunSCVELO and RunPAGA function arguments

Hi,

The documentation for SCP has the following commands for RunSCVELO and RunPAGA

pancreas_sub <- RunPAGA(
  srt = pancreas_sub, group_by = "SubCellType",
  linear_reduction = "PCA", nonlinear_reduction = "UMAP", return_seurat = TRUE
)
PAGAPlot(srt = pancreas_sub, reduction = "UMAP", label = TRUE, label_insitu = TRUE, label_repel = TRUE)

pancreas_sub <- RunSCVELO(
  srt = pancreas_sub, group_by = "SubCellType",
  linear_reduction = "PCA", nonlinear_reduction = "UMAP", return_seurat = TRUE
)
VelocityPlot(srt = pancreas_sub, reduction = "UMAP", group_by = "SubCellType")

I tried to run both and when it failed, I realized that there is a spelling error in the actual function and you have to give it liner_reduction and nonliner_reduction

Error running scVelo and PAGA

Hi,

I have a single cell dataset that was processed using Seurat. So my suerat object has an SCT assay well and the dimensions are different from the RNA assay. When i run RunPAGA or RunSCVELO, I'm getting the following error.

>scrna <- RunPAGA(
  srt = scrna, group_by = "var_cluster",
  linear_reduction = "PCA", nonlinear_reduction = "UMAP", return_seurat = TRUE
)
Assay 'SCT' is in the srt object but not converted.
Assay 'ambiguous' is in the srt object but not converted.
Error in py_set_attr_impl(x, name, value) : 
  ValueError: Value passed for key 'spliced' is of incorrect shape. Values of layers must match dimensions (0, 1) of parent. Value had shape (7227, 18401) while it should have had (7227, 55361).

Can you help me out with this please ?

Error on RunSCVELO function

Hi,

I've got an error on RunSCVELO:

d2 <- RunSCVELO(srt = d2, group_by = "groups", linear_reduction = "PCA", nonlinear_reduction = "UMAP")
'misc' slot is not converted.
'tools' slot is not converted.
Error in py_call_impl(callable, dots$args, dots$keywords) :
numpy.AxisError: axis 1 is out of bounds for array of dimension 1

It seems something happened in numpy via reticulate but cannot point out what the cause was..

Thanks,

GroupHeatmap might not correctly assigning colors to each group

Hello Zhanghao, I wanted to reach out and express my appreciation for your package as I have been thoroughly enjoying using it.

However, I recently encountered an issue while using the “GroupHeatmap” function. It seems that the “group_palcolor” parameter doesn’t correctly assign colors to each group. Instead, only the first color specified in the parameter is applied to all groups.

I would greatly appreciate your assistance in resolving this issue. Thank you in advance for your help.

Below is the code I am using:

ht <- GroupHeatmap(
srt = obj,
features = genes,
group.by = c("celltype"),
group_palcolor= c('#E69F00','#56B4E9','#009E73','#F0E442','#0072B2','#D55E00'),
heatmap_palette = "YlOrRd",
cell_annotation = c("Phase"),
cell_annotation_palette = c("Set2"),
show_row_names = TRUE, row_names_side = "left",
add_dot = TRUE, add_reticle = FALSE,
split.by="Sample",cell_split_palcolor=c('orange',"navy"),
dot_size = unit(8, "mm")
)

For reference, I have attached a figure showing the current output.
CleanShot 2023-08-10 at 20 59 15@2x

RunDEtest function for differential expression analysis between two genotypes from the same cell type

Thanks for creating this cool tool for scRNA-seq analysis, I have now integrated control and patient sample using harmony, is there any way we can do to perform differential expression analysis between disease vs control from the same cell type using the RunDEtest function? When I use findmarkers from Seurat package, I would use
DEG <- FindMarkers(integrated_dataset, assay = "RNA", min.pct = 0.1, ident.1 = "disease", ident.2 = "control",
test.use = "wilcox").

For RunDEtest function of your package, is the code below works the same purpose?
integrated_dataset <- RunDEtest(srt = integrated_dataset, group_by = "orig.ident", group1 = "disease", group2 = "control", only.pos = F, fc.threshold = 1, FindAllMarkers = T, FindPairedMarkers = F)

Thanks.

RunSCVELO resulted in AttributeError

Hi,

Thanks again for the awesome pipeline.

I tried to analysis velocity with the example data and resulted in

Error: AttributeError: can't set attribute

Here is the code I am using

Error: AttributeError: can't set attribute

And here is the traceback

stop(structure(list(message = "AttributeError: can't set attribute\n",
call = NULL, cppstack = structure(list(file = "", line = -1L,
stack = c("/usr/local/lib/R/site-library/reticulate/libs/reticulate.so(Rcpp::stop(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)+0x85) [0x7f0de34fd5d2]",
"/usr/local/lib/R/site-library/reticulate/libs/reticulate.so(+0x1f55b) [0x7f0de350055b]", ...
10._delegate_property_set at categorical.py#2460
9._setter at accessor.py#99
8.__setattr__ at base.py#178
7.set_legend at utils.py#555
6.scatter at scatter.py#668
5.velocity_embedding_stream at velocity_embedding_stream.py#252
4.SCVELO at SCP_analysis.py#188
3.(structure(function (...)
{
dots <- py_resolve_dots(list(...))
result <- py_call_impl(callable, dots$args, dots$keywords) ...
2.do.call(SCP_analysis$SCVELO, args)
1.RunSCVELO(srt = pancreas_sub, group_by = "SubCellType", linear_reduction = "PCA",
nonlinear_reduction = "UMAP")

The package versions loaded are

R version 4.3.0 (2023-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.3 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0 
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

time zone: Etc/UTC
tzcode source: system (glibc)

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

other attached packages:
[1] SeuratObject_4.1.3 Seurat_4.3.0       velocyto.R_0.6     Matrix_1.5-4       SCP_0.5.1          devtools_2.4.5    
[7] usethis_2.1.6     

loaded via a namespace (and not attached):
  [1] fs_1.6.2                    matrixStats_1.0.0           spatstat.sparse_3.0-1       bitops_1.0-7               
  [5] enrichplot_1.20.0           HDO.db_0.99.1               httr_1.4.6                  RColorBrewer_1.1-3         
  [9] doParallel_1.0.17           profvis_0.3.8               tools_4.3.0                 sctransform_0.3.5          
 [13] utf8_1.2.3                  R6_2.5.1                    mgcv_1.8-42                 lazyeval_0.2.2             
 [17] uwot_0.1.14                 GetoptLong_1.0.5            urlchecker_1.0.1            withr_2.5.0                
 [21] sp_1.6-0                    prettyunits_1.1.1           gridExtra_2.3               parallelDist_0.2.6         
 [25] progressr_0.13.0            cli_3.6.1                   Biobase_2.60.0              spatstat.explore_3.1-0     
 [29] scatterpie_0.2.0            spatstat.data_3.0-1         ggridges_0.5.4              pbapply_1.7-0              
 [33] slingshot_2.8.0             yulab.utils_0.0.6           Rsamtools_2.16.0            gson_0.1.0                 
 [37] DOSE_3.26.1                 R.utils_2.12.2              parallelly_1.35.0           sessioninfo_1.2.2          
 [41] rstudioapi_0.14             RSQLite_2.3.1               generics_0.1.3              gridGraphics_0.5-1         
 [45] shape_1.4.6                 ica_1.0-3                   spatstat.random_3.1-4       dplyr_1.1.2                
 [49] GO.db_3.17.0                fansi_1.0.4                 S4Vectors_0.38.1            abind_1.4-5                
 [53] R.methodsS3_1.8.2           lifecycle_1.0.3             yaml_2.3.7                  SummarizedExperiment_1.30.1
 [57] qvalue_2.32.0               BiocFileCache_2.8.0         Rtsne_0.16                  grid_4.3.0                 
 [61] blob_1.2.4                  promises_1.2.0.1            crayon_1.5.2                miniUI_0.1.1.1             
 [65] lattice_0.21-8              cowplot_1.1.1               KEGGREST_1.40.0             pillar_1.9.0               
 [69] knitr_1.42                  ComplexHeatmap_2.15.4       fgsea_1.26.0                GenomicRanges_1.52.0       
 [73] rjson_0.2.21                future.apply_1.10.0         codetools_0.2-19            fastmatch_1.1-3            
 [77] leiden_0.4.3                glue_1.6.2                  downloader_0.4              ggfun_0.0.9                
 [81] pcaMethods_1.92.0           data.table_1.14.8           remotes_2.4.2               treeio_1.24.0              
 [85] vctrs_0.6.2                 png_0.1-8                   gtable_0.3.3                cachem_1.0.8               
 [89] xfun_0.39                   princurve_2.1.6             S4Arrays_1.0.4              Signac_1.9.0               
 [93] mime_0.12                   tidygraph_1.2.3             survival_3.5-5              SingleCellExperiment_1.22.0
 [97] RcppRoll_0.3.0              iterators_1.0.14            ellipsis_0.3.2              fitdistrplus_1.1-11        
[101] ROCR_1.0-11                 nlme_3.1-162                ggtree_3.9.0                bit64_4.0.5                
[105] progress_1.2.2              filelock_1.0.2              RcppAnnoy_0.0.20            GenomeInfoDb_1.36.0        
[109] rprojroot_2.0.3             R.cache_0.16.0              irlba_2.3.5.1               KernSmooth_2.23-21         
[113] colorspace_2.1-0            BiocGenerics_0.46.0         DBI_1.1.3                   tidyselect_1.2.0           
[117] processx_3.8.1              proxyC_0.3.3                bit_4.0.5                   compiler_4.3.0             
[121] curl_5.0.0                  xml2_1.3.4                  DelayedArray_0.26.3         desc_1.4.2                 
[125] plotly_4.10.1               shadowtext_0.1.2            scales_1.2.1                lmtest_0.9-40              
[129] callr_3.7.3                 rappdirs_0.3.3              stringr_1.5.0               digest_0.6.31              
[133] goftest_1.2-3               spatstat.utils_3.0-2        rmarkdown_2.21              XVector_0.40.0             
[137] htmltools_0.5.5             pkgconfig_2.0.3             MatrixGenerics_1.12.3       intrinsicDimension_1.2.0   
[141] dbplyr_2.3.2                fastmap_1.1.1               rlang_1.1.1                 GlobalOptions_0.1.2        
[145] htmlwidgets_1.6.2           shiny_1.7.4                 farver_2.1.1                zoo_1.8-12                 
[149] jsonlite_1.8.4              BiocParallel_1.34.2         GOSemSim_2.26.0             R.oo_1.25.0                
[153] RCurl_1.98-1.12             magrittr_2.0.3              GenomeInfoDbData_1.2.10     ggplotify_0.1.0            
[157] patchwork_1.1.2             munsell_0.5.0               Rcpp_1.0.10                 TrajectoryUtils_1.8.0      
[161] ggnewscale_0.4.9            ape_5.7-1                   viridis_0.6.3               reticulate_1.28            
[165] stringi_1.7.12              ggraph_2.1.0                zlibbioc_1.46.0             MASS_7.3-60                
[169] plyr_1.8.8                  pkgbuild_1.4.0              parallel_4.3.0              listenv_0.9.0              
[173] ggrepel_0.9.3               deldir_1.0-6                Biostrings_2.68.1           graphlayouts_1.0.0         
[177] splines_4.3.0               tensor_1.5                  hms_1.1.3                   circlize_0.4.15            
[181] ps_1.7.5                    igraph_1.4.2                spatstat.geom_3.1-0         reshape2_1.4.4             
[185] biomaRt_2.56.0              stats4_4.3.0                pkgload_1.3.2               XML_3.99-0.14              
[189] evaluate_0.21               RcppParallel_5.1.7          foreach_1.5.2               tweenr_2.0.2               
[193] httpuv_1.6.10               RANN_2.6.1                  tidyr_1.3.0                 purrr_1.0.1                
[197] polyclip_1.10-4             future_1.32.0               clue_0.3-64                 scattermore_1.0            
[201] ggplot2_3.4.2               ggforce_0.4.1               xtable_1.8-4                tidytree_0.4.2             
[205] later_1.3.1                 viridisLite_0.4.2           tibble_3.2.1                clusterProfiler_4.8.1      
[209] aplot_0.1.10                yaImpute_1.0-33             memoise_2.0.1               AnnotationDbi_1.62.1       
[213] IRanges_2.34.0              cluster_2.1.4               globals_0.16.2              here_1.0.1   

I have also tried to set up a totally new environment, but still resulted in the same error.

Thanks ahead for the help!

Minjie

Error Installing

I'm sorry to interrupt you, and thank you for this wonderful package, but I have problems in installing this package by using:

env_dir <- "~/SCP_env/"
dir.create(env_dir,recursive = TRUE)
setwd(env_dir)
renv::init(project = env_dir)
renv::activate(project = env_dir)
renv::hydrate("devtools")
options(timeout = 500)
devtools::install_github("zhanghao-njmu/SCP")

And I get the report below:

ERROR: lazy loading failed for package 'SCP'
removing 'E:/R-4.2.1/library/SCP'
Warning messages:
1: In untar2(tarfile, files, list, exdir, restore_times) :
skipping pax global extended headers
2: In untar2(tarfile, files, list, exdir, restore_times) :
skipping pax global extended headers
3: In i.p(...) :
Installation of the package‘C:/Users/.../AppData/Local/Temp/Rtmp4A9mH3/file3882b2b28d5/SCP_0.2.5.tar.gz’ had non-zero status

my session info is as below:

R version 4.2.1 (2022-06-23 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)
Matrix products: default
locale:
[1] LC_COLLATE=Chinese (Simplified)_China.utf8 LC_CTYPE=Chinese (Simplified)_China.utf8
[3] LC_MONETARY=Chinese (Simplified)_China.utf8 LC_NUMERIC=C
[5] LC_TIME=Chinese (Simplified)_China.utf8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] devtools_2.4.5 usethis_2.1.6
loaded via a namespace (and not attached):
[1] Rcpp_1.0.7 compiler_4.2.1 later_1.3.0 urlchecker_1.0.1 prettyunits_1.1.1
[6] profvis_0.3.7 remotes_2.4.2 tools_4.2.1 digest_0.6.29 pkgbuild_1.3.1
[11] pkgload_1.3.0 memoise_2.0.1 lifecycle_1.0.3 rlang_1.0.6 shiny_1.7.3
[16] cli_3.4.1 rstudioapi_0.14 curl_4.3.3 fastmap_1.1.0 withr_2.5.0
[21] stringr_1.5.0 fs_1.5.2 htmlwidgets_1.5.4 rprojroot_2.0.3 glue_1.6.2
[26] R6_2.5.1 processx_3.7.0 sessioninfo_1.2.2 callr_3.7.2 purrr_0.3.5
[31] magrittr_2.0.3 ps_1.7.1 promises_1.2.0.1 ellipsis_0.3.2 htmltools_0.5.3
[36] mime_0.12 xtable_1.8-4 renv_0.16.0 httpuv_1.6.6 stringi_1.7.8
[41] miniUI_0.1.1.1 cachem_1.0.6 crayon_1.5.2

Error in 1:dim(data)[[1]] : argument of length 0

非常感谢大佬的R包!我在跑DynamicHeatmap的时候报错Error in 1:dim(data)[[1]] : argument of length 0,不知道是哪里出了问题想请教一下,谢谢!!
完整代码是:
ht <- DynamicHeatmap(
srt = sce.all, lineages = c("Lineage1", "Lineage2"),
use_fitted = TRUE, n_split = 6, reverse_ht = "Lineage1",
species = "Homo_sapiens", db = c("GO_BP", "KEGG", "Reactome"), anno_terms = TRUE, anno_keys = TRUE, anno_features = TRUE,
heatmap_palette = "viridis", cell_annotation = "seurat_clusters",
separate_annotation = list("seurat_clusters", c("CD34", "MPO")), separate_annotation_palette = c("Paired", "Set1"),
pseudotime_label = 25, pseudotime_label_color = "red",
height = 5, width = 2
)
反馈:
[2023-03-04 20:17:43] Start RunDynamicFeatures
Workers: 14
Number of candidate features(union): 2
Calculate dynamic features for Lineage1...
|============================================================================================================================| 100%

[2023-03-04 20:18:21] RunDynamicFeatures done
Elapsed time:37.91 secs
[2023-03-04 20:18:21] Start RunDynamicFeatures
Workers: 14
Number of candidate features(union): 2
Calculate dynamic features for Lineage2...
|============================================================================================================================| 100%

[2023-03-04 20:19:01] RunDynamicFeatures done
Elapsed time:39.7 secs
Error in 1:dim(data)[[1]] : argument of length 0
In addition: Warning messages:
1: In serialize(data, node$con) :
'package:stats' may not be available when loading
2: In serialize(data, node$con) :
'package:stats' may not be available when loading
3: In serialize(data, node$con) :
'package:stats' may not be available when loading
4: In serialize(data, node$con) :
'package:stats' may not be available when loading

Question on how the annotation colors are set on ExpHeatmap()

Hello. Thank you for this wonderful tool :)
I have two questions on how the anno_terms = TRUE function works in ExpHeatmap().

  1. How are the annotated terms selected in the plot? I have noticed that they are not exactly the first genes in the "GeneID" column of results when I run RunEnrichment() seperately with the same genesets.

  2. How are the color of the letters set on Anno_Terms, and Anno_Features in ExpHeatmap()? I thought the color of the Anno_Terms and its intersecting genes within would match, but that does not seem to be the case, as some of the colors that are in annotated features are not present in annotated terms.

Thank you in advance!

Error in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y

Do you have any idea why I am getting this grid.call error while running DynamicPlot() and DynamicHeatmap()
DynamicPlot( srt = cortex, lineages = c("Lineage3", "Lineage7"), group.by = "Hes_Exp", features = c("Nes"), compare_lineages = TRUE, compare_features = FALSE)

[2023-03-23 19:14:25] Start RunDynamicFeatures
Workers: 78
Number of candidate features(union): 1
Calculate dynamic features for Lineage3...
|==========================================================================================| 100%

[2023-03-23 19:15:06] RunDynamicFeatures done
Elapsed time:40.59 secs
[2023-03-23 19:15:06] Start RunDynamicFeatures
Workers: 78
Number of candidate features(union): 1
Calculate dynamic features for Lineage7...
|==========================================================================================| 100%

[2023-03-23 19:15:46] RunDynamicFeatures done
Elapsed time:40.35 secs
Warning in DynamicPlot(srt = cortex, lineages = c("Lineage3", "Lineage7"), :
Values in 'counts' slot is non-integer. Set the libsize to 1.
Warning in DynamicPlot(srt = cortex, lineages = c("Lineage3", "Lineage7"), :
Values in 'counts' slot is non-integer. Set the libsize to 1.
Error in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
polygon edge not found (zero-width or zero-height?)

adata_to_srt error

Hi,

When read h5ad file with SCP with this code:

adata <- sc$read_h5ad("test.h5ad")
data1 <- adata_to_srt(adata)

I got an error like bellow:

Error in slot(object = object, name = "features")[[layer]] <- features: more elements supplied than there are to replace
Traceback:

1. adata_to_srt(adata)
2. CreateSeuratObject(counts = x, meta.data = metadata)
3. CreateSeuratObject.default(counts = x, meta.data = metadata)
4. CreateAssay5Object(counts = counts, min.cells = min.cells, min.features = min.features, 
 .     ...)
5. .CreateStdAssay(counts = counts, min.cells = min.cells, min.features = min.features, 
 .     transpose = transpose, type = type, csum = csum, fsum = fsum, 
 .     ...)
6. .CreateStdAssay.list(counts = counts, min.cells = min.cells, 
 .     min.features = min.features, transpose = transpose, type = type, 
 .     csum = csum, fsum = fsum, ...)
7. `LayerData<-`(object = `*tmp*`, layer = layer, features = features[[layer]], 
 .     cells = cells[[layer]], transpose = transpose, value = counts[[layer]])
8. `LayerData<-.Assay5`(object = `*tmp*`, layer = layer, features = features[[layer]], 
 .     cells = cells[[layer]], transpose = transpose, value = counts[[layer]])

RunSCVELO crash on Mac M1

Hi !
I tried the pancreas tutorial dataset and it's crash
Capture d’écran 2023-07-19 à 12 16 04

I tried on Python and it's worked

How can I do ?

ValueError: '_index' is a reserved name for dataframe columns. Above error raised while writing key 'var' of to /

Hi there,

I was trying to write my adata with write_h5ad which has my loom objects merged with my Seurat object in Python so that I can then convert it to Seurat object to use SCP, but it threw an error as below.

Would you mind helping me fix this issue?

Thank you.

My AnnData object:

Screenshot 2023-05-04 at 17 13 52

loomGEX_adata.write_h5ad('...Velocity_scVelo_Objects/loomGEX_adata.h5ad')
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
File [~/.pyenv/versions/3.10.11/envs/RNAVELO_310/lib/python3.10/site-packages/anndata/_io/utils.py:246](https://file+.vscode-resource.vscode-cdn.net/Users/stillhere/Documents/01_DPhil/scRNAseq/T230T240T246_CXCR5Project/Final_Objects_preAzimuth_2023Feb23/RNA_Velocity_scVelo/RNA_Velocity/SCRIPTS/~/.pyenv/versions/3.10.11/envs/RNAVELO_310/lib/python3.10/site-packages/anndata/_io/utils.py:246), in report_write_key_on_error..func_wrapper(*args, **kwargs)
    245 try:
--> 246     return func(*args, **kwargs)
    247 except Exception as e:

File [~/.pyenv/versions/3.10.11/envs/RNAVELO_310/lib/python3.10/site-packages/anndata/_io/specs/registry.py:311](https://file+.vscode-resource.vscode-cdn.net/Users/stillhere/Documents/01_DPhil/scRNAseq/T230T240T246_CXCR5Project/Final_Objects_preAzimuth_2023Feb23/RNA_Velocity_scVelo/RNA_Velocity/SCRIPTS/~/.pyenv/versions/3.10.11/envs/RNAVELO_310/lib/python3.10/site-packages/anndata/_io/specs/registry.py:311), in Writer.write_elem(self, store, k, elem, dataset_kwargs, modifiers)
    310 else:
--> 311     return write_func(store, k, elem, dataset_kwargs=dataset_kwargs)

File [~/.pyenv/versions/3.10.11/envs/RNAVELO_310/lib/python3.10/site-packages/anndata/_io/specs/registry.py:52](https://file+.vscode-resource.vscode-cdn.net/Users/stillhere/Documents/01_DPhil/scRNAseq/T230T240T246_CXCR5Project/Final_Objects_preAzimuth_2023Feb23/RNA_Velocity_scVelo/RNA_Velocity/SCRIPTS/~/.pyenv/versions/3.10.11/envs/RNAVELO_310/lib/python3.10/site-packages/anndata/_io/specs/registry.py:52), in write_spec..decorator..wrapper(g, k, *args, **kwargs)
     50 @wraps(func)
     51 def wrapper(g, k, *args, **kwargs):
---> 52     result = func(g, k, *args, **kwargs)
     53     g[k].attrs.setdefault("encoding-type", spec.encoding_type)

File [~/.pyenv/versions/3.10.11/envs/RNAVELO_310/lib/python3.10/site-packages/anndata/_io/specs/methods.py:560](https://file+.vscode-resource.vscode-cdn.net/Users/stillhere/Documents/01_DPhil/scRNAseq/T230T240T246_CXCR5Project/Final_Objects_preAzimuth_2023Feb23/RNA_Velocity_scVelo/RNA_Velocity/SCRIPTS/~/.pyenv/versions/3.10.11/envs/RNAVELO_310/lib/python3.10/site-packages/anndata/_io/specs/methods.py:560), in write_dataframe(f, key, df, _writer, dataset_kwargs)
    559     if reserved in df.columns:
--> 560         raise ValueError(f"{reserved!r} is a reserved name for dataframe columns.")
    561 group = f.create_group(key)

ValueError: '_index' is a reserved name for dataframe columns.

The above exception was the direct cause of the following exception:

ValueError                                Traceback (most recent call last)
Cell In[13], line 2
      1 # Save file after running scv.tl.recover_dynamics
----> 2 Tonsil_cd8_loomGEX_adata.write_h5ad('[/Users/stillhere/Documents/01_DPhil/scRNAseq/T230T240T246_CXCR5Project/Final_Objects_preAzimuth_2023Feb23/RNA_Velocity_scVelo/RNA_Velocity/DATA/RNA_Velocity_scVelo_Objects/Tonsil_cd8_loomGEX_adata.h5ad](https://file+.vscode-resource.vscode-cdn.net/Users/stillhere/Documents/01_DPhil/scRNAseq/T230T240T246_CXCR5Project/Final_Objects_preAzimuth_2023Feb23/RNA_Velocity_scVelo/RNA_Velocity/DATA/RNA_Velocity_scVelo_Objects/Tonsil_cd8_loomGEX_adata.h5ad)')
      3 #adata = scv.read('data[/pancreas.h5ad](https://file+.vscode-resource.vscode-cdn.net/pancreas.h5ad)')

File [~/.pyenv/versions/3.10.11/envs/RNAVELO_310/lib/python3.10/site-packages/anndata/_core/anndata.py:1951](https://file+.vscode-resource.vscode-cdn.net/Users/stillhere/Documents/01_DPhil/scRNAseq/T230T240T246_CXCR5Project/Final_Objects_preAzimuth_2023Feb23/RNA_Velocity_scVelo/RNA_Velocity/SCRIPTS/~/.pyenv/versions/3.10.11/envs/RNAVELO_310/lib/python3.10/site-packages/anndata/_core/anndata.py:1951), in AnnData.write_h5ad(self, filename, compression, compression_opts, as_dense)
   1948 if filename is None:
   1949     filename = self.filename
-> 1951 _write_h5ad(
   1952     Path(filename),
   1953     self,
   1954     compression=compression,
   1955     compression_opts=compression_opts,
   1956     as_dense=as_dense,
   1957 )
   1959 if self.isbacked:
   1960     self.file.filename = filename

File [~/.pyenv/versions/3.10.11/envs/RNAVELO_310/lib/python3.10/site-packages/anndata/_io/h5ad.py:91](https://file+.vscode-resource.vscode-cdn.net/Users/stillhere/Documents/01_DPhil/scRNAseq/T230T240T246_CXCR5Project/Final_Objects_preAzimuth_2023Feb23/RNA_Velocity_scVelo/RNA_Velocity/SCRIPTS/~/.pyenv/versions/3.10.11/envs/RNAVELO_310/lib/python3.10/site-packages/anndata/_io/h5ad.py:91), in write_h5ad(filepath, adata, as_dense, dataset_kwargs, **kwargs)
     87     write_elem(
     88         f, "raw[/varm](https://file+.vscode-resource.vscode-cdn.net/varm)", dict(adata.raw.varm), dataset_kwargs=dataset_kwargs
     89     )
     90 elif adata.raw is not None:
---> 91     write_elem(f, "raw", adata.raw, dataset_kwargs=dataset_kwargs)
     92 write_elem(f, "obs", adata.obs, dataset_kwargs=dataset_kwargs)
     93 write_elem(f, "var", adata.var, dataset_kwargs=dataset_kwargs)

File [~/.pyenv/versions/3.10.11/envs/RNAVELO_310/lib/python3.10/site-packages/anndata/_io/specs/registry.py:353](https://file+.vscode-resource.vscode-cdn.net/Users/stillhere/Documents/01_DPhil/scRNAseq/T230T240T246_CXCR5Project/Final_Objects_preAzimuth_2023Feb23/RNA_Velocity_scVelo/RNA_Velocity/SCRIPTS/~/.pyenv/versions/3.10.11/envs/RNAVELO_310/lib/python3.10/site-packages/anndata/_io/specs/registry.py:353), in write_elem(store, k, elem, dataset_kwargs)
    329 def write_elem(
    330     store: GroupStorageType,
    331     k: str,
   (...)
    334     dataset_kwargs: Mapping = MappingProxyType({}),
    335 ) -> None:
    336     """
    337     Write an element to a storage group using anndata encoding.
    338 
   (...)
    351         E.g. for zarr this would be `chunks`, `compressor`.
    352     """
--> 353     Writer(_REGISTRY).write_elem(store, k, elem, dataset_kwargs=dataset_kwargs)

File [~/.pyenv/versions/3.10.11/envs/RNAVELO_310/lib/python3.10/site-packages/anndata/_io/utils.py:248](https://file+.vscode-resource.vscode-cdn.net/Users/stillhere/Documents/01_DPhil/scRNAseq/T230T240T246_CXCR5Project/Final_Objects_preAzimuth_2023Feb23/RNA_Velocity_scVelo/RNA_Velocity/SCRIPTS/~/.pyenv/versions/3.10.11/envs/RNAVELO_310/lib/python3.10/site-packages/anndata/_io/utils.py:248), in report_write_key_on_error..func_wrapper(*args, **kwargs)
    246     return func(*args, **kwargs)
    247 except Exception as e:
--> 248     re_raise_error(e, elem, key)

File [~/.pyenv/versions/3.10.11/envs/RNAVELO_310/lib/python3.10/site-packages/anndata/_io/utils.py:246](https://file+.vscode-resource.vscode-cdn.net/Users/stillhere/Documents/01_DPhil/scRNAseq/T230T240T246_CXCR5Project/Final_Objects_preAzimuth_2023Feb23/RNA_Velocity_scVelo/RNA_Velocity/SCRIPTS/~/.pyenv/versions/3.10.11/envs/RNAVELO_310/lib/python3.10/site-packages/anndata/_io/utils.py:246), in report_write_key_on_error..func_wrapper(*args, **kwargs)
    244         break
    245 try:
--> 246     return func(*args, **kwargs)
    247 except Exception as e:
    248     re_raise_error(e, elem, key)

File [~/.pyenv/versions/3.10.11/envs/RNAVELO_310/lib/python3.10/site-packages/anndata/_io/specs/registry.py:311](https://file+.vscode-resource.vscode-cdn.net/Users/stillhere/Documents/01_DPhil/scRNAseq/T230T240T246_CXCR5Project/Final_Objects_preAzimuth_2023Feb23/RNA_Velocity_scVelo/RNA_Velocity/SCRIPTS/~/.pyenv/versions/3.10.11/envs/RNAVELO_310/lib/python3.10/site-packages/anndata/_io/specs/registry.py:311), in Writer.write_elem(self, store, k, elem, dataset_kwargs, modifiers)
    302     return self.callback(
    303         write_func,
    304         store,
   (...)
    308         iospec=self.registry.get_spec(elem),
    309     )
    310 else:
--> 311     return write_func(store, k, elem, dataset_kwargs=dataset_kwargs)

File [~/.pyenv/versions/3.10.11/envs/RNAVELO_310/lib/python3.10/site-packages/anndata/_io/specs/registry.py:52](https://file+.vscode-resource.vscode-cdn.net/Users/stillhere/Documents/01_DPhil/scRNAseq/T230T240T246_CXCR5Project/Final_Objects_preAzimuth_2023Feb23/RNA_Velocity_scVelo/RNA_Velocity/SCRIPTS/~/.pyenv/versions/3.10.11/envs/RNAVELO_310/lib/python3.10/site-packages/anndata/_io/specs/registry.py:52), in write_spec..decorator..wrapper(g, k, *args, **kwargs)
     50 @wraps(func)
     51 def wrapper(g, k, *args, **kwargs):
---> 52     result = func(g, k, *args, **kwargs)
     53     g[k].attrs.setdefault("encoding-type", spec.encoding_type)
     54     g[k].attrs.setdefault("encoding-version", spec.encoding_version)

File [~/.pyenv/versions/3.10.11/envs/RNAVELO_310/lib/python3.10/site-packages/anndata/_io/specs/methods.py:261](https://file+.vscode-resource.vscode-cdn.net/Users/stillhere/Documents/01_DPhil/scRNAseq/T230T240T246_CXCR5Project/Final_Objects_preAzimuth_2023Feb23/RNA_Velocity_scVelo/RNA_Velocity/SCRIPTS/~/.pyenv/versions/3.10.11/envs/RNAVELO_310/lib/python3.10/site-packages/anndata/_io/specs/methods.py:261), in write_raw(f, k, raw, _writer, dataset_kwargs)
    259 g = f.create_group(k)
    260 _writer.write_elem(g, "X", raw.X, dataset_kwargs=dataset_kwargs)
--> 261 _writer.write_elem(g, "var", raw.var, dataset_kwargs=dataset_kwargs)
    262 _writer.write_elem(g, "varm", dict(raw.varm), dataset_kwargs=dataset_kwargs)

File [~/.pyenv/versions/3.10.11/envs/RNAVELO_310/lib/python3.10/site-packages/anndata/_io/utils.py:248](https://file+.vscode-resource.vscode-cdn.net/Users/stillhere/Documents/01_DPhil/scRNAseq/T230T240T246_CXCR5Project/Final_Objects_preAzimuth_2023Feb23/RNA_Velocity_scVelo/RNA_Velocity/SCRIPTS/~/.pyenv/versions/3.10.11/envs/RNAVELO_310/lib/python3.10/site-packages/anndata/_io/utils.py:248), in report_write_key_on_error..func_wrapper(*args, **kwargs)
    246     return func(*args, **kwargs)
    247 except Exception as e:
--> 248     re_raise_error(e, elem, key)

File [~/.pyenv/versions/3.10.11/envs/RNAVELO_310/lib/python3.10/site-packages/anndata/_io/utils.py:229](https://file+.vscode-resource.vscode-cdn.net/Users/stillhere/Documents/01_DPhil/scRNAseq/T230T240T246_CXCR5Project/Final_Objects_preAzimuth_2023Feb23/RNA_Velocity_scVelo/RNA_Velocity/SCRIPTS/~/.pyenv/versions/3.10.11/envs/RNAVELO_310/lib/python3.10/site-packages/anndata/_io/utils.py:229), in report_write_key_on_error..re_raise_error(e, elem, key)
    227 else:
    228     parent = _get_parent(elem)
--> 229     raise type(e)(
    230         f"{e}\n\n"
    231         f"Above error raised while writing key {key!r} of {type(elem)} "
    232         f"to {parent}"
    233     ) from e

ValueError: '_index' is a reserved name for dataframe columns.

Above error raised while writing key 'var' of  to /

Posted at scverse/anndata#990

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.