Skip to content

Repository files navigation

CellTFusion

Integration of immune-cell type deconvolution features and prior-knowledge networks of TFs-gene interactions to characterize potential cell states of the tumor microenvironment using bulk RNAseq data.

Pre-requisites

CellTFusion needs R >= 4.3. If you have other R version please see below for a recommendation on how to switch between multiple version of R on one computer.

For Ubuntu, install the following libraries using:

  • sudo apt-get install libcurl4-openssl-dev
  • sudo apt-get install libgmp3-dev
  • sudo apt-get install libmpfr-dev
  • sudo apt-get install -y libglpk-dev
  • In R install.packages('renv') Only if renv is not installed.

Getting started

  • Clone the repository and initialize your work inside the directory user_projects/.
  • Check Tutorial for a detailed pipeline on how to use CellTFusion.
  • Check Vignette for an explanation of the functions and parameters used along this pipeline.

Environment

CellTFusion uses renv for creating a reproducible r-environment that can be easily share between users, this, to allow reproducibility and avoid libraries conflicts. Setting it up will install the neccessary packages, along with their specific versions in an isolated environment.

For this, open the project CellTFusion.Rproj inside the user_projects/ folder and in the R console run:

# To activate the CellTFusion R environment (if you are using CellTFusion for the first time)
renv::activate()
# To download and install all the require libraries and packages (if you are using CellTFusion for the first time)
renv::restore() 

Once all packages have been installed, you can use the main script located in user_projects/ as a template to do your analysis.

Note that this is a once-step only when running CellTFusion for the first time. For the following times, you will only need to open the CellTFusion.Rproj and you are ready to go!

If you are doing other analyses that require the installation of extra libraries not present in the CellTFusion environment, you can install them as usual but after that make sure to run renv::snapshot() to update your environment.

Make sure to run renv::deactivate() when finishing running CellTFusion, to avoid conflicts whenever you start a different project.

For more information about how renv works, visit https://rstudio.github.io/renv/articles/renv.html.

Deconvolution analysis

CellTFusion performs and integrates results of immune cell type deconvolution using signatures based on gene expression and methylation data (Figure 1). It is inspired in the pipeline GemDeCan and it uses packages as immunedeconv and omnideconv to compute a variety of deconvolution methods. CellTFusion uses a consistent nomenclature across cell types (Figure 2) to simplify analysis and interpretation. Thus, if you would like to use your own deconvolution results, please make sure to follow these formats, otherwise CellTFusion will ignore them. It further uses a subgrouping based methodology to identify combinations of methods-signatures highly correlated across samples (Figure 3).

Figure 1. Immune cell type deconvolution combinations using 6 methods and 12 signatures.

Figure 2. Cell types nomenclature used in CellTFusion.

Figure 3. Deconvolution processing pipeline.

You can also include other signatures into the analysis, for this just add them as .txt into the folder user_projects/src/signatures.

Note: CibersortX ask to have docker install in your computer. Once installed, be sure to concede permission to manage docker as a non-root user. For verify this, go to the terminal and run:

docker ps

If you don't have any error, congrats you are go to go!

If you receive an error of permission, just run:

sudo groupadd docker
sudo usermod -aG docker ${USER}

Then restart your computer and try again

docker ps

Now, you should be able to run deconvolution without any problems :)

Results

All the results will be saved in the user_projects/Results/ directory of this repository.

Multiple R versions

If you are using a different R version than the one needed by CellTFusion (4.3), we invite you to get rig, a R installation manager that will allow you to easily install and work with multiple R versions.

For installation run in your terminal:

Add the rig key to your config:

`which sudo` curl -L https://rig.r-pkg.org/deb/rig.gpg -o /etc/apt/trusted.gpg.d/rig.gpg

Then add the rig repository

`which sudo` sh -c 'echo "deb http://rig.r-pkg.org/deb rig main" > /etc/apt/sources.list.d/rig.list'

Install r-rig package

`which sudo` apt update

`which sudo` apt install r-rig

Use rig add to add a new R installation and then rig rstudio to start RStudio with that R version:

Example

rig add 4.2.3
rig rstudio 4.2.3

If pak installation does not work, you can use rig add 4.2.3 --without-pak

Other commands

rig list -- List installed R versions 
rig available -- List R versions available to install.
rig default --Set default R version to run in your computer
rig rstudio --Start RStudio with the specified R version (if not specified it will use the default one)

For CellTFusion R environment, rig will detect automatically which R version it is needed and it will run it as default when opening rstudio in this project. For this, run in the terminal:

rig rstudio ~/CellTFusion/user_projects

If you would like more information about how rig works, visit https://github.com/r-lib/rig

Contributions

If you have questions or problems on how to use the pipeline we invite you to open an issue in https://github.com/VeraPancaldiLab/CellTFusion/issues

Authors

This pipeline was developed by Marcelo Hurtado in supervision of Vera Pancaldi and is part of the Pancaldi team. Currently, Marcelo is the primary maintainer of this package.

About

Integration of immune-cell type deconvolution features and prior-knowledge networks of TFs-gene interactions to characterize potential cell states of the tumor microenvironment using bulk RNAseq data.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages