Seurat object create
1
0
Entering edit mode
3.5 years ago
KOUSTAV • 0

I need guidance to create Seurat object and how do I understand it properly created. I have to create any new project name for Seurate object ?I did not create any project name so far. How to create new project for Seurat object. Please help.

Seuratobj<-CreateSeuratObject(counts = ctrl_counts,project = Seuratobj,min.cells = 3,min.features = 200) Error in factor(x = project) : object 'Seuratobj' not found

Thank you in advance

Seurat RStudio • 4.5k views
ADD COMMENT
1
Entering edit mode

You can find the description in help page of CreateSeuratObject function

project: Sets the project name for the Seurat object.

so the project is the identifier assigned to your experiment. in your code it should be a string (Ex.: "Cancer scRNA-Seq", "Zebrafish Embryonic Development" etc.) and you specified it without a quote, so R is considering it as an object and not as a string.

code from this tutorial shows an example of how to specify the project for Seurat object

pbmc <- CreateSeuratObject(counts = pbmc.data, project = "pbmc3k", min.cells = 3, min.features = 200)
ADD REPLY
0
Entering edit mode

Thank you Nitin for your help. Project name here is the main folder generated by cell ranger (name :60 - 502323136).I did not change it. Some output from beginning I have attached here. Could you please give your input to solve the problem.

> Read10X(data.dir ="~/60-502323136/01_Analysis/nacZT0_31032021/raw_feature_bc_matrix")
31053 x 6794880 sparse Matrix of class "dgCMatrix"
   [[ suppressing 34 column names ‘AAACCCAAGAAACACT-1’, ‘AAACCCAAGAAACCAT-1’, ‘AAACCCAAGAAACCCA-1’ ... ]]
   [[ suppressing 34 column names ‘AAACCCAAGAAACACT-1’, ‘AAACCCAAGAAACCAT-1’, ‘AAACCCAAGAAACCCA-1’ ... ]]

Xkr4    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
Gm1992  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
Gm37381 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
Rp1     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
Sox17   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
Gm37323 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
Mrpl15  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
Lypla1  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
Gm37988 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
Tcea1   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
Rgs20   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
Gm16041 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
Atp6v1h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
Oprk1   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
Npbwr1  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......

 ..............................
 ........suppressing 6794846 columns and 31024 rows in show(); maybe adjust 'options(max.print= *, width = *)'
 ..............................
   [[ suppressing 34 column names ‘AAACCCAAGAAACACT-1’, ‘AAACCCAAGAAACCAT-1’, ‘AAACCCAAGAAACCCA-1’ ... ]]

Vmn1r186       . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
AC102264.1     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
AC125149.3     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
AC125149.5     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
AC125149.1     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
AC125149.2     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
AC125149.4     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
AC234645.1     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
AC168977.2     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
AC168977.1     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
AC149090.1     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
CAAA01118383.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
Vmn2r122       . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
CAAA01147332.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
> 
> 
> ctrl_counts <-Read10X(data.dir ="~/60-502323136/01_Analysis/nacZT0_31032021/raw_feature_bc_matrix")
> ctrl <- CreateSeuratObject(counts =  ctrl_counts,min.cells = 3, min.features = 200)
> Seuratobj<-CreateSeuratObject(counts = ctrl_counts,project = Seuratobj,min.cells = 3,min.features = 200)
Error in factor(x = project) : object 'Seuratobj' not found
>  Seuratobj<CreateSeuratObject(Count=ctrl_counts,project = 60-502323136,min.cells=3,min.features=200)
Error: object 'Seuratobj' not found
> 60-502323136<-CreateSeuratObject(Count=ctrl_counts,project = 60-502323136,min.cells=3,min.features=200)
Error in CreateSeuratObject(Count = ctrl_counts, project = 60 - 502323136,  : 
  argument "counts" is missing, with no default
ADD REPLY
0
Entering edit mode

Try this,

Seuratobj<-CreateSeuratObject(counts = ctrl_counts,project = "60-502323136",min.cells = 3,min.features = 200)

To save the Seurat object you can use

saveRDS(Seuratobj, "Seuratobj.rds")

This is standard R command and you can get an answer by googling this.

ADD REPLY
1
Entering edit mode
3.5 years ago
ATpoint 85k

The project argument takes a character, so just a name you want to give the project, and as such it must be in quotation marks like "my_project". If you give it a variable then the name must be in the variable. If the variable does not exist then you get this error.

ADD COMMENT
0
Entering edit mode

So, the folder name created by cell ranger is 60 - 502323136. If I want to same Seuratobject in this folder what should be the command?

ADD REPLY
0
Entering edit mode

Sorry it will be "If I want to Save Seuratobject in this folder what should be the command?"

ADD REPLY

Login before adding your answer.

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