Skip to content

Commit

Permalink
Updating README and GUIDE
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardojo committed Sep 18, 2023
1 parent 2eb3883 commit da0842d
Show file tree
Hide file tree
Showing 22 changed files with 138 additions and 46 deletions.
4 changes: 2 additions & 2 deletions .Rproj.user/02275A6F/sources/prop/FDB464DC
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"source_window_id": "",
"Source": "Source",
"cursorPosition": "126,0",
"scrollLine": "28"
"cursorPosition": "142,0",
"scrollLine": "137"
}
51 changes: 42 additions & 9 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -33,34 +33,48 @@ library(devtools)
install_github("leonardojo/ggPlantmap")
```


## ggPlantmap guides (HIGHLY RECOMMENDED!)

We created a step-by-step [user guide](https://github.com/leonardojo/ggPlantmap/blob/main/ggPlantmap.userguide.md) to help users navigate through the package.

We also created a [step-by-step guide with tips](https://github.com/leonardojo/ggPlantmap/blob/main/Tutorial%20for%20XML%20file.pdf) on how to create your ggPlantmap.
We also created a [step-by-step guide with tips](https://github.com/leonardojo/ggPlantmap/blob/main/Tutorial%20for%20XML%20file.pdf) on how to create your own ggPlantmap.


## What is a ggPlantmap?

Each unique ggPlantmap is a table (tibble) object with points coordinates (x,y) of specific polygons extracted from plant images.
Each unique ggPlantmap is a table (tibble) object with points coordinates (x,y) of specific points of polygons (ROIs) extracted from plant images.
```{r}
library(ggPlantmap)
head(ggPm.At.roottip.longitudinal)
```
<img src="man/figures/guide/Slide6.JPG" align="center" height="500"/>


## Plotting a ggPlantmap

ggPlantmaps can be plotted easily plotted using the ggPlantmap.plot() function
```{r,warning=F,echo=T,out.width="50%",fig.align="center"}
library(ggPlantmap)
ggPlantmap.plot(ggPm.At.earlyembryogenesis.devseries,Cell)
ggPlantmap.plot(ggPm.At.roottip.longitudinal,Level1)
```

## Pre-loaded ggPlantmaps
The package contain a series of pre-loaded ggPlantmaps created from previously published plant images.
We hope to update the package with the contribution of the plant research community.

```{r}
library(ggPlantmap)
head(ggPm.summary)
ggPm.summary
```
<img src="man/figures/ggPm.someexamples.jpg" align="center" height="500"/>


## Color mapping
These maps can be easily loaded into a ggplot coding environment and their color mapping changed based on the distinct layer classification of each ggPlantmap.

```{r,warning=F,echo=F}
```{r,warning=F,echo=F,out.width="50%",fig.align="center"}
library(ggplot2)
library(cowplot)
## Stage: Seed development stage
Expand All @@ -85,30 +99,48 @@ c <- ggPlantmap.plot(ggPm.At.seed.devseries,Part,linewidth = 0.5) +
plot_grid(a,b,c,ncol=1,labels=c("a","b","c"),align = "v")
```

We created a series of pre-loaded ggPlantmaps
```{r,warning=F,echo=F,out.width="50%",fig.align="center"}
library(ggPlantmap)
library(ggplot2)
library(cowplot)
a <- ggPlantmap.plot(ggPm.At.shootapex.longitudinal,Zone) +
scale_fill_brewer(palette="Set2") +
ggtitle("Shoot Apical Meristem - Zones") +
theme(legend.key.height= unit(0.25, 'cm'),
legend.key.width= unit(0.25, 'cm'))
b <- ggPlantmap.plot(ggPm.At.shootapex.longitudinal,Layer) +
scale_fill_brewer(palette="YlGn") +
ggtitle("Shoot Apical Meristem - Layers") +
theme(legend.key.height= unit(0.25, 'cm'),
legend.key.width= unit(0.25, 'cm'))
plot_grid(a,b,ncol=1,labels=c("d","e"),align = "v")
```


## Overlaying external quantitative data into a ggPlantmap

With ggPlantmap you can overlay quantitative data into your ggPlantmap to visualize it as sort of a heatmap.
To do so, you will need another table with contains quantitative data attributed to your ROIs.
To do so, you will need another table that contains quantitative data attributed to your ROIs.
<img src="man/figures/guide/Slide7.JPG" align="center" width="1200"/><br />
his approach can be very helpful for R Shiny app developers to create web interactive tools to visualize gene expression gene profiles.

This approach can be very helpful for R Shiny app developers to create web interactive tools to visualize quantitative data in plant cell or structures.

Some examples of heatmaps generated from available published data:
<img src="man/figures/README-Slide2.PNG" align="center" width="1000"/><br />
<img src="man/figures/README-Slide3.PNG" align="center" width="1000"/><br />


## Is ggPlantmap only usefull for molecular expression data?

Not at all. ggPlantmap can also be used to produce many other type of plots. Essentially anything that you can trace, you can create! Be creative! We hope to build a community where people explore the usage of ggPlantmap for the communication of Plant science.

<img src="man/figures/README-Slide4.PNG" align="center" width="1000"/><br />


## How can I create my own ggPlantmap?

The principle of creating a ggPlantmap is fairly simple. We generate a list of ROIs (region of interests) in the Icy open-source software (https://icy.bioimageanalysis.org/) from any image. These ROIs are saved as XML files and later be converted into ggPlantmaps with the XML.to.ggPlantmap() function.
[We created step-by-step guide with tips](https://github.com/leonardojo/ggPlantmap/blob/main/Tutorial%20for%20XML%20file.pdf). on how to generate xml images from plant images.
[We created step-by-step guide with tips](https://github.com/leonardojo/ggPlantmap/blob/main/Tutorial%20for%20XML%20file.pdf) on how to generate xml images from plant images.

<img src="man/figures/README-Slide1.PNG" align="center" width="600"/>

Expand All @@ -117,9 +149,10 @@ new.ggPlantmap <- XML.to.ggPlantmap("data/ggPm.sample.xml")
ggPlantmap.plot(new.ggPlantmap,ROI.name)
```


## Can my ggPlantmap be included in the package?

YES!!! Any Plant map can be included in the package. If you create one, please email me ([email protected]) your ggPlantmap as tab-delimited table and I'll make sure to include in the package. You will be credited and your information will be displayed in the summary file. I really hope this becomes an organic package with the contribution of the plant research community.
YES!!! Any Plant map can be included in the package. If you create one, please email me ([email protected]) your ggPlantmap as tab-delimited table and I'll make sure to include in the package. You will be credited and your information will be displayed in the summary file. I really hope this becomes an organic package with the contribution of the plant research community.

## Acknowledgements
We would like to acknowledge Kaisa Kajala, Lisa Oskam, Monica Garcia Gomez, Pierre Gautrat and Kyra van der Velde for testing ggPlantmap. We also would like to acknowledge Andres Romanowski for providing some data for the initial tests of ggPlantmap.
Expand Down
79 changes: 55 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ to help users navigate through the package.

We also created a [step-by-step guide with
tips](https://github.com/leonardojo/ggPlantmap/blob/main/Tutorial%20for%20XML%20file.pdf)
on how to create your ggPlantmap.
on how to create your own ggPlantmap.

## What is a ggPlantmap?

Each unique ggPlantmap is a table (tibble) object with points
coordinates (x,y) of specific polygons extracted from plant images.
coordinates (x,y) of specific points of polygons (ROIs) extracted from
plant images.

``` r
library(ggPlantmap)
Expand All @@ -67,6 +68,24 @@ head(ggPm.At.roottip.longitudinal)

<img src="man/figures/guide/Slide6.JPG" align="center" height="500"/>

## Plotting a ggPlantmap

ggPlantmaps can be plotted easily plotted using the ggPlantmap.plot()
function

``` r
library(ggPlantmap)
ggPlantmap.plot(ggPm.At.earlyembryogenesis.devseries,Cell)
```

<img src="man/figures/README-unnamed-chunk-4-1.png" width="50%" style="display: block; margin: auto;" />

``` r
ggPlantmap.plot(ggPm.At.roottip.longitudinal,Level1)
```

<img src="man/figures/README-unnamed-chunk-4-2.png" width="50%" style="display: block; margin: auto;" />

## Pre-loaded ggPlantmaps

The package contain a series of pre-loaded ggPlantmaps created from
Expand All @@ -75,16 +94,26 @@ the contribution of the plant research community.

``` r
library(ggPlantmap)
head(ggPm.summary)
#> # A tibble: 6 × 9
#> ggPlantmap.name Species Tissue Type Descr…¹ Layers Image…² Made.by Conta…³
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 ggPm.At.roottip.c… Arabid… root cros… Cross-… Cells https:… Leonar… jo.leo…
#> 2 ggPm.At.roottip.l… Arabid… root long… Longit… Cells https:… Leonar… jo.leo…
#> 3 ggPm.At.3weekrose… Arabid… roset… top … Top vi… Leaves https:… Leonar… jo.leo…
#> 4 ggPm.At.leafepide… Arabid… leaf … top … Top vi… Cells https:… Leonar… jo.leo…
#> 5 ggPm.At.leaf.cros… Arabid… leaves cros… Cross-… Cells https:… Leonar… jo.leo…
#> 6 ggPm.At.seed.devs… Arabid… seed deve… Diagra… Cells… https:… Leonar… jo.leo…
ggPm.summary
#> # A tibble: 16 × 9
#> ggPlantmap.name Species Tissue Type Descr…¹ Layers Image…² Made.by Conta…³
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 ggPm.At.roottip.… Arabid… root cros… Cross-… Cells https:… Leonar… jo.leo…
#> 2 ggPm.At.roottip.… Arabid… root long… Longit… Cells https:… Leonar… jo.leo…
#> 3 ggPm.At.3weekros… Arabid… roset… top … Top vi… Leaves https:… Leonar… jo.leo…
#> 4 ggPm.At.leafepid… Arabid… leaf … top … Top vi… Cells https:… Leonar… jo.leo…
#> 5 ggPm.At.leaf.cro… Arabid… leaves cros… Cross-… Cells https:… Leonar… jo.leo…
#> 6 ggPm.At.seed.dev… Arabid… seed deve… Diagra… Cells… https:… Leonar… jo.leo…
#> 7 ggPm.At.earlyemb… Arabid… embryo deve… Diagra… Cells… https:… Leonar… jo.leo…
#> 8 ggPm.At.shootape… Arabid… shoot… long… Diagra… Layer… https:… Leonar… jo.leo…
#> 9 ggPm.At.inflores… Arabid… inflo… cros… Cross-… Cells https:… Leonar… jo.leo…
#> 10 ggPm.Sl.root.cro… Solanu… root cros… Cross-… Cells https:… Leonar… jo.leo…
#> 11 ggPm.At.leaf.top… Arabid… leaf top … Top vi… Leaves http:/… Leonar… jo.leo…
#> 12 ggPm.At.rootelon… Arabid… root … long… Longit… Cells https:… Leonar… jo.leo…
#> 13 ggPm.At.rootmatu… Arabid… root … cros… Cross-… Cells https:… Leonar… jo.leo…
#> 14 ggPm.At.flower.d… Arabid… flower diag… Diagra… Tissu… Taiz, … Leonar… jo.leo…
#> 15 ggPm.At.lateralr… Arabid… later… deve… Diagra… Cells… https:… Leonar… jo.leo…
#> 16 ggPm.Ms.root.cro… Medica… root cros… Cross-… Cells Unpubl… Leonar… jo.leo…
#> # … with abbreviated variable names ¹​Description, ²​Image.Reference,
#> # ³​Contact.Info
```
Expand All @@ -97,18 +126,20 @@ These maps can be easily loaded into a ggplot coding environment and
their color mapping changed based on the distinct layer classification
of each ggPlantmap.

![](man/figures/README-unnamed-chunk-5-1.png)<!-- -->
<img src="man/figures/README-unnamed-chunk-6-1.png" width="50%" style="display: block; margin: auto;" />

We created a series of pre-loaded ggPlantmaps
<img src="man/figures/README-unnamed-chunk-7-1.png" width="50%" style="display: block; margin: auto;" />

## Overlaying external quantitative data into a ggPlantmap

With ggPlantmap you can overlay quantitative data into your ggPlantmap
to visualize it as sort of a heatmap. To do so, you will need another
table with contains quantitative data attributed to your ROIs.
table that contains quantitative data attributed to your ROIs.
<img src="man/figures/guide/Slide7.JPG" align="center" width="1200"/><br />
his approach can be very helpful for R Shiny app developers to create
web interactive tools to visualize gene expression gene profiles.

This approach can be very helpful for R Shiny app developers to create
web interactive tools to visualize quantitative data in plant cell or
structures.

Some examples of heatmaps generated from available published data:
<img src="man/figures/README-Slide2.PNG" align="center" width="1000"/><br />
Expand All @@ -130,7 +161,7 @@ list of ROIs (region of interests) in the Icy open-source software
(<https://icy.bioimageanalysis.org/>) from any image. These ROIs are
saved as XML files and later be converted into ggPlantmaps with the
XML.to.ggPlantmap() function. [We created step-by-step guide with
tips](https://github.com/leonardojo/ggPlantmap/blob/main/Tutorial%20for%20XML%20file.pdf).
tips](https://github.com/leonardojo/ggPlantmap/blob/main/Tutorial%20for%20XML%20file.pdf)
on how to generate xml images from plant images.

<img src="man/figures/README-Slide1.PNG" align="center" width="600"/>
Expand All @@ -140,16 +171,16 @@ new.ggPlantmap <- XML.to.ggPlantmap("data/ggPm.sample.xml")
ggPlantmap.plot(new.ggPlantmap,ROI.name)
```

<img src="man/figures/README-unnamed-chunk-6-1.png" width="50%" />
<img src="man/figures/README-unnamed-chunk-8-1.png" width="50%" />

## Can my ggPlantmap be included in the package?

YES!!! Any Plant map can be included in the package. If you create one,
please email me (<[email protected]>) your ggPlantmap as tab-delimited table
and I’ll make sure to include in the package. You will be credited and
your information will be displayed in the summary file. I really hope
this becomes an organic package with the contribution of the plant
research community.
please email me (<[email protected]>) your ggPlantmap as
tab-delimited table and I’ll make sure to include in the package. You
will be credited and your information will be displayed in the summary
file. I really hope this becomes an organic package with the
contribution of the plant research community.

## Acknowledgements

Expand Down
12 changes: 12 additions & 0 deletions ggPlantmap.userguide.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ Run the ggPlantmap.plot() function to create a plot:
ggPlantmap.plot(data=ggPm.At.lateralroot.devseries) ## or ggPlantmap.plot(ggPm.At.lateralroot.devseries)
```

### Note that the same plot can be obtained using geom_polygon() on ggplot2
```{r}
library(ggplot2)
ggplot(ggPm.At.lateralroot.devseries,aes(x,y)) +
geom_polygon(aes(group=ROI.id,fill=ROI.name),colour="black") +
coord_fixed()
```

### 2.6 Changing the color map, legends and aesthetics
You can change the color mapping based on different layers of each ROI of the ggPlantmap
Each ggPlantmap is separated by specific layers, you can access them by checking the column name.
Expand All @@ -107,6 +115,7 @@ ggPlantmap.plot(ggPm.At.shootapex.longitudinal,layer=ROI.id,show.legend = FALSE)
## there will be too many of them, so you can exclude the legend in the plot by adding the option
```


## Different maps will have different layers

Because each polygon on ggPlantmap is characterized by specific levels (examples: Region,Stage,Part), you can color map them individually. Using ggPlantmap, you can color map based on unique layers of the ggPlantmap.
Expand Down Expand Up @@ -226,6 +235,9 @@ new.ggPlantmap <- XML.to.ggPlantmap("data-raw/roi.xml")
ggPlantmap.plot(new.ggPlantmap,ROI.name)
```

A more detailed tutorial can be found
[here](https://github.com/leonardojo/ggPlantmap/blob/main/Tutorial%20for%20XML%20file.pdf) on how to generate xml images from plant images.

### 5 That's it!
Hopefully everything ran smoothly. Thank you very much for your interest in ggPlantmap!
If you want your map to be included in the package. Please send me an email with a tab delimited table version of your ggPlantmap with specific description. I will make sure to include it in future versions.
Expand Down
Loading

0 comments on commit da0842d

Please sign in to comment.