scanpy 空转数据结构seurattoscanpy spatial

Analysis and visualization of spatial transcriptomics data --- Scanpy documentation (scanpy-tutorials.readthedocs.io)

两种都可以读取

cs 复制代码
ns7=sc.read_visium(path="./ns7/",count_file='./2.3.h5_files/filtered_feature_bc_matrix.h5',library_id="NS_7",load_images=True,s
    ...: ource_image_path="./ns7/spatial/")


adata=sc.read_visium(path="./ns56/",count_file='filtered_feature_bc_matrix.h5',library_id="NS_56",load_images=True,source_image_
   ...: path="./ns56/spatial/")
cs 复制代码
scanpy.read_visium
scanpy.read_visium(path, genome=None, *, count_file='filtered_feature_bc_matrix.h5', library_id=None, load_images=True, source_image_path=None)[source]
Read 10x-Genomics-formatted visum dataset.

In addition to reading regular 10x output, this looks for the spatial folder and loads images, coordinates and scale factors. Based on the Space Ranger output docs.

See spatial() for a compatible plotting function.

Parameters
path
str | Path
Path to directory for visium datafiles.

genome
str | None (default: None)
Filter expression to genes within this genome.

count_file
str (default: 'filtered_feature_bc_matrix.h5')
Which file in the passed directory to use as the count file. Typically would be one of: 'filtered_feature_bc_matrix.h5' or 'raw_feature_bc_matrix.h5'.

library_id
str | None (default: None)
Identifier for the visium library. Can be modified when concatenating multiple adata objects.

source_image_path
str | Path | None (default: None)
Path to the high-resolution tissue image. Path will be included in .uns["spatial"][library_id]["metadata"]["source_image_path"].

sc.pl.spatial(adata, img_key = "hires",color=['total_counts', 'n_genes_by_counts'])

HDF5 Feature-Barcode Matrix Format -Software -Spatial Gene Expression -Official 10x Genomics Support HDF5 Feature-Barcode Matrix Format -Software -Spatial Gene Expression -Official 10x Genomics Supporthttps://support.10xgenomics.com/spatial-gene-expression/software/pipelines/latest/advanced/h5_matrices

Spatial Outputs -Software -Spatial Gene Expression -Official 10x Genomics Supporthttps://support.10xgenomics.com/spatial-gene-expression/software/pipelines/latest/output/spatial

cs 复制代码
#https://scanpy-tutorials.readthedocs.io/en/multiomics/analysis-visualization-spatial.html
#
#conda activate squidpy
import scanpy as sc
import numpy as np
import scipy as sp
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from matplotlib import rcParams
import seaborn as sb

import SpatialDE

plt.rcParams['figure.figsize']=(8,8)

%load_ext autoreload
%autoreload 2

#sc.read_visium() 
#
adata = sc.datasets.visium_sge('V1_Human_Lymph_Node')
adata.var_names_make_unique()
相关推荐
IT毕设梦工厂9 分钟前
计算机毕业设计选题推荐-在线拍卖系统-Java/Python项目实战
java·spring boot·python·django·毕业设计·源码·课程设计
luthane36 分钟前
python 实现average mean平均数算法
开发语言·python·算法
码农研究僧41 分钟前
Flask 实现用户登录功能的完整示例:前端与后端整合(附Demo)
python·flask·用户登录
Ylucius43 分钟前
动态语言? 静态语言? ------区别何在?java,js,c,c++,python分给是静态or动态语言?
java·c语言·javascript·c++·python·学习
凡人的AI工具箱1 小时前
AI教你学Python 第11天 : 局部变量与全局变量
开发语言·人工智能·后端·python
sleP4o1 小时前
Python操作MySQL
开发语言·python·mysql
凌不了云1 小时前
windows环境下安装python第三方包
开发语言·python
大熊程序猿1 小时前
python 读取excel数据存储到mysql
数据库·python·mysql
生椰拿铁You1 小时前
Python
python
鸽芷咕2 小时前
【Python报错已解决】python setup.py bdist_wheel did not run successfully.
开发语言·python·机器学习·bug