Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

3 watching

Forks

Latest commit

 

History

101 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Time series single-cell RNA sequecing data analysis

This repository contains the rmarkdown scripts and python notebooks used to perform the scRNA-seq data analysis presented in Argiro et al..

Data

1. Experimental data

The experimental data are available in the GEO database. They are registered under the accession number GEO: GSE232773 .

2. Atlas reference data

We used the Pijuan-Sala et al. atlas for the celltype annotation transfer. We accessed the data with the following command:

curl https://content.cruk.cam.ac.uk/jmlab/atlas_data.tar.gz > atlas_data.tar.gz
tar -zxvf atlas_data.tar.gz

Conda environment installation

Multiple conda environment were set up for all the analysis. The conda environments are available in the requirements folder. To install an environment, you can run the following command:

conda env create -f environment.yml

where environment.yml is the file name of the environment you want to install.

Seurat analysis

Before running the following command, please go to the seurat directory:

cd scripts/seurat

1. Preprocess the reference atlas of Pijuan-Sala et al.

conda activate seuratV4
Rscript -e "rmarkdown::render('atlasExploration.Rmd', output_file = '../../reports/atlasExploration.html')"

2. Run a standard scRNA-seq analysis on each dataset independently

As the analysis of a single dataset is very similar to the analysis of integrated datasets, a common .R script has been developped to run either the singleDataset_pipeline.Rmd or the combinedDatasets_pipeline.Rmd.

To investigate the parameters, enter the command in a terminal

#conda activate seuratV4		# not necessary if the environment is already activated
Rscript pipeline_launcher.R -h

The analyses of each single dataset described by the Figure 2 of the article were executed with the following commands:

#conda activate seuratV4		# not necessary if the environment is already activated

# lab_day_04
Rscript pipeline_launcher.R -N modelGastruloid -i lab_day_04 -m 7.5 --min_counts 5000 -v vst -w 2000

# lab_day_05
Rscript pipeline_launcher.R -N modelGastruloid -i lab_day_05 -m 7.5 -q 20 --min_counts 2500 -v vst -w 2000

# lab_day_06
Rscript pipeline_launcher.R -N modelGastruloid -i lab_day_06 -q 15 --min_counts 2500 -v vst -w 2000

# lab_day_11
Rscript pipeline_launcher.R -N modelGastruloid -i lab_day_11 -q 8 --min_counts 2500 -v vst -w 2000

The Supplementary Figures S3-S9 were also generated by these analyses.

3. Look for markers between Cardiomycytes clusters of day 11

The focus on the cardiomycytes described in the Figure 3.a-f of the article were created with the cardiomyocytesMarkers_day11_cl.6-8-9.Rmd script.

#conda activate seuratV4		# not necessary if the environment is already activated
Rscript -e "rmarkdown::render('cardiomyocytesMarkers_day11_cl.6-8-9.Rmd', output_file = '../../reports/cardiomyocytesMarkers_day11_lab_day_11_cl.6-8-9.html')"

4. Look for markers between clusters 16 and 18 of day 11

The previous code also generated the Figure 4.a and 4.c-m of the article. The Figure 4.n was generated with the following code:

#conda activate seuratV4		# not necessary if the environment is already activated
Rscript -e "rmarkdown::render('cluster16_zoomIn.Rmd', output_file = '../../reports/cluster16_zoomIn.html')"

5. Run a standard scRNA-seq analysis on the merged datasets

After analyzing each single dataset, we merged them using the following parameters:

#conda activate seuratV4		# not necessary if the environment is already activated
Rscript pipeline_launcher.R -i lab_4_days --min_counts 2500 -t 15 -N ciml5  -v vst -w 2000 --merge

This command allowed us to create the Figure 5.a of the article.

Prepare data for the use in cellRank and URD analysis

In order to use cellRank, a Python package, we created a dataset starting from the row data, trimmed from the cells that were removed during quality control and doublets detection. The following code realized this step:

#conda activate seuratV4		# not necessary if the environment is already activated
Rscript -e "rmarkdown::render('dataPreparation_to_PythonAnalysis.Rmd', params = list(dataset = 'lab_4_days'), output_file = '../../reports/cellrank_dataPreparation_lab_4_days.html')"

A new .Rds file is created and called 99_rawData_filtered_lab_4_days.rds.

cellRank analysis

1. Convert the .Rds file into a .h5ad file

As cellRank is a Python package, the .Rds object obtained from the previous step needs to be converted into a .h5ad object. This object will be loaded as an AnnData object.

Due to some package compatibility issues, we also need to change the environment.

conda activate convertSO_to_h5ad
cd ../cellRank/
Rscript ./convertSO_to_h5ad.R 99_rawData_filtered_lab_4_days.rds 99_rawData_filtered_lab_4_days.h5Seurat

The convertSO_to_h5ad.R script will convert the .Rds file into a .h5Seurat file. The .h5Seurat file will then be converted to a .h5ad file, readable format for Python.

2. Run the cellRank analysis

To run the Jupyter notebook, the cellRank environment was set. The Figure 5.b and Figure 5.c were obtained from the cellRank analysis.

conda activate cellRank
jupyter nbconvert --execute --to html cellRank_WOT_lab_4_days_scpMerge.nbconvert.ipynb

URD analysis

To use the commands as they are written, move to the cellRank directory. Otherwise, change the path of the scripts.

cd ../urd/					# if coming from cellRank of seurat directory

URD is an .R package that uses URD objects. First, we export the seurat object into an URD object. Then, we ran the analysis.

1. Change object format

We load the seurat object from the file 99_rawData_filtered_lab_4_days.rds. UMAP coordinates and metadata are added to the seurat object. Then, the seurat object is converted into an urd object.

#conda activate seuratV4		# not necessary if the environment is already activated
Rscript exportToURD.R

The file urdObject_lab_4_days.rds is created.

2. Run the URD analysis

Due to some package compatibility issues, we set the urd environment. We obtained the figures Fig.5d-o of the article.

conda activate urd
Rscript -e "rmarkdown::render('11.1_knnOutliers.Rmd', output_file = '../../reports/urd_lab_4_days.html')"

With this script execution, we also generated the Supplementary Figure S10.

Exploration of the integration of each single dataset with the atlas

We generated the figures of the Supplementary Figure 2 by executing the script called singleIntegrationExploration.Rmd for each dataset.

for i in lab_day_04 lab_day_05 lab_day_06 lab_day_11; do nohup Rscript -e "rmarkdown::render('singleIntegrationExploration.Rmd', params = list( dataset = '$i'), output_file = './singleIntegrationExploration_ciml5_$i.html')" ; done &

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages