Skip to content

Commit f467f77

Browse files
committed
Updated the gitignore file to follow also files in inst/doc folder.
1 parent 4a79710 commit f467f77

File tree

4 files changed

+701
-20
lines changed

4 files changed

+701
-20
lines changed

.gitignore

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1-
# Hidden files automatically created by mac os or autosaved from
2-
# some other program
3-
.DS_Store
4-
._*
5-
*~
6-
~$*
7-
8-
# R-files and data/directories not to keep
9-
.Rproj.user
10-
.Rhistory
11-
.Rapp.history
12-
.RData
13-
.Ruserdata
14-
temp*.R
15-
inst/doc
16-
data-raw
17-
doc
18-
Meta
19-
/doc/
20-
/Meta/
1+
# Hidden files automatically created by mac os or autosaved from
2+
# some other program
3+
.DS_Store
4+
._*
5+
*~
6+
~$*
7+
8+
# R-files and data/directories not to keep
9+
.Rproj.user
10+
.Rhistory
11+
.Rapp.history
12+
.RData
13+
.Ruserdata
14+
temp*.R
15+
data-raw
16+
Meta
17+
/doc/
18+
/Meta/

inst/doc/EPIC.R

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## ---- eval = FALSE------------------------------------------------------------
2+
# # library(EPIC) ## If the package isn't loaded (or use EPIC::EPIC and so on).
3+
# out <- EPIC(bulk = bulkSamplesMatrix)
4+
# out <- EPIC(bulk = bulkSamplesMatrix, reference = referenceCellsList)
5+
6+
## ---- eval = FALSE------------------------------------------------------------
7+
# out <- EPIC(bulk = bulkSamplesMatrix, reference = referenceCellsList, mRNA_cell = mRNA_cell_vector, sigGenes = sigGenes_vector)
8+
# out <- EPIC(bulk = bulkSamplesMatrix, reference = referenceCellsList, mRNA_cell_sub = mRNA_cell_sub_vector)
9+
10+
## ---- eval = FALSE------------------------------------------------------------
11+
# ?EPIC::EPIC
12+
# ?EPIC::EPIC.package
13+
14+
## ---- eval = FALSE------------------------------------------------------------
15+
# install.packages("devtools")
16+
# devtools::install_github("GfellerLab/EPIC", build_vignettes=TRUE)
17+

inst/doc/EPIC.Rmd

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
---
2+
title: "EPIC package"
3+
author: "Julien Racle and David Gfeller"
4+
date: "`r Sys.Date()`"
5+
output: rmarkdown::html_vignette
6+
vignette: >
7+
%\VignetteIndexEntry{EPIC package}
8+
%\VignetteEngine{knitr::rmarkdown}
9+
%\VignetteEncoding{UTF-8}
10+
---
11+
12+
## Description
13+
Package implementing EPIC method to estimate the proportion of immune, stromal,
14+
endothelial and cancer or other cells from bulk gene expression data.
15+
It is based on reference gene expression profiles for the main non-malignant
16+
cell types and it predicts the proportion of these cells and of the remaining
17+
"other cells" (that are mostly cancer cells) for which no reference profile is
18+
given.
19+
20+
This method is described in the publication from *Racle et al., 2017* available
21+
at <https://elifesciences.org/articles/26476>.
22+
23+
EPIC is also available as a web application: <http://epic.gfellerlab.org>.
24+
25+
## Usage
26+
The main function in this package is `EPIC`. It needs as input a matrix of the
27+
TPM (or RPKM) gene expression from the samples for which to estimate cell
28+
proportions. One can also define the reference cells to use
29+
```{r, eval = FALSE}
30+
# library(EPIC) ## If the package isn't loaded (or use EPIC::EPIC and so on).
31+
out <- EPIC(bulk = bulkSamplesMatrix)
32+
out <- EPIC(bulk = bulkSamplesMatrix, reference = referenceCellsList)
33+
```
34+
35+
`out` is a list containing the various mRNA and cell fractions in each samples as well as some *data.frame* of the goodness of fit.
36+
37+
Values of mRNA per cell and signature genes to use can also be changed:
38+
```{r, eval = FALSE}
39+
out <- EPIC(bulk = bulkSamplesMatrix, reference = referenceCellsList, mRNA_cell = mRNA_cell_vector, sigGenes = sigGenes_vector)
40+
out <- EPIC(bulk = bulkSamplesMatrix, reference = referenceCellsList, mRNA_cell_sub = mRNA_cell_sub_vector)
41+
```
42+
43+
Various other options are available and are well documented in the help pages
44+
from EPIC:
45+
```{r, eval = FALSE}
46+
?EPIC::EPIC
47+
?EPIC::EPIC.package
48+
```
49+
50+
51+
## Installation
52+
```{r, eval = FALSE}
53+
install.packages("devtools")
54+
devtools::install_github("GfellerLab/EPIC", build_vignettes=TRUE)
55+
```
56+
57+
58+
## Web application
59+
EPIC is also available as a web application: <http://epic.gfellerlab.org>.
60+
61+
## Python wrapper
62+
A pyhton wrapper has been written by Stephen C. Van Nostrand from MIT and is
63+
available at <https://github.com/scvannost/epicpy>.
64+
65+
## License
66+
EPIC can be used freely by academic groups for non-commercial purposes. The
67+
product is provided free of charge, and, therefore, on an "*as is*" basis,
68+
without warranty of any kind. Please read the file "*LICENSE*" for details.
69+
70+
If you plan to use EPIC (version 1.1) in any for-profit application, you are
71+
required to obtain a separate license.
72+
To do so, please contact Nadette Bulgin
73+
([nbulgin@lcr.org](mailto:nbulgin@lcr.org)) at the Ludwig Institute for
74+
Cancer Research Ltd.
75+
76+
77+
## Contact information
78+
Julien Racle ([julien.racle@unil.ch](mailto:julien.racle@unil.ch)),
79+
and David Gfeller ([david.gfeller@unil.ch](mailto:david.gfeller@unil.ch)).
80+
81+
82+
## FAQ
83+
##### What do the "*other cells*" represent?
84+
* EPIC predicts the proportions of the various cell types for which we have
85+
gene expression reference profiles (and corresponding gene signatures). But,
86+
depending on the bulk sample, it is possible that some other cell types are
87+
present for which we don't have any reference profile. EPIC returns the
88+
proportion of these remaining cells under the name "*other cells*". In the
89+
case of tumor samples, most of these other cells would certainly correspond
90+
to the cancer cells, but it could be that there are also some stromal cells or
91+
epithelial cells for example.
92+
93+
##### I receive an error message "*attempt to set 'colnames' on an object with less than two dimensions*". What can I do?
94+
* This is certainly that some of your data is a vector instead of a matrix.
95+
Please make sure that your bulk data is in the form of a matrix (and also
96+
your reference gene expression profiles if using custom ones).
97+
98+
##### What is the meaning of the warning message telling that some mRNA_cell values are unknown?
99+
* As described in our manuscript, EPIC first estimates the proportion of mRNA
100+
per cell type in the bulk and then it uses the fact that some cell types have
101+
more mRNA copies per cell than other to normalize this and obtain an estimate of
102+
the proportion of cells instead of mRNA (EPIC function returns both information
103+
if you need the one or the other). For this normalization we had either measured
104+
the amount of mRNA per cell or found it in the literature (fig. 1 – fig.
105+
supplement 2 of our paper). However we don’t currently have such values for the
106+
endothelial cells and CAFs. Therefore for these two cell types, we use an average
107+
value, which might not reflect their true value and this is the reason why we
108+
output this message. If you have some values for these mRNA/cell abundances, you
109+
can also add them into EPIC, with help of the parameter "*mRNA_cell*" or
110+
*mRNA_cell_sub*” (and that would be great to share these values).
111+
112+
If the mRNA proportions of these cell types are low, then even if you don't
113+
correct the results with their true mRNA/cell abundances, it would not really
114+
have a big impact on the results. On the other side, if there are many of these
115+
cells in your bulk sample, the results might be a little bit biased, but the
116+
effect should be similar for all samples and thus not have a too big importance
117+
(maybe you wouldn’t be fully able to tell if there are more CAFs than Tcells for
118+
example, but you should still have a good estimate of which sample has more CAFs
119+
(or Tcells) than which other sample for example).
120+
121+
##### I receive a warning message that "*the optimization didn't fully converge for some samples*". What does it mean?
122+
* When estimating the cell proportions EPIC performs a least square regression between the observed expression of the signature genes and the expression of these genes predicted based on the estimated proportions and gene expression reference profiles of the various cell types.
123+
124+
When such a warning message appears, it means that the optimization didn’t manage to fully converge for this regression, for some of the samples. You can then check the "*fit.gof\$convergeCode*" (and possibly also "*fit.gof\$convergeMessage*") that is outputted by EPIC alongside the cell proportions. This will tell you which samples had issue with the convergence (a value of 0 means it converged ok, while other values are errors/warnings, their meaning can be found in the help of "*optim*" (or "*constrOptim*") function from R (from "*stats*" package) which is used during the optimization and we simply forward the message it returns).
125+
126+
The error code that usually comes is a "1" which means that the maximum number of iterations has been reached in the optimization. This could mean there is an issue with the bulk gene expression data that maybe don’t completely follow the assumption of equation (1) from our manuscript. From our experience, it seems in practice that even when there was such a warning message the proportions were predicted well, it is maybe that the optimization just wants to be *too precise*, or maybe few of the signature genes didn’t match well but the rest of signature genes could be used to have a good estimate of the proportions.
127+
128+
If you have some samples that seem to have strange results, it could however be useful to check that the issue is not that these samples didn’t converge well. To
129+
be more conservative you could also remove all the samples that didn't converge
130+
well as these are maybe outliers, if it is only a small fraction from your original samples. Another possibility would be to change the parameters of the optim/constrOptim function to allow for more iterations or maybe a weaker tolerance for the convergence, but for this you would need to tweak it directly in the code of EPIC, I didn't implement such option for EPIC.
131+
132+
133+
##### Who should I contact in case of a technical or other issue?
134+
* Julien Racle ([julien.racle@unil.ch](mailto:julien.racle@unil.ch)). Please
135+
provide as much details as possible and ideally send also an example input file (and/or reference profiles) that is causing the issue.

0 commit comments

Comments
 (0)