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