Questions tagged [scanpy]

Scanpy is a scalable toolkit for analyzing single-cell gene expression data. It includes preprocessing, visualization, clustering, pseudotime and trajectory inference, differential expression testing and simulation of gene regulatory networks.

Scanpy is a scalable toolkit for analyzing single-cell gene expression data built jointly with anndata. It includes preprocessing, visualization, clustering, trajectory inference and differential expression testing. The Python-based implementation efficiently deals with datasets of more than one million cells. For more information, see the docs and the github repository.

63 questions
9
votes
3 answers

How do I create AnnData object from a pandas data frame count matrix?

I am trying to use the Scanpy Python package to analyze some single-cell data. I read a count matrix (a .tsv file) in as a Pandas data frame, which has genes as the columns and rows as the different cells. Each row contains the counts for the…
AyeTown
  • 831
  • 1
  • 5
  • 20
3
votes
4 answers

Receiving "TypeError: __init__() got an unexpected keyword argument 'basey'" In this tutorial

I've been trying to run through this tutorial (https://bedapub.github.io/besca/tutorials/scRNAseq_tutorial.html) for the past day and constantly get an error after running this portion: bc.pl.kp_genes(adata, min_genes=min_genes, ax = ax1) The error…
SorenFlying
  • 33
  • 1
  • 3
2
votes
2 answers

subsetting anndata on basis of louvain clusters

I want to subset anndata on basis of clusters, but i am not able to understand how to do it. I am running scVelo pipeline, and in that i ran tl.louvain function to cluster cells on basis of louvain. I got around 32 clusters, of which cluster 2 and 4…
sidrah maryam
  • 45
  • 2
  • 8
2
votes
1 answer

How to add an observation category on scanpy based on another observation?

I have a concatenated single-cell RNAseq anndata with obs: 'Age', 'EPNsubtype', 'Region', 'Subclass', 'Taxonomy_group', 'Tissue', 'batch', 'pheno', 'sample', 'subtype', 'treatment', 'n_genes', 'percent_mito', 'n_counts', 'leiden' And I want to…
gmcr1
  • 21
  • 1
  • 2
2
votes
2 answers

Unable to install scanpy with

Hi I am having trouble install scanpy library using pip. Here's the command I ran pip install scanpy During the installation it reports the following error message: Collecting scanpy Downloading…
2
votes
1 answer

ModuleNotFoundError when running paga with scanpy

I tried running code below using scanpy library but for some reason it reports an error ModuleNotFoundError: No module named 'igraph' import numpy as np import scanpy as sc import anndata adata =…
Vger
  • 115
  • 1
  • 4
1
vote
1 answer

getting "ValueError: Axis limits cannot be NaN or Inf" error when plotting PCs

I am doing PC analysis and trying to plot the ranking of PCs using a python package called scanpy (for my data I have to use this package) and this line of code: >>> sc.pl.pca_variance_ratio(adata, log=True, n_pcs = 50) but getting the following…
John
  • 131
  • 1
  • 2
  • 10
1
vote
1 answer

Adjust the cluster order of sc.pl.heatmap in scanpy

I am a beginner who is studying bioinformatics with scanpy these days. In the 'sc.pl.heatmap', I want to show ‘leiden’ in a specific order in heatmap, but I don’t know what to do. I want to show ‘leiden’ in ascending order. Is there any related…
supigen
  • 17
  • 4
1
vote
1 answer

Having trouble in installing scanpy in python

My python version is 3.8. However, while Im trying to install scanpy using this command pip install scanpy in jupyter notebook, I'm getting following error message: ERROR: matplotlib 3.5.3 has requirement packaging>=20.0, but you'll have packaging…
1
vote
0 answers

ValueError: `X_pca` does not have enough PCs. Rerun `sc.pp.pca` with adjusted `n_comps`

I get an error with my code like this: for adata in [adata_fish]: sc.pp.neighbors(adata, n_neighbors=10, n_pcs=50) sc.tl.leiden(adata) and because of this code I can't run this code: # Plot Leiden clusters on tSNE for adata in…
Caroline
  • 119
  • 8
1
vote
1 answer

Panda crosstab function getting number for conditions

I´m not sure if the title was well picked, sorry for that. If this was already covered please let me know where I couldn´t find it. For an analysis that I am doing, I am working in JupyterLab mainly scanpy. I want to see the number of cells that…
Greenline
  • 13
  • 5
1
vote
1 answer

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

I am trying to save a file as to h5ad format and it is giving this value error; ValueError: '_index' is a reserved name for dataframe columns. import pandas as pd import scanpy as sc import numpy as np data = sc.read_h5ad('f.h5ad') annotation =…
1
vote
2 answers

Exporting a list of genes to .csv after carrying out sc.tl.rank_genes_groups in scanpy

I am relatively new to Python and Scanpy and recently i have generated a list of differentially expressed genes by using the sc.tl.rank_genes_groups function in scanpy.. I can then get these genes to be listed in the console, by carrying out this…
Dan
  • 11
  • 1
1
vote
2 answers

Library not loaded: @rpath/libhdf5.103.dylib when importing scanpy and tables

I've installed scanpy and all the necessary associated packages in PyCharm (tables, numpy, etc.), but when I try to import scanpy, I receive the following error: ImportError:…
Laura
  • 11
  • 2
1
vote
2 answers

How do I solve "incompatible numba" error while installing Scanpy?

I tried installing the Scanpy package on Jupyter with "pip install Scanpy" but I got the the errors below; ERROR: pynndescent 0.5.2 has requirement numba>=0.51.2, but you'll have numba 0.48.0 which is incompatible. ERROR: umap-learn 0.5.1 has…
Ola
  • 13
  • 1
  • 3
1
2 3 4 5