I was following the code from the paper "Bioconductor workflow for single-cell RNA sequencing: Normalization, dimensionality reduction, clustering, and lineage inference". But I Encountered an error with the function assayData() during the pre-precessing step. Here is the link of the paper: https://www.bioconductor.org/help/course-materials/2017/BioC2017/Day2/Workshops/singleCell/doc/workshop.html#introduction
I went through the code as follows:
# Bioconductor
library(BiocParallel)
library(clusterExperiment)
library(scone)
library(zinbwave)
# GitHub
library(slingshot)
# CRAN
library(doParallel)
library(gam)
library(RColorBrewer)
set.seed(20)
##Parallel computing
register(SerialParam())
NCORES <- 2
mysystem = Sys.info()[["sysname"]]
if (mysystem == "Darwin"){
registerDoParallel(NCORES)
register(DoparParam())
}else if (mysystem == "Linux"){
register(bpstart(MulticoreParam(workers=NCORES)))
}else{
print("Please change this to allow parallel computing on your computer.")
register(SerialParam())
}
## Pre-processing
data_dir <- "C:/Users/kuosh/Documents/"
if (!dir.exists(data_dir)) system(sprintf('mkdir %s', data_dir))
urls = c("https://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE95601&format=file&file=GSE95601%5FoeHBCdiff%5FCufflinks%5FeSet%2ERda%2Egz",
"https://raw.githubusercontent.com/rufletch/p63-HBC-diff/master/ref/oeHBCdiff_clusterLabels.txt")
if(!file.exists(paste0(data_dir, "GSE95601_oeHBCdiff_Cufflinks_eSet.Rda"))) {
if (!dir.exists(data_dir)) system(sprintf('mkdir %s', data_dir))
download.file(urls[1], paste0(data_dir, "GSE95601_oeHBCdiff_Cufflinks_eSet.Rda.gz"))
R.utils::gunzip(paste0(data_dir, "GSE95601_oeHBCdiff_Cufflinks_eSet.Rda.gz"))
assayData(Cufflinks_eSet)$exprs = NULL
assayData(Cufflinks_eSet)$fpkm_table = NULL
assayData(Cufflinks_eSet)$tpm_table = NULL
save(Cufflinks_eSet, file='data/GSE95601_oeHBCdiff_Cufflinks_eSet_reduced.Rda')
}
The file has been successfully downloaded, but I encountered an error as : Error in assayData(CufflinkseSet)$exprs = NULL : object 'CufflinkseSet' not found. Anyone can help me? Thank you so much.
I figured out. Thank you. Your comment is very helpful. The problem is in the last sentence, I didn't specify the file directory.
Thank you so much. I will try it later. It makes sense.
It returns another error :"cannot open compressed file 'data/GSE95601oeHBCdiffCufflinkseSetreduced.Rda', probable reason 'No such file or directory". The file 'data/GSE95601oeHBCdiffCufflinkseSetreduced.Rda' was not generated. Whatever I added load(paste0(datadir, "GSE95601oeHBCdiffCufflinkseSetreduced.Rda")) or load(paste0(datadir, "GSE95601oeHBCdiffCufflinks_eSet.Rda"))