high proportion of unspliced & scv.pl.proportions() did not work #933
Unanswered
Anna-RNA88
asked this question in
Q&A
Replies: 1 comment 1 reply
-
@Anna-RNA88, sorry, I don't understand what the issue is exactly. What do you mean by "scv.pl.proportions() did not work any more"? You did not provide an error output. Also, updating packages will not change the proportions of unspliced and spliced counts you see since it is a data property. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I once used ScVelo for one of my human sample, it was efficient, convenient and successful. But I am facing two questions regarding the scvelo results I got for my two mouse samples. When I checked the spliced/unspliced percentages scv.pl.proportions(adata), I got majority unspliced (84%) and minority spliced (16%). Here's my method: 1) I integrate the two samples (10x Chromium samples (3')), filtered the cells and genes, based on the seurat analysis; 2) I used velocyto to generate individual loom files. The spliced/unspliced counts are from velocyto 10x pipeline which uses cellranger's outs/filtered_feature_matrices as input. 3) I used scv.pl.proportions() to merge adata and ldata1, and ldata2, respectively. 4) The downstream analyses presented in scvelo tutorial page all ran successfully. 5) As I got the high proportion of unspliced, I try to figure out this problem by updating (pip install -U anndata pandas). But this action led to another problem: the scv.pl.proportions() did not work any more.
Thank you very much for your help!
-Anna
# paste your code here, if applicable
import sys
sys.path.append("./anaconda3/lib/python3.8/site-packages")
import scvelo as scv
import cellrank as cr
import scanpy as sc
import numpy as np
import pandas as pd
import anndata as ad
pip install -U anndata pandas
Requirement already satisfied: anndata in ./anaconda3/lib/python3.8/site-packages (0.7.8)
Collecting anndata
Downloading anndata-0.8.0-py3-none-any.whl (96 kB)
|████████████████████████████████| 96 kB 141 kB/s eta 0:00:01
Requirement already satisfied: pandas in ./anaconda3/lib/python3.8/site-packages (1.2.4)
Collecting pandas
Downloading pandas-1.4.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.7 MB)
|████████████████████████████████| 11.7 MB 23.9 MB/s eta 0:00:01
Collecting h5py>=3
Downloading h5py-3.7.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (4.5 MB)
|████████████████████████████████| 4.5 MB 25.7 MB/s eta 0:00:01
Requirement already satisfied: natsort in ./anaconda3/lib/python3.8/site-packages (from anndata) (8.1.0)
Requirement already satisfied: scipy>1.4 in ./anaconda3/lib/python3.8/site-packages (from anndata) (1.6.2)
Requirement already satisfied: numpy>=1.16.5 in ./anaconda3/lib/python3.8/site-packages (from anndata) (1.20.1)
Requirement already satisfied: packaging>=20 in ./anaconda3/lib/python3.8/site-packages (from anndata) (20.9)
Requirement already satisfied: pytz>=2020.1 in ./anaconda3/lib/python3.8/site-packages (from pandas) (2021.1)
Requirement already satisfied: python-dateutil>=2.8.1 in ./anaconda3/lib/python3.8/site-packages (from pandas) (2.8.1)
Requirement already satisfied: pyparsing>=2.0.2 in ./anaconda3/lib/python3.8/site-packages (from packaging>=20->anndata) (2.4.7)
Requirement already satisfied: six>=1.5 in ./anaconda3/lib/python3.8/site-packages (from python-dateutil>=2.8.1->pandas) (1.15.0)
Installing collected packages: pandas, h5py, anndata
Attempting uninstall: pandas
Found existing installation: pandas 1.2.4
Uninstalling pandas-1.2.4:
Successfully uninstalled pandas-1.2.4
Attempting uninstall: h5py
Found existing installation: h5py 2.10.0
Uninstalling h5py-2.10.0:
Successfully uninstalled h5py-2.10.0
Attempting uninstall: anndata
Found existing installation: anndata 0.7.8
Uninstalling anndata-0.7.8:
Successfully uninstalled anndata-0.7.8
Successfully installed anndata-0.8.0 h5py-3.7.0 pandas-1.4.3
Note: you may need to restart the kernel to use updated packages.
adata = scanpy.read_h5ad("/home/annayu/filtered_feature_bc_matrix_irx/RNA Velocity/Irx3.5.het_with_unknow_CCA.h5ad")
adata
AnnData object with n_obs × n_vars = 3374 × 2000
obs: 'orig.ident', 'nCount_RNA', 'nFeature_RNA', 'percent_mito', 'percent_ribo', 'percent_hb', 'S.Score', 'G2M.Score', 'Phase', 'old.ident', 'pANN_0.25_0.09_849', 'DF.classifications_0.25_0.09_849', 'CCA_snn_res.0.07', 'seurat_clusters', 'CCA_snn_res.0.1', 'CCA_snn_res.0.4', 'CCA_snn_res.0.7', 'CCA_snn_res.1', 'CCA_snn_res.1.3', 'CCA_snn_res.1.6', 'celltype', 'RNA_snn_res.0.2'
var: '_index', 'features'
obsm: 'X_pca', 'X_tsne', 'X_umap'
varm: 'PCs'
load loom files for spliced/unspliced matrices for each sample:
ldata1 = scv.read('/home/annayu/run_count_P6Irx3-5CKO-het/velocyto/run_count_P6Irx3-5CKO-het.loom', cache=True)
ldata1.var_names_make_unique()
ldata1
AnnData object with n_obs × n_vars = 14119 × 32285
obs: 'Clusters', '_X', '_Y'
var: 'Accession', 'Chromosome', 'End', 'Start', 'Strand'
layers: 'ambiguous', 'matrix', 'spliced', 'unspliced'
adata1 = scv.utils.merge(adata, ldata1)
adata1
AnnData object with n_obs × n_vars = 3374 × 2000
obs: 'orig.ident', 'nCount_RNA', 'nFeature_RNA', 'percent_mito', 'percent_ribo', 'percent_hb', 'S.Score', 'G2M.Score', 'Phase', 'old.ident', 'pANN_0.25_0.09_849', 'DF.classifications_0.25_0.09_849', 'CCA_snn_res.0.07', 'seurat_clusters', 'CCA_snn_res.0.1', 'CCA_snn_res.0.4', 'CCA_snn_res.0.7', 'CCA_snn_res.1', 'CCA_snn_res.1.3', 'CCA_snn_res.1.6', 'celltype', 'RNA_snn_res.0.2', 'Clusters', '_X', '_Y', 'initial_size_spliced', 'initial_size_unspliced', 'initial_size'
var: '_index', 'features'
uns: 'celltype_colors'
obsm: 'X_pca', 'X_tsne', 'X_umap'
varm: 'PCs'
AnnData object with n_obs × n_vars = 3374 × 2000
obs: 'orig.ident', 'nCount_RNA', 'nFeature_RNA', 'percent_mito', 'percent_ribo', 'percent_hb', 'S.Score', 'G2M.Score', 'Phase', 'old.ident', 'pANN_0.25_0.09_849', 'DF.classifications_0.25_0.09_849', 'CCA_snn_res.0.07', 'seurat_clusters', 'CCA_snn_res.0.1', 'CCA_snn_res.0.4', 'CCA_snn_res.0.7', 'CCA_snn_res.1', 'CCA_snn_res.1.3', 'CCA_snn_res.1.6', 'celltype', 'RNA_snn_res.0.2', 'Clusters', '_X', '_Y', 'initial_size_spliced', 'initial_size_unspliced', 'initial_size'
var: '_index', 'features'
uns: 'celltype_colors'
obsm: 'X_pca', 'X_tsne', 'X_umap'
varm: 'PCs'
Error output
Versions
Beta Was this translation helpful? Give feedback.
All reactions