Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
126 |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
127 |
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
--------------------------------------------------------------------------------
/docs/articles/celltalker_files/figure-html/setup-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/arc85/celltalker/6edd610bf558bb1777590f8a6b02711ef7d0fc47/docs/articles/celltalker_files/figure-html/setup-1.png
--------------------------------------------------------------------------------
/docs/articles/celltalker_files/figure-html/setup-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/arc85/celltalker/6edd610bf558bb1777590f8a6b02711ef7d0fc47/docs/articles/celltalker_files/figure-html/setup-2.png
--------------------------------------------------------------------------------
/docs/articles/celltalker_files/header-attrs-2.9/header-attrs.js:
--------------------------------------------------------------------------------
1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to
2 | // be compatible with the behavior of Pandoc < 2.8).
3 | document.addEventListener('DOMContentLoaded', function(e) {
4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child");
5 | var i, h, a;
6 | for (i = 0; i < hs.length; i++) {
7 | h = hs[i];
8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6
9 | a = h.attributes;
10 | while (a.length > 0) h.removeAttribute(a[0].name);
11 | }
12 | });
13 |
--------------------------------------------------------------------------------
/docs/articles/consistent_interactions_files/figure-html/setup-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/arc85/celltalker/6edd610bf558bb1777590f8a6b02711ef7d0fc47/docs/articles/consistent_interactions_files/figure-html/setup-1.png
--------------------------------------------------------------------------------
/docs/articles/consistent_interactions_files/figure-html/unnamed-chunk-2-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/arc85/celltalker/6edd610bf558bb1777590f8a6b02711ef7d0fc47/docs/articles/consistent_interactions_files/figure-html/unnamed-chunk-2-1.png
--------------------------------------------------------------------------------
/docs/articles/consistent_interactions_files/figure-html/unnamed-chunk-2-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/arc85/celltalker/6edd610bf558bb1777590f8a6b02711ef7d0fc47/docs/articles/consistent_interactions_files/figure-html/unnamed-chunk-2-2.png
--------------------------------------------------------------------------------
/docs/articles/consistent_interactions_files/figure-html/unnamed-chunk-3-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/arc85/celltalker/6edd610bf558bb1777590f8a6b02711ef7d0fc47/docs/articles/consistent_interactions_files/figure-html/unnamed-chunk-3-1.png
--------------------------------------------------------------------------------
/docs/articles/consistent_interactions_files/header-attrs-2.9/header-attrs.js:
--------------------------------------------------------------------------------
1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to
2 | // be compatible with the behavior of Pandoc < 2.8).
3 | document.addEventListener('DOMContentLoaded', function(e) {
4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child");
5 | var i, h, a;
6 | for (i = 0; i < hs.length; i++) {
7 | h = hs[i];
8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6
9 | a = h.attributes;
10 | while (a.length > 0) h.removeAttribute(a[0].name);
11 | }
12 | });
13 |
--------------------------------------------------------------------------------
/docs/articles/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Articles • celltalker
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
Check out the core functionality of the package in the vignette under “Get Started”!
88 |
If you have groups of samples with replicates in each group (e.g. disease vs control) and want to identify interactions that are statistically different between groups, check out the “Identify significantly different interactions across groups with replicate samples” vignette under Articles.
Seurat object containing expression levels across all
153 | cells and sample types
154 |
155 |
156 |
interaction_stats
157 |
Tibble from celltalk function, usually filtered to
158 | the top significant ligand and receptor interactions of interest
159 |
160 |
161 |
sample_replicates
162 |
Name of the meta.data column in a Seurat object that
163 | has the samples of the individual replicate samples
164 |
165 |
166 |
sample_groups
167 |
Name of the meta.data column in a Seurat object that
168 | has the name of the sample group
169 |
170 |
171 |
metadata_grouping
172 |
Name of the meta.data column in a Seurat object that
173 | has the name of the groups of cells to evaluate (e.g. "cell_types" containing
174 | previously identified cell types)
175 |
176 |
177 |
ligand
178 |
Name of the ligand in the ligand/receptor pair of interest
179 |
180 |
181 |
receptor
182 |
Name of the receptor in the ligand/receptor pair of interest
183 |
184 |
185 |
cell_type1
186 |
Name of the cell type expressing the ligand in the ligand/
187 | receptor pair of interest
188 |
189 |
190 |
cell_type2
191 |
Name of the cell type expressing the receptor in the ligand/
192 | receptor pair of interest
193 |
194 |
195 |
196 |
Value
197 |
198 |
A ggplot boxplot of the joint mean for a ligand/receptor interaction
199 | in each sample group.
Seurat object to create ligand receptor matrices from
146 |
147 |
148 |
metadata_grouping
149 |
Grouping variable in the Seurat object metadata used
150 | to define the groups of cells. Default is "cell_types".
151 |
152 |
153 |
ligand_receptor_pairs
154 |
Data.frame of ligands, receptors and
155 | interactions in the format of ramilowski_pairs provided by this package.
156 | Defaults is "ramilowski_pairs".
157 |
158 |
159 |
number_cells_required
160 |
Number of cells per group required to perform
161 | analysis of ligand/receptor interactions. Defaults to 100.
162 |
163 |
164 |
min_expression
165 |
Minimum expression in counts to consider a ligand or
166 | receptor for interactions analysis. A sensible default is set to 1000, but is
167 | dataset dependent. This is meant to filter out lowly expressed ligands and
168 | receptors.
169 |
170 |
171 |
max_expression
172 |
Maxmium expression in counts to consider a ligand or
173 | receptor for interactions analysis. A sensible default is set to 20000, but is
174 | dataset dependent. This is meant to filter out ubiquitously expressed ligands
175 | and receptors.
176 |
177 |
178 |
scramble_times
179 |
Number of times to scamble ligand/receptor interactions to
180 | create a background distribution for statistical comparison.
181 |
182 |
183 |
184 |
Value
185 |
186 |
Comprehensive tibble of cognate ligand and receptor interactions and
187 | statistical significance of these interactions across cell types.
Seurat object containing expression data acorss all
144 | samples and cells
145 |
146 |
147 |
interaction_stats
148 |
Tibble from celltalk function, usually filtered to
149 | the top significant ligand and receptor interactions of interest
150 |
151 |
152 |
sample_replicates
153 |
Name of the meta.data column in a Seurat object that
154 | has the samples of the individual replicate samples
155 |
156 |
157 |
sample_groups
158 |
Name of the meta.data column in a Seurat object that
159 | has the name of the sample group
160 |
161 |
162 |
metadata_grouping
163 |
Name of the meta.data column in a Seurat object that
164 | has the name of the groups of cells to evaluate (e.g. "cell_types" containing
165 | previously identified cell types)
166 |
167 |
168 |
169 |
Value
170 |
171 |
A list of linear models containing the coefficients and statistics for
172 | assessing differences in joint ligand and receptor expression between sample
173 | groups. Note that this requires replicate samples from each samples group.
A dataset containing the filtered expressed of ligands and receptors from
130 | a series of peripheral blood from 5 healthy donors and tonsil from 5
131 | healthy donors undergoing tonsilectomy.
132 |
133 |
134 |
filtered_lig_rec
135 |
136 |
137 |
Format
138 |
139 |
A sparse matrix with 192 genes (rows) and 23734 cells (columns)
UMAP embedding and cell types from HCA BM 40k dataset
124 |
125 |
hca_bm_umap_cell_types.Rd
126 |
127 |
128 |
129 |
This is the UMAP embedding and the canonical immune lineages from the Human
130 | Cell Atlast BM 40k dataset, which is available through the SeuratData package.
131 | This is useful as a small dataset to demonstrate a use case for celltalker.
UMAP of cells from 5 health blood donors and 5 healthy tonsil donors.
124 |
125 |
overall_umap.Rd
126 |
127 |
128 |
129 |
The UMAP_1 and UMAP_2 coordinates of cells resulting from dimensionality
130 | reduction of all cells from 5 healthy peripheral blood donors and 5 tonsil
131 | tissue donors.
132 |
133 |
134 |
overall_umap
135 |
136 |
137 |
Format
138 |
139 |
A matrix with 23734 cells (rows) and 2 dimensions of UMAP embedding
140 | (columns)
List of known ligands, receptors and their iteractions.
126 |
127 |
ramilowski_pairs.Rd
128 |
129 |
130 |
131 |
This is a curated list of ligands, receptors and their potential interactions.
132 | The list is derived from a manuscript from Ramilowski et al. There are other
133 | potential lists that could be used in place of or in addition to this list.
134 | Notably, the CellPhoneDB (https://github.com/ventolab/CellphoneDB) package
135 | has an extensively curated list including multiple receptor components.
136 |
137 |
138 |
ramilowski_pairs
139 |
140 |
141 |
Format
142 |
143 |
A data.frame with 2557 rows and 3 variables:
144 |
ligand
expressed ligands, total of 708 unique ligands
145 |
receptor
expressed receptors, total of 691 receptors
146 |
pair
interaction between and ligand and receptor, total of 2557
147 | unique interactions
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
--------------------------------------------------------------------------------
/index.md:
--------------------------------------------------------------------------------
1 | # celltalker
2 |
3 | ## Welcome to the celltalker package website
4 | - Check out the core functionality of the package in the vignette under "Get Started"!
5 | - If you have groups of samples with replicates in each group (e.g. disease vs control) and want to identify interactions that are statistically different between groups, check out the "Identify significantly different interactions across groups with replicate samples" vignette under Articles.
6 |
7 | 
8 |
9 | 
10 |
--------------------------------------------------------------------------------
/man/boxplot_group_interaction.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/boxplot_group_interaction.R
3 | \name{boxplot_group_interaction}
4 | \alias{boxplot_group_interaction}
5 | \title{Create a boxplot of the joint mean score for a specific ligand receptor
6 | interaction between two groups of samples}
7 | \usage{
8 | boxplot_group_interaction(
9 | seurat_object,
10 | interaction_stats,
11 | sample_replicates,
12 | sample_groups,
13 | metadata_grouping,
14 | ligand,
15 | receptor,
16 | cell_type1,
17 | cell_type2
18 | )
19 | }
20 | \arguments{
21 | \item{seurat_object}{Seurat object containing expression levels across all
22 | cells and sample types}
23 |
24 | \item{interaction_stats}{Tibble from celltalk function, usually filtered to
25 | the top significant ligand and receptor interactions of interest}
26 |
27 | \item{sample_replicates}{Name of the meta.data column in a Seurat object that
28 | has the samples of the individual replicate samples}
29 |
30 | \item{sample_groups}{Name of the meta.data column in a Seurat object that
31 | has the name of the sample group}
32 |
33 | \item{metadata_grouping}{Name of the meta.data column in a Seurat object that
34 | has the name of the groups of cells to evaluate (e.g. "cell_types" containing
35 | previously identified cell types)}
36 |
37 | \item{ligand}{Name of the ligand in the ligand/receptor pair of interest}
38 |
39 | \item{receptor}{Name of the receptor in the ligand/receptor pair of interest}
40 |
41 | \item{cell_type1}{Name of the cell type expressing the ligand in the ligand/
42 | receptor pair of interest}
43 |
44 | \item{cell_type2}{Name of the cell type expressing the receptor in the ligand/
45 | receptor pair of interest}
46 | }
47 | \value{
48 | A ggplot boxplot of the joint mean for a ligand/receptor interaction
49 | in each sample group.
50 | }
51 | \description{
52 | Create a boxplot of the joint mean score for a specific ligand receptor
53 | interaction between two groups of samples
54 | }
55 |
--------------------------------------------------------------------------------
/man/celltalk.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/celltalk.R
3 | \name{celltalk}
4 | \alias{celltalk}
5 | \title{Assess ligand and receptor interactions across groups of cells}
6 | \usage{
7 | celltalk(
8 | input_object,
9 | metadata_grouping = cell_types,
10 | ligand_receptor_pairs = ramilowski_pairs,
11 | number_cells_required = 100,
12 | min_expression = 1000,
13 | max_expression = 20000,
14 | scramble_times = 10
15 | )
16 | }
17 | \arguments{
18 | \item{input_object}{Seurat object to create ligand receptor matrices from}
19 |
20 | \item{metadata_grouping}{Grouping variable in the Seurat object metadata used
21 | to define the groups of cells. Default is "cell_types".}
22 |
23 | \item{ligand_receptor_pairs}{Data.frame of ligands, receptors and
24 | interactions in the format of ramilowski_pairs provided by this package.
25 | Defaults is "ramilowski_pairs".}
26 |
27 | \item{number_cells_required}{Number of cells per group required to perform
28 | analysis of ligand/receptor interactions. Defaults to 100.}
29 |
30 | \item{min_expression}{Minimum expression in counts to consider a ligand or
31 | receptor for interactions analysis. A sensible default is set to 1000, but is
32 | dataset dependent. This is meant to filter out lowly expressed ligands and
33 | receptors.}
34 |
35 | \item{max_expression}{Maxmium expression in counts to consider a ligand or
36 | receptor for interactions analysis. A sensible default is set to 20000, but is
37 | dataset dependent. This is meant to filter out ubiquitously expressed ligands
38 | and receptors.}
39 |
40 | \item{scramble_times}{Number of times to scamble ligand/receptor interactions to
41 | create a background distribution for statistical comparison.}
42 | }
43 | \value{
44 | Comprehensive tibble of cognate ligand and receptor interactions and
45 | statistical significance of these interactions across cell types.
46 | }
47 | \description{
48 | Assess ligand and receptor interactions across groups of cells
49 | }
50 |
--------------------------------------------------------------------------------
/man/circos_plot.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/circos_plot.R
3 | \name{circos_plot}
4 | \alias{circos_plot}
5 | \title{Creates a circos plot from the list of ligands and receptors}
6 | \usage{
7 | circos_plot(
8 | ligand_receptor_frame,
9 | cell_group_colors,
10 | ligand_color = "blue",
11 | receptor_color = "red",
12 | cex_outer = 0.5,
13 | cex_inner = 0.4
14 | )
15 | }
16 | \arguments{
17 | \item{ligand_receptor_frame}{Resulting tibble (usually filtered in some way)
18 | from the celltalk function.}
19 |
20 | \item{cell_group_colors}{Colors used for the groups of cells in the outer
21 | track of the circos plot.}
22 |
23 | \item{ligand_color}{Color to use for ligands. Defaults to "blue".}
24 |
25 | \item{receptor_color}{Color to use for the receptors. Defaults to "red".}
26 |
27 | \item{cex_outer}{Size of the text for the cell groups in the outer layer of
28 | the circos plot. Default is 0.5.}
29 |
30 | \item{cex_inner}{Size of the text for the ligand and receptors in the
31 | inner layer of the circos plot. Default is 0.4.}
32 | }
33 | \value{
34 | Generates a circos plot connecting ligands and receptors across cell types for a given sample group
35 | }
36 | \description{
37 | Creates a circos plot from the list of ligands and receptors
38 | }
39 |
--------------------------------------------------------------------------------
/man/compare_group_interactions.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/compare_group_interactions.R
3 | \name{compare_group_interactions}
4 | \alias{compare_group_interactions}
5 | \title{Statistically compare interactions between groups of samples}
6 | \usage{
7 | compare_group_interactions(
8 | seurat_object,
9 | interaction_stats,
10 | sample_replicates,
11 | sample_groups,
12 | metadata_grouping
13 | )
14 | }
15 | \arguments{
16 | \item{seurat_object}{Seurat object containing expression data acorss all
17 | samples and cells}
18 |
19 | \item{interaction_stats}{Tibble from celltalk function, usually filtered to
20 | the top significant ligand and receptor interactions of interest}
21 |
22 | \item{sample_replicates}{Name of the meta.data column in a Seurat object that
23 | has the samples of the individual replicate samples}
24 |
25 | \item{sample_groups}{Name of the meta.data column in a Seurat object that
26 | has the name of the sample group}
27 |
28 | \item{metadata_grouping}{Name of the meta.data column in a Seurat object that
29 | has the name of the groups of cells to evaluate (e.g. "cell_types" containing
30 | previously identified cell types)}
31 | }
32 | \value{
33 | A list of linear models containing the coefficients and statistics for
34 | assessing differences in joint ligand and receptor expression between sample
35 | groups. Note that this requires replicate samples from each samples group.
36 | }
37 | \description{
38 | Statistically compare interactions between groups of samples
39 | }
40 |
--------------------------------------------------------------------------------
/man/figures/README-example-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/arc85/celltalker/6edd610bf558bb1777590f8a6b02711ef7d0fc47/man/figures/README-example-1.png
--------------------------------------------------------------------------------
/man/figures/README-example-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/arc85/celltalker/6edd610bf558bb1777590f8a6b02711ef7d0fc47/man/figures/README-example-2.png
--------------------------------------------------------------------------------
/man/filtered_lig_rec.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/data.R
3 | \docType{data}
4 | \name{filtered_lig_rec}
5 | \alias{filtered_lig_rec}
6 | \title{Expressed ligands and receptors.}
7 | \format{
8 | A sparse matrix with 192 genes (rows) and 23734 cells (columns)
9 | }
10 | \source{
11 | \url{https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE139324/}
12 | }
13 | \usage{
14 | filtered_lig_rec
15 | }
16 | \description{
17 | A dataset containing the filtered expressed of ligands and receptors from
18 | a series of peripheral blood from 5 healthy donors and tonsil from 5
19 | healthy donors undergoing tonsilectomy.
20 | }
21 | \keyword{datasets}
22 |
--------------------------------------------------------------------------------
/man/hca_bm_umap_cell_types.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/data.R
3 | \docType{data}
4 | \name{hca_bm_umap_cell_types}
5 | \alias{hca_bm_umap_cell_types}
6 | \title{UMAP embedding and cell types from HCA BM 40k dataset}
7 | \format{
8 | A data.frame with 33839 rows and 3 variables:
9 | \describe{
10 | \item{UMAP_1}{first dimension of the UMAP}
11 | \item{UMAP_2}{second dimension of the UMAP}
12 | \item{cell_types}{annotated cell types from the HCA BM 40K dataset}
13 | }
14 | }
15 | \source{
16 | \url{https://github.com/satijalab/seurat-data}
17 | }
18 | \usage{
19 | hca_bm_umap_cell_types
20 | }
21 | \description{
22 | This is the UMAP embedding and the canonical immune lineages from the Human
23 | Cell Atlast BM 40k dataset, which is available through the SeuratData package.
24 | This is useful as a small dataset to demonstrate a use case for celltalker.
25 | }
26 | \keyword{datasets}
27 |
--------------------------------------------------------------------------------
/man/overall_metadata.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/data.R
3 | \docType{data}
4 | \name{overall_metadata}
5 | \alias{overall_metadata}
6 | \title{Metadata from 5 health blood donors and 5 healthy tonsil donors.}
7 | \format{
8 | A data.frame with 23734 cells (rows) and 8 variables:
9 | \describe{
10 | \item{orig.ident}{name assigned by default to the Seurat object}
11 | \item{nCount_RNA}{number of RNA molecules counted per cell (1038--74386)}
12 | \item{nFeature_RNA}{number of RNA molecules counted per cell (41--6582)}
13 | \item{sample_id}{individual donor samples, HD_PBMC 1 to 5 and HD_Tonsil 1 to 5}
14 | \item{sample_type}{tissue of origin, either PBMC or Tonsil}
15 | \item{RNA_snn_res.0.3}{Louvian clustering results, clusters 0 to 13}
16 | \item{seurat_clusters}{clusters assigned by default, same as RNA_snn_res.0.3}
17 | \item{cell_types}{cell types identified by canonical gene expression (B cells,
18 | CD14-CD16+ monocytes, CD14+CD16- monocytes, CD1C+ DCs, CD4 T cells,
19 | CD8 T cells, NK cells, pDCs, Plasmablasts, RBCs)}
20 | }
21 | }
22 | \source{
23 | \url{https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE139324/}
24 | }
25 | \usage{
26 | overall_metadata
27 | }
28 | \description{
29 | Overall metadata from analysis of 5 healthy blood donors and 5 healthy
30 | tonsil tissue donors.
31 | }
32 | \keyword{datasets}
33 |
--------------------------------------------------------------------------------
/man/overall_umap.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/data.R
3 | \docType{data}
4 | \name{overall_umap}
5 | \alias{overall_umap}
6 | \title{UMAP of cells from 5 health blood donors and 5 healthy tonsil donors.}
7 | \format{
8 | A matrix with 23734 cells (rows) and 2 dimensions of UMAP embedding
9 | (columns)
10 | }
11 | \source{
12 | \url{https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE139324/}
13 | }
14 | \usage{
15 | overall_umap
16 | }
17 | \description{
18 | The UMAP_1 and UMAP_2 coordinates of cells resulting from dimensionality
19 | reduction of all cells from 5 healthy peripheral blood donors and 5 tonsil
20 | tissue donors.
21 | }
22 | \keyword{datasets}
23 |
--------------------------------------------------------------------------------
/man/ramilowski_pairs.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/data.R
3 | \docType{data}
4 | \name{ramilowski_pairs}
5 | \alias{ramilowski_pairs}
6 | \title{List of known ligands, receptors and their iteractions.}
7 | \format{
8 | A data.frame with 2557 rows and 3 variables:
9 | \describe{
10 | \item{ligand}{expressed ligands, total of 708 unique ligands}
11 | \item{receptor}{expressed receptors, total of 691 receptors}
12 | \item{pair}{interaction between and ligand and receptor, total of 2557
13 | unique interactions}
14 | }
15 | }
16 | \source{
17 | \url{https://www.nature.com/articles/ncomms8866}
18 | }
19 | \usage{
20 | ramilowski_pairs
21 | }
22 | \description{
23 | This is a curated list of ligands, receptors and their potential interactions.
24 | The list is derived from a manuscript from Ramilowski et al. There are other
25 | potential lists that could be used in place of or in addition to this list.
26 | Notably, the CellPhoneDB (https://github.com/ventolab/CellphoneDB) package
27 | has an extensively curated list including multiple receptor components.
28 | }
29 | \keyword{datasets}
30 |
--------------------------------------------------------------------------------
/vignettes/.gitignore:
--------------------------------------------------------------------------------
1 | *.html
2 | *.R
3 |
--------------------------------------------------------------------------------
/vignettes/celltalker.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | title: "celltalker"
3 | author: "Anthony R Cillo"
4 | date: "`r format(Sys.time(), '%d %B, %Y')`"
5 | output: rmarkdown::html_vignette
6 | vignette: >
7 | %\VignetteIndexEntry{celltalker}
8 | %\VignetteEngine{knitr::rmarkdown}
9 | %\VignetteEncoding{UTF-8}
10 | ---
11 |
12 | Welcome to celltalker. This vignette will show the simpliest use case of celltalker, namely and identification the top putative ligand and receptor interactions across cell types from the Human Cell Atlas 40,000 Bone Marrow Cells dataset. This dataset is publicly available in a convenient form from the SeuratData package. Check out instructions for downloading this dataset (hcabm40k) [here](https://github.com/satijalab/seurat-data).
13 |
14 | Some pre-processing has been done to facilitate filtering of cells to canonical immune populations and annotating cell types. Check out data-raw for more info.
15 |
16 | ## Set up and run analysis
17 |
18 | ```{r setup}
19 |
20 | # Load packages
21 | suppressMessages({
22 | library(celltalker)
23 | library(Seurat)
24 | suppressWarnings(
25 | library(SeuratData)
26 | )
27 | library(dplyr)
28 | library(magrittr)
29 | })
30 |
31 | # Load Human Cell Atlast Bone Marrow from SeuratData
32 | data(hcabm40k)
33 |
34 | # Filter cell and assign cell types to the dataset
35 | # NB: hca_bm_umap_cell_types has cell types and UMAP embeddings
36 | hca_bm <- hcabm40k[,rownames(hca_bm_umap_cell_types)]
37 | hca_bm[["cell_types"]] <- hca_bm_umap_cell_types$cell_types
38 |
39 | # Process data
40 | hca_bm <- NormalizeData(hca_bm)
41 |
42 | # Add UMAP coordinates
43 | hca_bm[["umap"]] <- CreateDimReducObject(embeddings=as.matrix(hca_bm_umap_cell_types[,1:2]),
44 | key="UMAP_",assay="RNA")
45 |
46 | # View cell types
47 | DimPlot(hca_bm,group.by="cell_types")
48 |
49 | ## Run celltalker
50 | hca_bm_interactions <- celltalk(input_object=hca_bm,
51 | metadata_grouping="cell_types",
52 | ligand_receptor_pairs=ramilowski_pairs,
53 | number_cells_required=100,
54 | min_expression=1000,
55 | max_expression=20000,
56 | scramble_times=10)
57 |
58 | ## Identify top statistically significant interactions
59 | top_stats <- hca_bm_interactions %>%
60 | mutate(fdr=p.adjust(p_val,method="fdr")) %>%
61 | filter(fdr<0.05) %>%
62 | group_by(cell_type1) %>%
63 | top_n(3,interact_ratio) %>%
64 | ungroup()
65 |
66 | ## Generate a circos plot
67 | colors_use <- RColorBrewer::brewer.pal(n=length(unique(hca_bm$cell_types)),"Set2")
68 |
69 | circos_plot(ligand_receptor_frame=top_stats,
70 | cell_group_colors=colors_use,
71 | ligand_color="blue",
72 | receptor_color="red",
73 | cex_outer=0.5,
74 | cex_inner=0.4)
75 |
76 | ```
77 |
78 | ## Conclusion and next steps
79 |
80 | We have now demonstrated a use case for celltalker in which we identified the top 3 ligand/receptor interactions by joint mean expression of cognate ligands and receptors across cell types.
81 |
82 | If you have replicate samples, it might be of interest to identify ligand receptor interactions that are statistically different between groups of samples. We recommend checking out the vignette on identifying statistically significant interactions between groups of replicate samples if this would be useful for your dataset.
83 |
--------------------------------------------------------------------------------
/vignettes/consistent_interactions.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Identify significantly different interactions across groups with replicate samples"
3 | author: "Anthony R Cillo"
4 | date: "`r format(Sys.time(), '%d %B, %Y')`"
5 | output: rmarkdown::html_vignette
6 | vignette: >
7 | %\VignetteIndexEntry{Identify significantly different interactions across groups with replicate samples}
8 | %\VignetteEngine{knitr::rmarkdown}
9 | %\VignetteEncoding{UTF-8}
10 | ---
11 |
12 | This vignette demonstrates an extension of the core functionality of celltalker to replicate samples. The idea is that this functionality can be used to identify consistently differentially expressed ligand and receptor interactions. To demonstrate this functionality, we will leverage our [previously published](https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE139324) dataset of healthy donor PBMC and healthy donor tonsils.
13 |
14 | The data preprocessing steps are documented in the data-raw directory. We will start with a low-dimensional visualization with annotated cell types.
15 |
16 | ## Load packages and setup analysis
17 |
18 | ```{r setup}
19 | suppressMessages({
20 | library(celltalker)
21 | library(Seurat)
22 | library(dplyr)
23 | library(magrittr)
24 | })
25 |
26 | ## Load data provided with package
27 | data("filtered_lig_rec")
28 | data("overall_metadata")
29 | data("overall_umap")
30 |
31 | ## Create a Seurat object based on 5 healthy donor PBMC and 5 healhy donor tonsils
32 | ser_obj <- CreateSeuratObject(filtered_lig_rec,meta.data=overall_metadata)
33 | ser_obj[["umap"]] <- CreateDimReducObject(embeddings = overall_umap, key = "UMAP_", assay = DefaultAssay(ser_obj))
34 |
35 | DimPlot(ser_obj,group.by="cell_types",split.by="sample_type")
36 |
37 | ```
38 |
39 | ## Run celltalker
40 |
41 | Next, we will split the data into PBMC and Tonsil Seurat objects and will identify the top ligand and receptor interactions in each of these datasets
42 |
43 | ```{r}
44 |
45 | ## Split dataset
46 | ser_split <- SplitObject(ser_obj,split="sample_type")
47 |
48 | ## Check out the split data
49 | ser_split
50 |
51 | ## Run celltalker - PBMC
52 | pbmc_interactions <- celltalk(input_object=ser_split[["PBMC"]],
53 | metadata_grouping="cell_types",
54 | ligand_receptor_pairs=ramilowski_pairs,
55 | number_cells_required=50,
56 | min_expression=50,
57 | max_expression=20000,
58 | scramble_times=10)
59 |
60 | ## Check out the interactions - PBMC
61 | pbmc_interactions %>%
62 | mutate(p_val_adj=p.adjust(p_val,method="fdr")) %>%
63 | filter(p_val_adj<0.05)
64 |
65 | ## Run celltalker - Tonsil
66 | tonsil_interactions <- celltalk(input_object=ser_split[["Tonsil"]],
67 | metadata_grouping="cell_types",
68 | ligand_receptor_pairs=ramilowski_pairs,
69 | number_cells_required=50,
70 | min_expression=50,
71 | max_expression=20000,
72 | scramble_times=10)
73 |
74 | ## Check out the interactions - tonsil
75 | tonsil_interactions %>%
76 | mutate(p_val_adj=p.adjust(p_val,method="fdr")) %>%
77 | filter(p_val_adj<0.05)
78 |
79 | ```
80 |
81 | ## Create circos plots
82 |
83 | ```{r}
84 |
85 | ## Plot top 3 interactions - PBMC
86 | # Identify the top 3 interactions for cell_type1
87 | top_stats_pbmc <- pbmc_interactions %>%
88 | mutate(p_val_adj=p.adjust(p_val,method="fdr")) %>%
89 | filter(p_val_adj<0.05) %>%
90 | group_by(cell_type1) %>%
91 | top_n(10,interact_ratio) %>%
92 | ungroup()
93 |
94 | # Assign colors to cell types
95 | all_cell_types <- unique(ser_obj[["cell_types"]][,1])
96 |
97 | # Define colors
98 | colors_use <- colorRampPalette(RColorBrewer::brewer.pal(n=8,"Set2"))(length(all_cell_types))
99 | names(colors_use) <- all_cell_types
100 |
101 | # Suppress messages to silence the circlize functions
102 | suppressMessages(
103 | circos_plot(ligand_receptor_frame=top_stats_pbmc,
104 | cell_group_colors=colors_use,
105 | ligand_color="blue",
106 | receptor_color="red",
107 | cex_outer=0.5,
108 | cex_inner=0.4)
109 | )
110 |
111 | ## Plot top 3 interactions - Tonsil
112 | # Identify the top 3 interactions for cell_type1
113 | top_stats_tonsil <- tonsil_interactions %>%
114 | mutate(p_val_adj=p.adjust(p_val,method="fdr")) %>%
115 | filter(p_val_adj<0.05) %>%
116 | group_by(cell_type1) %>%
117 | top_n(10,interact_ratio) %>%
118 | ungroup()
119 |
120 | # Suppress messages to silence the circlize functions
121 | suppressMessages(
122 | circos_plot(ligand_receptor_frame=top_stats_tonsil,
123 | cell_group_colors=colors_use,
124 | ligand_color="blue",
125 | receptor_color="red",
126 | cex_outer=0.5,
127 | cex_inner=0.4)
128 | )
129 |
130 | ```
131 |
132 | ## Identify significantly different interactions across patient samples
133 |
134 | ```{r}
135 |
136 | ## Comparison of group interactions
137 | # Use top 10 interactions from tonsils as input
138 | group_stats <- compare_group_interactions(seurat_object=ser_obj,
139 | interaction_stats=top_stats_tonsil,
140 | sample_replicates="sample_id",
141 | sample_groups="sample_type",
142 | metadata_grouping="cell_types")
143 |
144 | # Extract p values into data.frame and add FDR
145 | mod_p_vals <- do.call(rbind,
146 | lapply(group_stats,function(x) {
147 | if (class(x) != "lm") stop("Not an object of class 'lm' ")
148 | f <- summary(x)$fstatistic
149 | p <- pf(f[1],f[2],f[3],lower.tail=F)
150 | attributes(p) <- NULL
151 | return(p)
152 | })
153 | )
154 |
155 | mod_p_vals <- data.frame(mod_p_vals,p_val_adj=p.adjust(mod_p_vals[,1],method="fdr"))
156 |
157 | mod_p_vals
158 |
159 | # Boxplot of joint weight interaction across replicates
160 | boxplot_group_interaction(seurat_object=ser_obj,
161 | interaction_stats=top_stats_tonsil,
162 | sample_replicates="sample_id",
163 | sample_groups="sample_type",
164 | metadata_grouping="cell_types",
165 | ligand="CD40LG",
166 | receptor="CD40",
167 | cell_type1="CD4 T cells",
168 | cell_type2="B cells")
169 |
170 | ```
171 |
--------------------------------------------------------------------------------