library(DropletUtils) library(Seurat) # set up data/raw folder to host raw 10x data ifelse(!dir.exists(paste(getwd(), "data/raw", sep = "/")), dir.create(paste(getwd(), "data/raw", sep = "/"), showWarnings = FALSE, recursive = TRUE), FALSE) raw_path <- paste(getwd(), "data/raw", sep = "/") # set up data/proc folder to host seurat/bioc objects ifelse(!dir.exists(paste(getwd(), "data/proc", sep = "/")), dir.create(paste(getwd(), "data/proc", sep = "/"), showWarnings = FALSE, recursive = TRUE), FALSE) proc_path <- paste(getwd(), "data/proc", sep = "/") # prepare params for bash excution sample_name <- params$sample_name Sys.setenv(fd_s3 = params$fd_s3) Sys.setenv(raw_path = raw_path) Sys.setenv(proc_path = proc_path)
system("aws s3 sync $fd_s3 $raw_path --region us-east-2")
gunzip "${raw_path}/barcodes.tsv.gz" gunzip "${raw_path}/matrix.mtx.gz" gunzip "${raw_path}/features.tsv.gz" mv "${raw_path}/features.tsv" "${raw_path}/genes.tsv"
# create objects folder under raw folder sce_obj <- read10xCounts(raw_path) save(sce_obj, file = paste(paste(proc_path, "/", sep = ""), paste(sample_name, "sce_raw.RData", sep="_"), sep = "")) rm(sce_obj)
system("aws s3 sync $fd_s3 $raw_path --region us-east-2")
dat <- Read10X(data.dir = raw_path) rownames(x = dat[["Antibody Capture"]]) <- gsub(pattern = "_TotalSeqC", replacement = "", x = rownames(x = dat[["Antibody Capture"]])) se_obj <- CreateSeuratObject(counts = dat[["Gene Expression"]]) se_obj[["ADT"]] <- CreateAssayObject(counts = dat[["Antibody Capture"]][, colnames(se_obj)]) save(se_obj, file = paste(paste(proc_path, "/", sep = ""), paste(sample_name, "seurat_raw.RData", sep = "_"), sep = "")) rm(dat, se_obj)
rm "${raw_path}"/*
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.