Skip to content

Commit d6d8043

Browse files
committed
Minor fig up. Fixed dep_troubl. Conda in readme
1 parent a16d10f commit d6d8043

File tree

4 files changed

+49
-29
lines changed

4 files changed

+49
-29
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,4 @@ Preprocessed_Data/PDO21_UNTrep2/Pro_20200109__EGF__Test__P21_0ng_2.M__Phase.txt
158158
Preprocessed_Data/PDO21_UNTrep2/Pro_20200109__EGF__Test__P21_0ng_2.S__Phase.txt
159159
Preprocessed_Data/maria_bothtxtfcs.7z
160160
Analysis/EMD_output/UNNAMED/
161+
Allpackages_includingbaselibs.csv

README.md

+18-11
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
[![Documentation Status](https://readthedocs.org/projects/cytof-dataanalysis/badge/?version=latest)](https://cytof-dataanalysis.readthedocs.io/en/latest/?badge=latest)
22
# **Cy**TOF Si**gn**alling An**al**ysis (*CyGNAL*)
33

4-
Repository of the [Cell Communication Lab](http://tape-lab.com/) at UCL's Cancer Institute. The Cell Communication Lab studies how oncogenic mutations communicate with stromal and immune cells in the colorectal cancer (CRC) tumour microenvironment (TME). By understanding how mutations regulate all cell types within a tumour, we aim to uncover novel approaches to treat cancer.
5-
6-
In this repo we present *CyGNAL*, a pipeline for analysing mass cytometry data similar to that used in our *Nature Methods* paper: [Cell-type-specific signaling networks in heterocellular organoids](https://www.nature.com/articles/s41592-020-0737-8). With code in both Python and R, CyGNAL assumes some preliminary and inter-step processing through the platform [Cytobank](https://cytobank.org/) (although the user could in theory use any other solution for this and the gating steps).
4+
In this repository we present *CyGNAL*, a pipeline for analysing mass cytometry data similar to that used in our *Nature Methods* paper: [Cell-type-specific signaling networks in heterocellular organoids](https://www.nature.com/articles/s41592-020-0737-8). With code in both Python and R, CyGNAL assumes some preliminary and inter-step processing through the platform [Cytobank](https://cytobank.org/) (although the user could in theory use any other solution for this and the gating steps).
75

8-
Overview of the current workflow:
6+
Overview of CyGNAL (dashed blue line) within a standard mass cytometry analysis:
97
![alt text][Overview]
108

11-
[Overview]: https://github.com/TAPE-Lab/CyGNAL/blob/master/figs/flowchart_v1.png "Overview of cell identification"
9+
[Overview]: https://github.com/TAPE-Lab/CyGNAL/blob/master/figs/flowchart_v1.2.png "Overview of CyGNAL"
1210

1311
## How to use
1412

1513
Main steps in code folder. Various utilities can be found in code/utils.
1614

17-
Raw data contains sample dataset files. Pipeline can take in both FCS and .txt files (as tab-separated dataframes).
15+
### Input data
1816

17+
Raw data contains sample dataset files. Pipeline can take in both FCS and .txt files (as tab-separated dataframes).
1918

20-
*NOTE*: The dataset used in this tutorial is a down-sampled version (5,000 cells per time point, EpCAM/Pan-CK gated) of the small intestinal organoid time-course experiment described in Figure 4 of our [paper](https://www.nature.com/articles/s41592-020-0737-8). The full dataset is available through [Cytobank Community](https://community.cytobank.org/cytobank/experiments/81059). The users will need to register a free Cytobank Community account to access the project and are encouraged to clone the experiments and explore the data in further details.
19+
*NOTE*: The toy dataset used in this tutorial is a down-sampled version (5,000 cells per time point, EpCAM/Pan-CK gated) of the small intestinal organoid time-course experiment described in Figure 4 of our [paper](https://www.nature.com/articles/s41592-020-0737-8). The full dataset is available through [Cytobank Community](https://community.cytobank.org/cytobank/experiments/81059). The users will need to register a free Cytobank Community account to access the project and are encouraged to clone the experiments and explore the data in further details.
2120

2221
### A Brief Step-by-Step Tutorial
2322

23+
Brief tutotorial to run all main steps in CyGNAL with a sequential order. All console commands given assume the user is in the tool's root directory (.../CyGNAL/).
2424
<!-- (Refer to the Nature Protocols paper for more in-depth instructions) -->
2525

2626
1. **(SETUP):** Clone the repository and ensure you have all necessary software and dependencies.
27+
* We strongly encourage using [conda](https://docs.conda.io/en/latest/miniconda.html) to setup an environment from 'conda_env.yml' using `conda create -f conda_env.yml`.
2728

2829
2. **Pre-process:** Copy all the data files to the 'Raw_Data' folder and run `1-data_preprocess.py`. The output files with their antibody panel processed (i.e. measured channels decluttered, empty channels deleted, cell-index assigned) will be saved in the 'Preprocessed_Data' folder, together with a *'panel_markers.csv'* file listing all the markers measured in the given experiment.
2930

@@ -47,20 +48,20 @@ Raw data contains sample dataset files. Pipeline can take in both FCS and .txt f
4748

4849
## Dependencies
4950

50-
We strongly encourage using [conda](https://docs.conda.io/en/latest/miniconda.html) to setup an environment from 'conda_env.yml'.
51-
52-
* Python: Tested with Python v3.6 and v3.7. Used in the backbone of the workflow and most computational steps.
51+
* Python: Tested with Python v3.6, v3.7, and v3.8. Used in the backbone of the workflow and most computational steps.
5352
* `fcsparser`
5453
* `fcswrite`
5554
* `numpy`
5655
* `pandas`
5756
* `plotly`
57+
* `pynndescent`
5858
* `rpy2`
5959
* `scprep`
6060
* `sklearn`
6161
* `umap-learn`
6262

63-
* R: Tested with R v3.6.1 and RStudio v1.2.5001. Mostly used for visualisation, but also for computing the PCA.
63+
* R: Tested with v3.6.1 < R <= v4. Mostly used for visualisation, but also for computing the PCA.
64+
* `ComplexHeatmap`
6465
* `DT`
6566
* `factoextra`
6667
* `FactoMineR`
@@ -82,3 +83,9 @@ We strongly encourage using [conda](https://docs.conda.io/en/latest/miniconda.ht
8283

8384
The work here is actively being developed by Ferran Cardoso ([@FerranC96](https://github.com/FerranC96)) and Dr. Xiao Qin ([@qinxiao1990](https://github.com/qinxiao1990)).
8485
Based also on original work by Pelagia Kyriakidou.
86+
87+
We acknowledge the work of all third-parties whose packages are used in CyGNAL.
88+
89+
## About the group
90+
91+
Repository of the [Cell Communication Lab](http://tape-lab.com/) at UCL's Cancer Institute. The Cell Communication Lab studies how oncogenic mutations communicate with stromal and immune cells in the colorectal cancer (CRC) tumour microenvironment (TME). By understanding how mutations regulate all cell types within a tumour, we aim to uncover novel approaches to treat cancer.

dependency_troubleshoot.py

+30-18
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,52 @@
11
#Script to test if all necessary dependencies have been installed:
2-
import sys
3-
4-
python_packages =["fcsparser","fcswrite","rpy2","numpy","OpenSSL.version","os",
5-
"pandas","scprep","subprocess","umap","warnings"]
2+
import sys, importlib
63

4+
python_packages =["copy","fcsparser","fcswrite","itertools","numpy","pandas",
5+
"plotly","pynndescent","re","rpy2","scprep","sklearn",
6+
"subprocess","umap"]
7+
#copy, itertools, re, subprocess -> come with Python
8+
count=0
79
for i in python_packages:
810
try:
9-
import i
11+
importlib.import_module(i)
12+
count +=1
1013
except:
1114
print ("WARNING!: Python package ",i, " is not installed properly. Please install it manually")
15+
if len(python_packages)==count:
16+
print("All Python packages are installed!")
1217

1318
try:
1419
from rpy2.robjects import r
1520
except:
1621
sys.exit("ERROR: rpy2 python package is missing and we can not test for missing R packages")
1722

1823

19-
2024
r('''
2125
#Packages to use:
22-
list.of.packages <- c("DT",
26+
list.of.packages <- c(
27+
"ComplexHeatmap",
28+
"DT",
29+
"factoextra",
30+
"FactoMineR",
31+
"flowCore",
2332
"GGally",
24-
"psych",
2533
"Hmisc",
2634
"MASS",
35+
"matrixStats",
36+
"plotly",
37+
"psych",
2738
"RColorBrewer",
2839
"shiny",
29-
"tidyverse",
30-
"FactoMineR",
31-
"factoextra",
32-
"matrixStats",
33-
"plotly"
34-
)
40+
"tidyverse"
41+
)
3542
# check if pkgs are installed already, if not, install automatically:
3643
new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])]
37-
if(length(new.packages)) install.packages(new.packages, repos = "http://cran.us.r-project.org")
38-
#Load packages
39-
lapply(list.of.packages, require, character.only = TRUE)
40-
''')
44+
if(length(new.packages)) {
45+
print(paste0("WARNING!: Missing R package(s): ", new.packages))
46+
print("Attempting to install missing R package(s)...")
47+
install.packages(new.packages, repos = "http://cran.us.r-project.org")
48+
lapply(list.of.packages, require, character.only = TRUE) #Load packages
49+
} else {
50+
print("All R packages are installed!")
51+
}
52+
''')

figs/flowchart_v1.2.png

73.1 KB
Loading

0 commit comments

Comments
 (0)