Seurat R 安装及单细胞数据处理

本文介绍了Seurat R包在安装时遇到的权限问题及其解决方法,详细展示了如何读取和合并单细胞数据,并保存为Seurat对象的rds或h5ad格式。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. … permission is denied.

Solution: Close R, and run it with administrator.

From: https://cloud.tencent.com/developer/article/1606588

2. Read Data

library(Seurat)
fs=list.files('./','^GSM')
library(stringr)
samples=str_split(fs,'_',simplify = T)[,1]
lapply(unique(samples),function(x){
  y=fs[grepl(x,fs)]
  folder=paste(str_split(y[1],'_',simplify = T)[,2:3],collapse = '')
  dir.create(folder,recursive = T)
  file.rename(y[1],file.path(folder,"barcodes.tsv.gz"))
  file.rename(y[2],file.path(folder,"genes.tsv.gz"))
  file.rename(y[3],file.path(folder,"matrix.mtx.gz"))
})

Then
unzip all files under the subfolders

ls */*gz|xargs  gunzip
folders=list.files('./')
folders
library(Seurat)
sceList = lapply(folders,function(folder){
    
  Creat
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值