-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME.Rmd
115 lines (82 loc) · 4.67 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
[![Travis build status](https://travis-ci.org/marionlouveaux/mgx2r.svg?branch=master)](https://travis-ci.org/marionlouveaux/mgx2r) [![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/marionlouveaux/mgx2r?branch=master&svg=true)](https://ci.appveyor.com/project/marionlouveaux/mgx2r) [![DOI](https://zenodo.org/badge/136828022.svg)](https://zenodo.org/badge/latestdoi/136828022)
# mgx2r
```{r, echo=FALSE, out.width="20%"}
knitr::include_graphics("https://raw.githubusercontent.com/marionlouveaux/mgx2r/master/img/mgx2r_logo.png")
```
The goal of {mgx2r} is to ease the analysis of mesh and cell graph files created with the MorphoGraphX software. [MorphoGraphX](http://www.mpipz.mpg.de/MorphoGraphX) is a software for 3D visualisation and segmentation of microscopy images.
## How to cite
To cite {mgx2r}, call the R built-in command `citation("mgx2r")`.
> Marion Louveaux, & Sébastien Rochette. (2018, October 18). mgx2r: a R package for importing meshes and cell graph files from MorphoGraphX software (Version v0.0.2). Zenodo. http://doi.org/10.5281/zenodo.1466047
## Installation
You can install the released version of {mgx2r} from GitHub
``` r
# install.packages("devtools")
devtools::install_github("marionlouveaux/mgx2r")
# With vignette
devtools::install_github("marionlouveaux/mgx2r",
build_vignettes = TRUE)
```
## Full documentation with {pkgdown}
See full documentation created with {pkgdown} at https://marionlouveaux.github.io/mgx2r/
## Vignettes
Two vignettes are available in the package. You can have access to the vignettes if you installed the package using `build_vignettes = TRUE`.
- `vignette("vignette_basics", package = "mgx2r")`
- `vignette("vignette_time_series", package = "mgx2r")`
To open the Rmd files used to build vignettes:
```{r, eval=FALSE}
file.edit(system.file(file.path("doc", "vignette_basics.Rmd"), package = "mgx2r"))
file.edit(system.file(file.path("doc", "vignette_time_series.Rmd"), package = "mgx2r"))
```
## Example
### Read dataset
Some .ply demonstration data coming from my PhD thesis are attached to this package. This dataset is a timelapse recording of the development of a shoot apical meristem of the plant \emph{Arabidopsis thaliana} expressing a membrane marker. I took one 3D stack every 12h and have 5 timepoints in total. For more information regarding the generation of this dataset, see `help.search("mgx2r-package")`.
```{r myData, eval=TRUE}
### Full datataset
filePly <- system.file("extdata", "full/mesh/mesh_meristem_full_T0.ply", package = "mgx2r")
fileCellGraph <- system.file("extdata", "full/cellGraph/cellGraph_meristem_full_T0.ply", package = "mgx2r")
```
The mesh data are read and converted as mesh 3D using the read_mgxPly function. They contain informatons relative to the geometry of the plant tissue.
```{r readPly, warning = FALSE, message = FALSE, eval=TRUE}
library(mgx2r)
mgx_palette <- c("#800000", "#FF0000", "#808000", "#FFFF00",
"#008000", "#00FF00", "#008080", "#00FFFF",
"#000080", "#0000FF", "#800080", "#FF00FF")
myMesh <- read_mgxPly(
file = filePly, ShowSpecimen = FALSE, addNormals = TRUE,
MatCol = 1, header_max = 30, my_colors = mgx_palette)
```
The cell graph data are read and converted as mesh 3D using the read_mgxCellGraph function. They contain data relative to the area of the cells and local curvature of the tissue.
```{r readCellGraph, eval=TRUE}
myCellGraph <- read_mgxCellGraph(fileCellGraph = fileCellGraph, header_max = 30)
```
### Visualise using {cellviz3d}
The mesh and cell graph data can be visualised using the package [{cellviz3d}](https://github.com/marionlouveaux/cellviz3d):
```{r map3D, eval=FALSE}
library(cellviz3d)
meshCellcenter <- myCellGraph$vertices[,c("label","x", "y", "z")]
p1 <- plotlyMesh(meshExample = myMesh,
meshColors = myMesh$allColors$Col_label,
meshCellcenter = meshCellcenter) %>%
plotly::layout(scene = list(aspectmode = "data"))
p1
```
```{r echo=FALSE}
knitr::include_graphics("https://raw.githubusercontent.com/marionlouveaux/mgx2r/master/inst/img/full/p1labels.png")
```
## Acknowledgements
Many thanks to Dr. Soeren Strauss and Dr. Richard Smith from the Max Planck Institute for Breeding Research for their help and advices on the {mgx2r} package.
## Code of conduct
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md).
By participating in this project you agree to abide by its terms.