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()
相关推荐
互联网杂货铺2 分钟前
python+pytest 接口自动化测试:参数关联
自动化测试·软件测试·python·测试工具·职场和发展·测试用例·pytest
筱涵哥7 分钟前
Python默认参数详细教程:默认参数位置错误,动态默认值,__defaults__属性,动态默认值处理,从入门到实战的保姆级教程
开发语言·python
yzztin26 分钟前
Python 导包和依赖路径问题
python
pk_xz12345626 分钟前
介绍如何基于现有的可运行STGCN(Spatial-Temporal Graph Convolutional Network)模型代码进行交通流预测的改动
python
用户81344118236136 分钟前
Python基础
python
ZHOU_WUYI1 小时前
旋转位置编码 (2)
pytorch·python·深度学习
程序员~小强1 小时前
让知识触手可及!基于Neo4j的机械设备知识图谱问答系统
人工智能·python·django·知识图谱·neo4j
DanCheng-studio2 小时前
智科 机器学习毕业设计题目指导
python·毕业设计·毕设
java1234_小锋2 小时前
一周学会Flask3 Python Web开发-SQLAlchemy定义数据库模型
python·flask·sqlalchemy·flask3
Light602 小时前
CSnakes vs Python.NET:跨语言集成的巅峰对决与架构解密
python·性能优化·.net·跨语言集成·双向互操作