2022-01-21 百分位数进行细胞过滤

样本量比较大的时候推荐使用百分位数进行细胞过滤

#百分位数法:
  ncount_q   <- quantile([email protected]$nCount_RNA,c(0.025,0.975))
  nfeature_q <- quantile([email protected]$nFeature_RNA,c(0.025,0.975))
  mt_q       <- quantile([email protected]$percent.mt,c(0.025,0.8))

可视化

pdf(paste(output,"Quality_Control_Count_Feature.pdf",sep="_"), width=8, height=6)
    p3       <- plot([email protected]$nCount_RNA,[email protected]$nFeature_RNA,pch=16,cex=0.7,bty="n")
    p3       <- p3 + abline(h=c(as.numeric(nfeature_q)[1],as.numeric(nfeature_q)[2]),v=c(as.numeric(ncount_q)[1],as.numeric(ncount_q)[2]),lty=2,lwd=2,col="red")
    print(p3)
  dev.off()

可视化后,可以看这个标准过大概过滤掉了多少细胞

创建过滤后的子集

sample.tmp.seurat <-subset(sample.tmp.seurat,subset=
nFeature_RNA>as.numeric(nfeature_q)[1] & 
nFeature_RNAas.numeric(ncount_q)[1]&
nCount_RNA

你可能感兴趣的:(2022-01-21 百分位数进行细胞过滤)