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()
相关推荐
MomentYY15 小时前
第 1 篇:Agent 到底是什么?别被概念唬住了
人工智能·python·agent
Python大数据分析@15 小时前
对你而言, Vibe Coding 的乐趣是什么?
python
WL_Aurora15 小时前
Python 算法基础篇之排序算法(一):冒泡、选择、插入
python·算法·排序算法
龙腾AI白云15 小时前
中国人工智能培训网—AI系列录播课
python·beautifulsoup
AI算法沐枫15 小时前
大一学生如何入门机器学习,深度学习,学习顺序如何?
人工智能·python·深度学习·学习·线性代数·算法·机器学习
用户67570498850215 小时前
Python 统一大业:uv 如何整合 Pip、Pyenv 和 Venv?
后端·python
SilentSamsara15 小时前
运算符重载:让自定义对象支持 +、[]、in 操作
开发语言·python·算法·青少年编程·pycharm
wuxinyan12315 小时前
工业级大模型学习之路020:LangChain零基础入门教程(第三篇):提示词工程与提示模板系统
人工智能·python·学习·langchain
U盘失踪了16 小时前
【笔记】pycharm 安装Jupyter失败
笔记·python
langzaibeijing16 小时前
AI应用哪家性价比高
大数据·人工智能·python