Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I use ICELLNET when bulk RNA-seq data of both Central and Partner cell types are coming from the same dataset ? #12

Closed
hussghamlouch opened this issue May 6, 2023 · 1 comment

Comments

@hussghamlouch
Copy link

Hi there,
Thank you for developing such a great tool. I am studying intercellular communication between two cell types for which I have RNA-Seq transcriptional profiles. I am defining one cell type as "Central Cell" and the other as "Partner Cell". How can I implement ICELLNET tool to use my own RNA-Seq datasets in this context? Could you please provide an adapted script for this purpose?
Thank you.
Hussein

@lmassenet-regad
Copy link
Collaborator

Hi Hussein,
Thank you for your message. You can use your dataset both for the central cell and the partner cells, you just need to define them separately. You can find below a script that you can use to compute the communication scores. You can also see the CAF vignette if you want additional information regarding the graphical representation of the score.

# Libraries
library(BiocGenerics)
library("org.Hs.eg.db")
library("hgu133plus2.db")
library(jetset)
library(ggplot2)
library(dplyr)
library(icellnet)
library(gridExtra)

# Load and select database
db=as.data.frame(read.csv(curl::curl(url="https://raw.githubusercontent.com/soumelis-lab/ICELLNET/master/data/ICELLNETdb.tsv"), sep="\t",header = T, check.names=FALSE, stringsAsFactors = FALSE, na.strings = ""))
db.name.couple=name.lr.couple(db, type="Family")
head(db.name.couple)

# Load bulk RNAseq data
data=as.data.frame(read.csv("~/Desktop/matrix_gene_expression.csv", sep=",", header = T, check.names=FALSE, stringsAsFactors = FALSE, na.strings = "")) 
rownames(data)=data$Symbol # If gene name not already set up as rownames
#make sure colnames(data) give name of replicates

# Load target file with metadata info.
target=as.data.frame(read.csv("~/Desktop/target.csv", sep=",", header = T, check.names=FALSE, stringsAsFactors = FALSE, na.strings = "")) 

# Data scaling
data.scaled=gene.scaling(data = data, n=1, db = db)

# data selection
CC.data.selection=target$ID[which(target$Cell_type=="cell_central")] #should give a vector with name of replicates to consider for central cell
PC.data.selection=target$ID[which(target$Cell_type%in% c("cell_1", "cell_2"))] #should give a vector with name of replicates to consider for partner cell                                  
                                   
my_Central_Cell_data=data.scaled[, CC.data.selection]
my_Partner_Cell_data = data.scaled[, PC.data.selection]

#compute communication score
score.computation.1= icellnet.score(direction="out", PC.data=my_Partner_Cell_data, CC.data= my_Central_Cell_data,  PC.target = target, PC=c("cell_1", "cell_2"),  CC.type = "RNAseq",  PC.type = "RNAseq",  db = db) 
score1=as.data.frame(score.computation.1[[1]])
lr1=score.computation.1[[2]] 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants