跳转到内容

生物信息学/Seurat

维基教科书,自由的教学读本

Seurat整合不同条件、技术和物种的单细胞转录组数据

[编辑]

Seurat相关链接

[编辑]

Seurat的安装

[编辑]

Seurat官方安装页面

Seurat包发布在CRAN官方上。

安装最新版Seurat

[编辑]

安装代码:

install.packages('Seurat')
library(Seurat)

如果出现以下提示,请输入y

package which is only available in source form, and may need compilation of C/C++/Fortran: 'Seurat'
Do you want to attempt to install these from sources?
y/n:y

安装较早版本的Seurat

[编辑]
### 安装Seurat3的包
remotes::install_version("Seurat", version = "3.X.X")

### 安装Seurat2的包
source("https://z.umn.edu/archived-seurat")
# 安装remotes包 
install.packages('remotes')
# 替换'2.3.0'为你需要的版本
remotes::install_version(package = 'Seurat', version = package_version('2.3.0'))
library(Seurat)

安装开发中的Seurat

[编辑]
install.packages('remotes')
remotes::install_github(repo = 'satijalab/seurat', ref = 'develop')
library(Seurat)

Docker安装Seurat

[编辑]
docker pull satijalab/seurat:latest
FROM satijalab/seurat:latest

Seurat的函数

[编辑]

对象交互:用于与 Seurat 对象交互的函数

[编辑]
AnchorSet-class AnchorSet类
Cells(<SCTModel>) Cells(<SlideSeq>) Cells(<STARmap>) Cells(<VisiumV1>) 获取细胞名
CreateSCTAssayObject() 创建SCT Assay对象
DietSeurat() 缩小Seurat对象
FilterSlideSeq() Filter stray beads from Slide-seq puck
GetAssay() Get an Assay object from a given Seurat object.
GetImage(<SlideSeq>) GetImage(<STARmap>) GetImage(<VisiumV1>) Get Image Data
GetIntegrationData() Get integration data
GetTissueCoordinates(<SlideSeq>) GetTissueCoordinates(<STARmap>) GetTissueCoordinates(<VisiumV1>) Get Tissue Coordinates
IntegrationAnchorSet-class The IntegrationAnchorSet Class
IntegrationData-class The IntegrationData Class
ModalityWeights-class The ModalityWeights Class
Radius(<SlideSeq>) Radius(<STARmap>) Radius(<VisiumV1>) Get Spot Radius
RenameCells(<SCTAssay>) RenameCells(<SlideSeq>) RenameCells(<STARmap>) RenameCells(<VisiumV1>) Rename Cells in an Object
levels(<SCTAssay>) `levels<-`(<SCTAssay>) The SCTModel Class
SCTResults() `SCTResults<-`() Get SCT results from an Assay
STARmap-class The STARmap class
ScaleFactors() scalefactors() Get image scale factors
SetIntegrationData() Set integration data
SplitObject() Splits object into a list of subsetted objects.
TopCells() Find cells with highest scores for a given dimensional reduction technique
TopFeatures() Find features with highest scores for a given dimensional reduction technique
TopNeighbors() Get nearest neighbors for given cell
TransferAnchorSet-class The TransferAnchorSet Class
UpdateSCTAssays() Update pre-V4 Assays generated with SCTransform in the Seurat to the new SCTAssay class
VisiumV1-class The VisiumV1 class
as.CellDataSet() Convert objects to CellDataSet objects
as.Seurat(<CellDataSet>) as.Seurat(<SingleCellExperiment>) Convert objects to objectsSeurat
as.SingleCellExperiment() Convert objects to SingleCellExperiment objects
as.sparse(<H5Group>) as.data.frame(<Matrix>) Cast to Sparse
merge(<SCTAssay>) Merge SCTAssay objects
subset(<AnchorSet>) Subset an AnchorSet object

预处理:单细胞数据的预处理

[编辑]
CalculateBarcodeInflections() Calculate the Barcode Distribution Inflection
FindSpatiallyVariableFeatures() Find spatially variable features
FindVariableFeatures() Find variable features
GetResidual() Calculate pearson residuals of features not in the scale.data
HTODemux() Demultiplex samples based on data from cell 'hashing'
Load10X_Spatial() Load a 10x Genomics Visium Spatial Experiment into a objectSeurat
LoadSTARmap() Load STARmap data
LogNormalize() Normalize raw data
MULTIseqDemux() Demultiplex samples based on classification method from MULTI-seq (McGinnis et al., bioRxiv 2018)
NormalizeData() Normalize Data
Read10X() Load in data from 10X
Read10X_Image() Load a 10X Genomics Visium Image
Read10X_h5() Read 10X hdf5 file
ReadMtx() Load in data from remote or local mtx files
ReadSlideSeq() Load Slide-seq spatial data
RelativeCounts() Normalize raw data to fractions
RunMarkVario() Run the mark variogram computation on a given position matrix and expression matrix.
RunMoransI() Compute Moran's I value.
SCTransform() Use regularized negative binomial regression to normalize UMI count data
SampleUMI() Sample UMI
ScaleData() Scale and center the data.
SubsetByBarcodeInflections() Subset a Seurat Object based on the Barcode Distribution Inflection Points

差异分析

[编辑]
FindAllMarkers() Gene expression markers for all identity classes
FindConservedMarkers() Finds markers that are conserved between the groups
FindMarkers() Gene expression markers of identity classes
FoldChange() Fold Change

降维分析

[编辑]
JackStraw() Determine statistical significance of PCA scores.
L2CCA() L2-Normalize CCA
L2Dim() L2-normalization
PCASigGenes() Significant genes from a PCA
ProjectDim() Project Dimensional reduction onto full dataset
ProjectUMAP() Project query into UMAP coordinates of a reference
RunCCA() Perform Canonical Correlation Analysis
RunICA() Run Independent Component Analysis on gene expression
RunPCA() Run Principal Component Analysis
RunTSNE() Run t-distributed Stochastic Neighbor Embedding
RunUMAP() Run UMAP
ScoreJackStraw() Compute Jackstraw scores significance.

聚类

[编辑]
FindClusters() Cluster Determination
FindMultiModalNeighbors() Construct weighted nearest neighbor graph
FindNeighbors() (Shared) Nearest-neighbor graph construction
FindSubCluster() Find subclusters under one cluster

整合分析:与 Seurat v3 集成和标签传输算法相关的函数

[编辑]
AnnotateAnchors() Add info to anchor matrix
FindIntegrationAnchors() Find integration anchors
FindTransferAnchors() Find transfer anchors
GetTransferPredictions() Get the predicted identity
IntegrateData() Integrate data
IntegrateEmbeddings() Integrate low dimensional embeddings
LocalStruct() Calculate the local structure preservation metric
MapQuery() Map query cells to a reference
MappingScore() Metric for evaluating mapping success
MixingMetric() Calculates a mixing metric
PredictAssay() Predict value from nearest neighbors
PrepSCTIntegration() Prepare an object list normalized with sctransform for integration.
SelectIntegrationFeatures() Select integration features
TransferData() Transfer data

空间:与空间分辨单细胞数据分析相关的功能

[编辑]
Cells(<SCTModel>) Cells(<SlideSeq>) Cells(<STARmap>) Cells(<VisiumV1>) Get Cell Names
FilterSlideSeq() Filter stray beads from Slide-seq puck
FindSpatiallyVariableFeatures() Find spatially variable features
GetImage(<SlideSeq>) GetImage(<STARmap>) GetImage(<VisiumV1>) Get Image Data
GetTissueCoordinates(<SlideSeq>) GetTissueCoordinates(<STARmap>) GetTissueCoordinates(<VisiumV1>) Get Tissue Coordinates
ISpatialDimPlot() Visualize clusters spatially and interactively
ISpatialFeaturePlot() Visualize features spatially and interactively
LinkedDimPlot() LinkedFeaturePlot() Visualize spatial and clustering (dimensional reduction) data in a linked, interactive framework
PolyFeaturePlot() Polygon FeaturePlot
Radius(<SlideSeq>) Radius(<STARmap>) Radius(<VisiumV1>) Get Spot Radius
STARmap-class The STARmap class
ScaleFactors() scalefactors() Get image scale factors
SlideSeq-class The SlideSeq class
SpatialPlot() SpatialDimPlot() SpatialFeaturePlot() Visualize spatial clustering and expression data.
VisiumV1-class The VisiumV1 class

Mixscape:与mixscape算法相关的函数

[编辑]
CalcPerturbSig() Calculate a perturbation Signature
DEenrichRPlot() DE and EnrichR pathway visualization barplot
MixscapeHeatmap() Differential expression heatmap for mixscape
MixscapeLDA() Linear discriminant analysis on pooled CRISPR screen data.
PlotPerturbScore() Function to plot perturbation score distributions.
PrepLDA() Function to prepare data for Linear Discriminant Analysis.
RunLDA() Run Linear Discriminant Analysis
RunMixscape() Run Mixscape

可视化

[编辑]
AugmentPlot() Augments ggplot2-based plot with a PNG image.
BGTextColor() Determine text color based on background color
BarcodeInflectionsPlot() Plot the Barcode Distribution and Calculated Inflection Points
CellScatter() Cell-cell scatter plot
CellSelector() FeatureLocator() Cell Selector
CollapseEmbeddingOutliers() Move outliers towards center on dimension reduction plot
ColorDimSplit() Color dimensional reduction plot by tree split
CombinePlots() Combine ggplot2-based plots into a single plot
BlackAndWhite() BlueAndRed() CustomPalette() PurpleAndYellow() Create a custom color palette
DimHeatmap() PCHeatmap() Dimensional reduction heatmap
DimPlot() PCAPlot() TSNEPlot() UMAPPlot() Dimensional reduction plot
DiscretePalette() Discrete colour palettes from the pals package
DoHeatmap() Feature expression heatmap
DotPlot() Dot plot visualization
ElbowPlot() Quickly Pick Relevant Dimensions
FeaturePlot() Visualize 'features' on a dimensional reduction plot
FeatureScatter() Scatter plot of single cell data
GroupCorrelationPlot() Boxplot of correlation of a variable (e.g. number of UMIs) with expression data
HTOHeatmap() Hashtag oligo heatmap
HoverLocator() Hover Locator
IFeaturePlot() Visualize features in dimensional reduction space interactively
ISpatialDimPlot() Visualize clusters spatially and interactively
ISpatialFeaturePlot() Visualize features spatially and interactively
JackStrawPlot() JackStraw Plot
LabelClusters() Label clusters on a ggplot2-based scatter plot
LabelPoints() Add text labels to a ggplot2 plot
LinkedDimPlot() LinkedFeaturePlot() Visualize spatial and clustering (dimensional reduction) data in a linked, interactive framework
NNPlot() Highlight Neighbors in DimPlot
PlotClusterTree() Plot clusters as a tree
PolyDimPlot() Polygon DimPlot
PolyFeaturePlot() Polygon FeaturePlot
RidgePlot() Single cell ridge plot
SeuratTheme() CenterTitle() DarkTheme() FontSize() NoAxes() NoLegend() NoGrid() SeuratAxes() SpatialTheme() RestoreLegend() RotatedAxis() BoldTitle() WhiteBackground() Seurat Themes
SpatialPlot() SpatialDimPlot() SpatialFeaturePlot() Visualize spatial clustering and expression data.
VariableFeaturePlot() View variable features
VizDimLoadings() Visualize Dimensional Reduction genes
VlnPlot() Single cell violin plot
Intensity() Luminance() Get the intensity and/or luminance of a color

构建进化树

[编辑]
BuildClusterTree() Phylogenetic Analysis of Identity Classes

实用功能

[编辑]
AddModuleScore() Calculate module scores for feature expression programs in single cells
AggregateExpression() Aggregated feature expression by identity class
AverageExpression() Averaged feature expression by identity class
CaseMatch() Match the case of character vectors
CellCycleScoring() Score cell cycle phases
CollapseSpeciesExpressionMatrix() Slim down a multi-species expression matrix, when only one species is primarily of interenst.
CustomDistance() Run a custom distance function on an input data matrix
ExpMean() Calculate the mean of logged values
ExpSD() Calculate the standard deviation of logged values
ExpVar() Calculate the variance of logged values
FastRowScale() Scale and/or center matrix rowwise
GroupCorrelation() Compute the correlation of features broken down by groups with another covariate
LoadAnnoyIndex() Load the Annoy index file
LogVMR() Calculate the variance to mean ratio of logged values
MetaFeature() Aggregate expression of multiple features into a single feature
MinMax() Apply a ceiling and floor to all values in a matrix
PercentageFeatureSet() Calculate the percentage of all counts that belong to a given set of features
RegroupIdents() Regroup idents based on meta.data info
SaveAnnoyIndex() Save the Annoy index
GeneSymbolThesarus() UpdateSymbolList() Get updated synonyms for gene symbols
as.sparse(<H5Group>) as.data.frame(<Matrix>) Cast to Sparse

数据:Seurat数据描述

[编辑]
cc.genes Cell cycle genes
cc.genes.updated.2019 Cell cycle genes: 2019 update

便利功能:为方便用户并保持向后兼容性而包含的功能

[编辑]
DimHeatmap() PCHeatmap() Dimensional reduction heatmap
DimPlot() PCAPlot() TSNEPlot() UMAPPlot() Dimensional reduction plot
SpatialPlot() SpatialDimPlot() SpatialFeaturePlot() Visualize spatial clustering and expression data.