[8e0848]: / preprocessing / Preprocessing_scRNA_CLL_GSE111014.R

Download this file

22 lines (16 with data), 975 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
library(Matrix)
library(Seurat)
library(dplyr)
source("/research/users/ppolonen/git_home/common_scripts/scRNA/functions.scRNA.analysis.R")
setwd("/research/groups/sysgen/PROJECTS/HEMAP_IMMUNOLOGY/petri_work/scRNA")
name="CLL_D0"
# DATA:
m=data.matrix(Matrix::readMM("/research/groups/biowhat_share/public_data/scRNAseq/GSE111014_CLL/GSE111014_matrix.mtx"))
colnames(m)=scan("/research/groups/biowhat_share/public_data/scRNAseq/GSE111014_CLL/GSE111014_barcodes.tsv", "a")
genes=data.table::fread("/research/groups/biowhat_share/public_data/scRNAseq/GSE111014_CLL/GSE111014_genes.tsv", data.table = F, header = F)[,2]
rownames(m)=make.unique(genes)
# filter
m=m[,grepl("d0", colnames(m))]
# using the function:
batch=gsub(".*.-seq_", "", colnames(m))
test1=sc.data.analysis(scmat = m, regress.cell.label = batch, batch.correction.method = "MNNcorrect", name="CLL_D0", nr.pcs = 22, check.pcs=F, plot.umap = T, nFeature.min = 200, nFeature.max = 4000, percent.mitoDNA = 10)