scRNAseq error source a custom function
2
0
Entering edit mode
9 months ago
camillab. ▴ 160

Hi,

Apologies if it is a stupid error/common knowledge! I am trying to integrate two scRNAseq datasets and I am following this tutorial and I have a problem in the first few lines. The tutorial tells me to source a custom function to visualize the distribution of cells of different datasets per cluster, alongside cluster sizes doing:

source("utils/custom_seurat_functions.R")

As expected it gives me this error:

Error in file(filename, "r", encoding = encoding) : 
  cannot open the connection
In addition: Warning message:
In file(filename, "r", encoding = encoding) :
  cannot open file 'utils/custom_seurat_functions.R': No such file or directory

but when I tried to create a new folder (both_test) it keeps giving me error:

Error in file(filename, "r", encoding = encoding) : 
  cannot open the connection
In addition: Warning messages:
1: In file(filename, "r", encoding = encoding) :
  'raw = FALSE' but '/Users/camilla/Desktop/boh_test' is not a regular file
2: In file(filename, "r", encoding = encoding) :
  cannot open file '/Users/camilla/Desktop/boh_test': it is a directory

I tried to follow this solution but again it doesn't`t work and it keeps giving me the same errors.What do I do wrong? Apologies if it is stupid question and thank you in advance!

Camilla

R scRNA-seq • 656 views
ADD COMMENT
4
Entering edit mode
9 months ago

It seems R can not read the file because there is no file called "custom_seurat_functions.R" in your working directory. I have downloaded that script from this link and put that in my working directory and it worked. So you can download the file using the provided link, and put that in your working directory ( you may run getwd() to see which directory is your current working directory) and proceed with your code.

ADD COMMENT
2
Entering edit mode
9 months ago
Ram 43k

These guides are often made for specific courses and need some initial tinkering to work - mostly to set up datasets and custom code.

I looked through the first part of the guide and found this GitHub link: https://github.com/cellgeni/scRNA.seq.course/

Within this, there is a directory with the utils/custom_seurat_functions.R file: https://github.com/cellgeni/scRNA.seq.course/tree/master/course_files

ADD COMMENT

Login before adding your answer.

Traffic: 1653 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