scRNA-seq question, assayData() error
1
0
Entering edit mode
Wagaa ▴ 10
@wagaa-23656
Last seen 3.9 years ago
United States

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.

assayData() scRNA-seq single cell sequencing assayData Bioconductor • 933 views
ADD COMMENT
1
Entering edit mode
Kevin Blighe ★ 3.9k
@kevin
Last seen 7 days ago
Republic of Ireland

If I am not mistaken, there seems to be a key line missing from the workshop vignette.

Please try this for the final large if statement:

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"))

  load(paste0(data_dir, "GSE95601_oeHBCdiff_Cufflinks_eSet_reduced.Rda"))

  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')
}

Kevin

ADD COMMENT
1
Entering edit mode

I figured out. Thank you. Your comment is very helpful. The problem is in the last sentence, I didn't specify the file directory.

ADD REPLY
0
Entering edit mode

Thank you so much. I will try it later. It makes sense.

ADD REPLY
0
Entering edit mode

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"))

ADD REPLY

Login before adding your answer.

Traffic: 841 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6