avatar
Articles
94
Tags
71
Categories
11
Home
archives
tags
categories
link
about
zepoch's site
Home
archives
tags
categories
link
about

zepoch's site

换一种空间组的圈细胞可视化方式
Created2024-01-16|tech技术
大多数文章在进行空间转录组细胞可视化的时候,通常会使用 square bin 或是 cellbin,但是究其展示本质,其实还是 square bin,比如下面的这种,每个细胞的呈现形式是一个 spot_size 固定为某个值的点。 但是有的文章的可视化就做的非常好,每个细胞不仅能够显示细胞形态,也能够显示细胞类型,比如这一种: 那这样子的效果要如何绘制呢?我的理解是每个细胞的label,对应圈细胞结果上的一群细胞覆盖的像素点,然后这些像素点都被打上细胞label,对圈细胞结果分析之后,可视化的时候,把每个细胞对应的label的像素点绘制上不同的颜色。 代码如下所示 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100import scanpy as...
杂聊12
Created2024-01-04|生活
昨天抽了些时间对博客进行了一些优化,主要是对 butterfly 主题进行升级,由原先的 4.1.1 升级到了现在的 4.12.0。 之后对主题进行了一些个性化的修改,包括不限于:header bar 的样式、文章的样式、代码块的样式、字体的样式;cdn 的改动,由原先的 jsdelivr 全部改为了 local,jsdelivr 由于限制头会被禁止,local 之后所有功能均可以开启了。 修复了一部分博客之前用 jsdiliver 的问题。
计算某个区域中细胞的复杂性(2)
Created2024-01-03|tech技术
上一篇帖子提到了猴脑文章中某个区域中细胞复杂性的计算,后面又看到一张图,才是发现自己的计算少了一些东西,这里补充一下。 在原文的图四中还有一个图片,讲述了较为详细的计算过程,如下图所示: 首先是复杂性的获得,我的上一篇相关的博客已经讲了,但是那篇博客的问题也是在于此,我是直接获得了复杂性,把其他的信息都丢掉了,KD树的缺陷也在于此,于是不得已在此进行重构: 1234567891011# 首先是包的引入,这里可能有很多包都是不需要的,但是我懒得删了,就这样吧import numpy as npfrom scipy.spatial.distance import cdistimport anndata as adimport pandas as pdimport matplotlib.pyplot as pltfrom collections import Counterimport seaborn as snsfrom matplotlib.ticker import FuncFormatterfrom matplotlib.colors import...
spatial Transcription region deg genemodule heatmap GO analysis
Created2024-01-03|tech
After the spatial transcriptome is annotated manually, the regional annotation information of the spatial group is obtained. At this time, we want to obtain the functional annotation information of its differentially expressed genes. There is no universal script here. I only provide an idea. ,For reference. Since most of our spatial group data is in the h5ad file format of anndata, we need to convert it into the rds file format that can be read by seurat. Here we use a convenient tool that...
空间组deg genemodule heatmap go分析
Created2024-01-03|tech技术
空间转录组通过手动划区注释之后,得到空间组的区域注释信息,这个时候我们便是想要得到其差异表达基因的功能注释信息,这里并没有能够通用的脚本,本人仅是提供一种思路,供大家参考。 由于我们的空间组的数据大都是 anndata 的 h5ad 的文件格式,所以我们需要将其转换为能够被 seurat 读取的 rds 文件格式,这里采用我们之前博客讲到的一个便捷工具 rds与h5ad的相互转换,大概代码如下所述: 12345sceasy::convertFormat('/data/*.h5ad', from="anndata", to="seurat", main_layer = 'count', outFile='/data/*.rds') 于是便是得到了相应的 rds 文件,之后我们借助 seurat...
各区域不同细胞类型的统计
Created2024-01-02|tech技术
在处理空间组的数据的时候,很多情况下,我们会根据解剖学知识给某些地方进行区域注释;这块区域的细胞类型则是通过单细胞映射空间组进行的,再进行了手动赋予区域信息以及迁移映射了细胞类型信息之后,则需要对这些进行进行一些可视化以及一些统计分析。 可视化的代码如下,为一柱状堆积图: 12345678910111213141516171819202122232425library(pheatmap)library(ggplot2)library(viridis)library(tidyverse)df = read.table('*.csv', sep = ',')colnames(df) = df[1, ]df = df[-1, ] %>% select(-1)df = df %>% group_by(region) %>% count(celltype)df$Gyrus_Sulcus = factor(df$Ribbon, levels = c('Frontal', 'Insular',...
月度消费总结1
Created2024-01-01|生活
人的消费情况,是一个很好的反映人生活状态的指标。消费情况的好坏,直接影响到人的生活质量。所以决定对自己的消费情况进行总结,以此来反映自己的生活状态。 买衣服和吃饭的消费居于较高的位置。 买衣服的消费 249(一件厚的棉裤)+349(一件很好穿的滑雪服)+199(一件薄一些的棉裤)+28.84(袜子)+ 219(一件在北京的防风的裤子和鞋子)=1044.84 吃饭消费也是居多,大概情况如下: 下馆子 248+198+67.5+115+92+55+50.5+35.5 = 861.5...
Calculate the complexity of cells in a region
Created2023-12-29|tech
In some spatial group atlas articles, we often see a picture, which is to calculate the complexity of cells in a region. We take an article published in Cell this year as an example to see how to calculate the complexity of cells in a region. The name of the article is Single-cell spatial transcriptome reveals cell-type organization in the macaque cortex, and the link to the article is: https://linkinghub.elsevier.com/retrieve/pii/S0092867423006797, there is such a picture in Figure II: The...
计算某个区域中细胞的复杂性
Created2023-12-29|tech技术
在某系空间组图谱文章中,我们经常会看到一种图片,是去计算某个区域中细胞的复杂性,我们以今年在 Cell 上发表的一篇文章为例,来看看如何计算某个区域中细胞的复杂性。文章名字为Single-cell spatial transcriptome reveals cell-type organization in the macaque cortex,文章链接为:https://linkinghub.elsevier.com/retrieve/pii/S0092867423006797 ,图二中有这么一张图片: I图的意思是不同的 Layer 中的每个细胞的复杂度分布,每个细胞的复杂的计算为,以每个细胞为圆心,200个像素为半径,画一个圆圈,计算这个圆圈中和这个细胞的类型不同的细胞类型个数。根据这个理解,我们便是可以写程序了。 12345678910# 首先是包的引入import anndata as adimport numpy as npimport pandas as pdimport scanpy as scfrom matplotlib.ticker import...
空间转录组不同binsize之间迁移注释
Created2023-12-21|技术
在做空间转录组分析的时候,我们大多数会使用两种类型的数据,一种是bin100,bin50此类的数据,还有一种则是cellbin的数据,通常我们会使用 bin100/bin50 这样子的数据去做区域的注释,而 cellbin 的数据则是通过单细胞映射空间组,得到细胞类型的数据。但是这两种数据之间的迁移注释是一个问题,因为他们的分辨率不一样,所以我们需要将他们进行迁移注释,让 cellbin 的数据注释上脑区的信息。 首先要明确的是,我们的 bin100/bin50 的数据都是由同一个空间组的 gem 之类的文件生成的,要保证其基准坐标保持不变,这样子才能进行迁移注释。 但是基准不变的话,其实从 bin100 映射到 bin50 与 bin100 映射到 cellbin 其实原理是一样的,都是将 bin100 的数据映射到 bin50 或者 cellbin 的数据上,所以我们可以直接使用 bin100 的数据去做迁移注释。 首先,bin100 的每个 spots 都有一个坐标,但是实际上 bin100 应该是要有 100100 个坐标的,所以我们就需要将其还原回到...
1234…10
avatar
zepoch
A full-stack engineer who is improving every day
Articles
94
Tags
71
Categories
11
Follow Me
Announcement
Hello!
Recent Posts
贝叶斯公式与贝叶斯估计2025-08-22
信息量-信息熵-交叉熵—KL散度2025-08-22
最大似然估计及其对损失函数的推导2025-08-21
单层VAE原理与置信下界2025-08-04
时间真的越走越快吗2025-06-14
Categories
  • llm2
  • spatial transcriptomics2
  • tech10
    • 技术6
  • 技术24
  • 杂聊4
  • 生活13
  • 生物信息1
Tags
Seurat 搜索 Promise generative model 人工智能 AI python DOM tensorflow Hexo BOM 爬虫 Spatial ID 动态规划 梯度下降 llm npm 日记 LLMs Coursera 考研日记 表观遗传学 前端 HTML Python Linux yarn genomics tech SQL 龙族 机器学习 CHATGPT 家乡 毛选 成电 Github 生活 组学 毕业
Archives
  • August 2025 4
  • June 2025 2
  • May 2025 2
  • April 2025 1
  • February 2025 2
  • January 2025 3
  • December 2024 2
  • May 2024 2
Website Info
Article Count :
94
Total Word Count :
171.3k
Unique Visitors :
Page Views :
Last Update :
©2021 - 2025 By zepoch
Framework Hexo 7.3.0|Theme Butterfly 5.3.3