全网最详细单细胞保姆级分析教程(一) ---pbmc

VIP全网最详细单细胞保姆级分析教程(一) ---pbmc
通过观察热图,可以了解不同细胞在主成分上的分布情况,以及主成分与细胞特征之间的关系。数据归一化是数据分析中的常见步骤,旨在消除数据集中不同特征之间的量纲差异,并使它们在相同的尺度上进行比较。函数会根据指定的主成分维度计算数据点之间的距离,并找到每个数据点的邻居。函数会根据数据点之间的相似性将其分组到不同的聚类中。数据缩放是数据分析中的常见步骤,旨在将数据的特征值调整到相似的范围,以避免某些特征对分析结果的过度影响。通过可视化维度载荷,可以了解哪些特征对主成分的形成起到了重要作用,以及不同特征之间的相关性。
开通可读全文 ·6.7k 人阅读
最低0.47元/天 解锁文章

各位读者,好久不见,我又归来了,之后的一段时候我将以Rstudio分析单细胞的RNA-seq流程为主,希望各位读者朋友多多支持!

1. pbmc单样本分析

1.包的加载

library(multtest)
library(dplyr)
library(Seurat)
library(patchwork)
library(R.utils)

2. 清除环境变量

rm(list = ls))

3. 下载示例数据并加压

download.file(url='https://cf.10xgenomics.com/samples/cell/pbmc3k/pbmc3k_filtered_gene_bc_matrices.tar.gz','~/Desktop/pbmc/mypbmc.gz')
untar(gunzip("mypbmc.gz"))

4.读取数据

pbmc.data <- Read10X(data.dir = '~/Desktop/pbmc/filtered_gene_bc_matrices/hg19')

请添加图片描述

5.创建seurat对象

pbmc <- CreateSeuratObject(counts = pbmc.data,project = 'pbmc3k',min.cells = 3,min.features = 200)

请添加图片描述

6. 获取 RNA 测序数据的计数矩阵

counts_matrix <- GetAssayData(pbmc, assay = "RNA", slot = "counts")

7. 质控及数据可视化

添加线粒体基因的百分比,用作评估细胞质量的指标之一

pbmc[['percemt.mt']] <- PercentageFeatureSet(pbmc,pattern = 'MT-')
head(pbmc@meta.data)
#                  orig.ident nCount_RNA nFeature_RNA percemt.mt
# AAACATACAACCAC-1     pbmc3k       2419          779  3.0177759
# AAACATTGAGCTAC-1     pbmc3k       4903         1352  3.7935958
# AAACATTGATCAGC-1     pbmc3k       3147         1129  0.8897363
# AAACCGTGCTTCCG-1     pbmc3k       2639          960  1.7430845
# AAACCGTGTATGCG-1     pbmc3k        980          521  1.2244898
# AAACGCACTGGTAC-1     pbmc3k       2163          781  1.6643551

8. 数据可视化

8.1 小提琴图
VlnPlot(pbmc,features = c('nCount_RNA','nFeature_RNA','percemt.mt'),pt.size = 0)

请添加图片描述

FeatureScatter(pbmc,feature1 = 'nCount_RNA',feature2 = 'nFeature_RNA')
FeatureScatter(pbmc,feature1 = 'nCount_RNA',feature2 = 'percemt.mt')

请添加图片描述

9. 数据归一化

VIP seurat提取表达矩阵_(单细胞-SingleCell)Seurat流程文献复现 单细胞项目:来自于30个病人的49个组织样品,跨越3个治疗阶段Therapy-Induced Evolution of Human Lung Cancer Revealed by Single-Cell RNA Sequencing这篇教程我将分为四个阶段完整的阐述单细胞的主流的下游分析流程数据预处理(数据准备阶段)seurat 基础分析免疫细胞识别inferCNV 的实现先来第一部分数据预处理这... 开通可读全文·1.5w 阅读·16 点赞·48 收藏 阅读全文

相关推荐

单细胞测序之基本的数据处理基本流程

参考文献: Armand EJ, Li J, Xie F, Luo C, Mukamel EA. Single-Cell Sequencing of Brain Cell Transcriptomes and Epigenomes. Neuron. 2021 Jan 6;109(1):11-26.doi: 10.1016/j.neuron.2020.12.010. PMID: 33412093; PMCID: PMC7808568. Amezquita, R.A., Lun, A.T.L., Bech.

weixin_40640700的博客 1万+

Seurat 单细胞转录组测序数据分析教程(三)——python(scanpy)

文章参考至,做了一个更详细的解读。本教程探讨了 scanpy 的可视化可能性,分为三个部分:嵌入的散点图(例如 UMAP、t-SNE)使用已知标记基因鉴定簇差异表达基因的可视化在本教程中,我们将使用来自 10x 的数据集,其中包含来自PBMC的 68k 个细胞。Scanpy 在其分布中包括该数据集的简化样本,该数据集仅包含 700 个细胞和 765 个高度可变的基因。该数据集已经过预处理和 UMAP 计算。在本教程中,我们还将使用以下文献标记:B细胞:CD79A、MS4A1。

coffeeii的博客 5833

单细胞分析(Signac): PBMC scATAC-seq 聚类

然而,仅凭监督分析来进一步细分这些细胞类型是有难度的。这里,我们将采用一种简便的方法,即累加与基因本体及其启动子区域相交的片段(我们也推荐使用Cicero工具,它能够实现类似的目标,并且我们提供了一个指南,展示如何在Signac工作流中运行Cicero)。因此,在后续分析中,我们将排除这个主成分,目的是避免基于细胞的总测序深度来进行细胞分组,而应依据细胞在特定细胞类型峰值上的可访问性模式来进行分组。通常,潜在语义索引(LSI)的第一个主成分反映的是测序的深度(即技术层面的变异),而非生物学上的变化。

冷冻工厂 1139

单细胞分析Seurat保姆级教程:PBMC 3K从质控到细胞注释(附代码与常见报错)

本文以10X PBMC 3K数据为例,手把手演示从质控到细胞注释的Seurat v5全流程:包含环境配置、数据读入、质控(三指标阈值设定)、标准化、高变基因筛选、缩放、PCA降维(肘部图选PC数)、聚类(resolution调参)及注释。附代码与10个常见报错解决方案,助新手跨越v4→v5迁移陷阱,实现可复现分析。

R语言教程 359

新手避坑指南:用Seurat分析PBMC单细胞数据时,这5个参数千万别乱动

本文为单细胞分析新手提供了使用Seurat处理PBMC数据时的5个关键参数优化指南,涵盖数据预处理、降维聚类等核心步骤。重点解析了FindVariableFeatures的nfeatures、FindClusters的resolution等易错参数,帮助用户避免常见陷阱,提升单细胞数据分析质量与效率。

weixin_30924087的博客 281

跟着Seurat 官网学单细胞转录组分析

在大家进行了一段时间的与学习后,我们开启单细胞测序数据的学习。接下来的教程中,我们将以为基础,从数据预处理、聚类分析到可视化的完整流程,深入讲解如何从原始数据中提取有意义的生物学信息。我们将分析免费提供的外周血单核细胞 (PBMC) 数据集,这一数据集包含了,使用进行测序,数据质量可靠,非常适合初学者学习和练习。获取数据:(https://cf.10xgenomics.com/samples/cell/pbmc3k/pbmc3k_filtered_gene_bc_matrices.tar.gz)

qq_42275724的博客 1430

10X单细胞基因集打分实战:AUCell、UCell、singscore三大方法保姆级教程

本文详细介绍了10X单细胞基因集打分的三大方法:AUCell、UCell和singscore,提供从原理到实践的保姆级教程。通过具体代码示例和参数优化建议,帮助研究者高效分析单细胞转录组数据,揭示细胞功能状态和通路活性,适用于复杂生物系统的深入研究。

numpy6sculptor的博客 865

单细胞测序新手必看:用Scanpy搞定PBMC数据分析全流程(附代码)

本文为单细胞测序新手提供了一份完整的PBMC数据分析指南,使用Python工具Scanpy从数据加载、质量控制到降维可视化和细胞注释全流程详解。通过实际代码示例,帮助读者掌握单细胞数据分析的核心技术,特别适合生物信息学入门者学习免疫细胞组成分析。

weixin_28523493的博客 410

从PBMC3K到你的数据:Scanpy单细胞分析完整流程迁移实战(附Seaborn版本踩坑记录)

本文详细介绍了如何将Scanpy单细胞分析流程从PBMC3K教程迁移到真实数据,包括环境配置、跨物种数据加载、质量控制调整和通用化改造策略。特别针对非模式生物数据提供了线粒体基因识别和QC阈值动态调整的实用方案,帮助研究者解决单细胞分析中的常见问题。

weixin_30955617的博客 455

su03t语音模块烧录识别不出问题解决方法

su03t语音sdk烧录无法识别问题

weixin_49387645的博客 6393

mfcc总结,这个mel三角滤波器分组到底是如何起作用的呢?

先看fft频谱图(这是4096字节取样fft计算,横轴频率是从0到512,后边意义不大,未取,纵轴是振幅),那些我随便画的蓝色线,你有什么联想?: 再看,这绿色线,是否有一种上升后,便逐渐式微的感觉,都是三角形的,这或许也是mel当初和绝大多数人看到的: 如果在振幅上加上一条限制的黑线(振幅门槛限制),黑色线以下很多频率就没有意义了,你看,有用的频率连一半(512/2=256)都占不到...

ganggangwawa的博客 9913

一文读懂,WMS仓库管理系统模块功能

对于仓库管理人员来说,仓储管理是一件需要十分负责、又精细化的工作。

深蓝易网的博客 5224

【理论&实战篇】大模型RAG技术详解(一)-基础篇

RAG的初衷是为了增强大模型的事实性、时效性,减少幻觉,引入专业知识优化生成回复,是一种结合了信息检索技术与语言生成模型的人工智能技术。通过,并将其作为提示(Prompt)输入给大模型(LLM),来。

qq_41375680的博客 379

[Unity实战]热更新如何预防过度裁剪

假设你现在有一个游戏客户端,客户端只打包了入口场景,游戏场景都存放在了AB包。

u012587406的博客 1610

汇川AM系列ethercat控制伺服的使用说明(含转矩模式)

本文以一个实际例子,介绍ethercat伺服驱动器的工作原理,以及在汇川AM系列PLC中,如何点动、定位、速度、转矩控制ethercat伺服。

qq_34047402的博客 5123

基于R-CNN深度学习的常见手势识别系统:数据集、模型和UI界面的完整实现

卷积神经网络(CNN):用于从图像中提取特征。区域提议网络(RPN):用于生成可能包含手势的候选区域。:将候选区域调整为固定大小,并进行进一步的分类和回归。接下来,我们需要加载一个预训练的Faster R-CNN模型,并对其进行微调。我们将使用# 加载预训练的Faster R-CNN模型# 获取分类器的输入特征数# 替换分类器头部,设置为我们数据集的类别数(假设有5类手势)

YOLO 1001

生成模型实战 | 基于Transformer生成音乐

本文介绍了基于Transformer架构的音乐生成方法,将音乐视为一系列事件序列进行处理。与将音乐表示为多维图像的MuseGAN不同,该方法使用类似GPT的仅解码器模型,基于先前事件预测下一个音乐事件。模型使用MIDI格式的钢琴音乐数据,通过分词处理将音符转换为note-on、note-off、time-shift和velocity四种事件类型,共388个独特词元,映射为索引序列后输入网络。训练完成后,可通过调整温度参数控制生成音乐的新颖性,从而创作出风格类似训练数据且连贯逼真的音乐作品。

盼小辉丶的博客 6030

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

上一篇: 最详细爬虫零基础教程12——某网评论爬取教程
下一篇: 全网最详细单细胞保姆级分析教程(二) --- 多样本整合
莘薪
博客等级 码龄4年 2776粉丝 90原创
评论 4
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

莘薪

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址