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()
相关推荐
Είναι η κοπέλα4 分钟前
显存计算与模型选择:你的显卡能跑多大的模型
人工智能·pytorch·python·开源·conda
ROSF68689 分钟前
2026 仿石漆乳液供应商:市场布局与行业发展态势梳理
大数据·人工智能·python
青少儿编程课堂17 分钟前
AC自动机多模式串匹配精讲:校园关键词巡检实战解析
c++·python·算法·bfs·信息学竞赛
hhzz40 分钟前
【YOLO 入门到精通 04】理解任务与模型家族:7 大 CV 任务与 YOLO26 选型指南
人工智能·python·深度学习·yolo·计算机视觉
Escalating_xu1 小时前
【Python】使用库:标准库、第三方库、pip、项目实战与程序打包
java·python·pip
水獭比特1 小时前
Agent 工具审批不止一个按钮:用 v0.22.1 复盘入口、恢复和副作用
人工智能·python
苦瓜打怪兽1 小时前
leetcode 热题100(11. 盛最多水的容器)
python·算法·leetcode
砚底藏山河1 小时前
量化实战:回测数据底座快照与版本管理进阶
java·大数据·python·金融·maven
“AI国潮设计-小江”1 小时前
《Python+SDXL实战:用ControlNet批量生成“英歌舞麻将糕”IP,附自动化脚本与商用思路》
开发语言·人工智能·python·prompt·aigc
逗脑IDE3 小时前
零基础学ESP32:RFID无线射频卡——让ESP32拥有“刷卡“能力!
开发语言·网络·人工智能·python·esp32·硬件开发