Question: [SOLVED] How to build a table with gene expression per cell type with Seurat ?
1
gravatar for Evan
8 months ago by
Evan50
France
Evan50 wrote:

Hello, I'm new on single-cell analysis and the use of deconvolution methods.

I would like to create my own signature matrix from single-cell rna data to use it in Cibersortx as a reference profile. Currently, I'm using Seurat to cluster my cells in cell type following this tutorial : https://satijalab.org/seurat/v3.1/pbmc3k_tutorial.html

Is it possible to get a table with in column the cells labeled with their cell type and in rows the genes with their expression in each cells (Count/RPKM/TPM ?).

In fact I would like a table which look like the picture below to use it as single cell reference sample file to build a signature matrix file to use in Cibersortx.

Reference sample file format

I would be very grateful if someone could explain me how to do it. Thank you.

ADD COMMENTlink modified 8 months ago • written 8 months ago by Evan50
3
gravatar for Evan
8 months ago by
Evan50
France
Evan50 wrote:

Thank you for your answers. I succeed to extract two tables, one with two colums with cell sequence (UMI) associated with its cell label (CD4, CD8, DC etc...) and another with gene expression per cell sequence. In case if someone is getting the same problem I use this command in R to write it in two files :

Cell Sequence and Cell Label (pmbc is my data)

write.table(pbmc@active.ident, file='Cells_label.tsv', quote=FALSE, sep='\t', col.names = TRUE)

Gene counts per cell

write.table(pbmc@assays[["RNA"]]@counts, file='Gene_Count_per_Cell.tsv', quote=FALSE, sep='\t', col.names = TRUE)

After I used a little script in Python to merge these two files getting Gene Counts per cell labeled with their cell type :) (I could surely do it in R but my knowledge in this language is limited).

Visit this page it explains how to extract some interessant content from seurat object : https://satijalab.org/seurat/v3.0/interaction_vignette.html

ADD COMMENTlink modified 7 months ago • written 8 months ago by Evan50
1
gravatar for hirad.alipanah
8 months ago by
hirad.alipanah10 wrote:

Use meta.data of the seurat object to get the number of counts and save that using write.csv to get your table

ADD COMMENTlink written 8 months ago by hirad.alipanah10

Thank you, it helped me a lot :)

ADD REPLYlink written 8 months ago by Evan50
1
gravatar for igor
8 months ago by
igor11k
United States
igor11k wrote:

Use the AverageExpression() function to get the averaged feature expression by identity class.

ADD COMMENTlink written 8 months ago by igor11k

Thank you I will try this solution :)

ADD REPLYlink written 8 months ago by Evan50
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1836 users visited in the last hour