Skip to content

Commit

Permalink
Merge pull request #41 from Gregor-Mendel-Institute/1.2
Browse files Browse the repository at this point in the history
Merge 1.2 > master
  • Loading branch information
phue authored Jul 15, 2020
2 parents 8f143ca + f302cff commit 653d4c9
Show file tree
Hide file tree
Showing 25 changed files with 645 additions and 188 deletions.
31 changes: 0 additions & 31 deletions .github/workflows/docker.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/docker_base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Docker Container (Base)

on:
push:
paths:
- 'containers/base/Dockerfile'
- 'containers/base/environment.yml'

jobs:
push_to_registry:
name: Push Docker image to GitHub Packages
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Push to Docker Hub
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: beckerlab/aradeepopsis-base
path: containers/base
tag_with_ref: true
- name: Push to GitHub Packages
uses: docker/build-push-action@v1
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
repository: gregor-mendel-institute/aradeepopsis/aradeepopsis-base
path: containers/base
tag_with_ref: true
32 changes: 32 additions & 0 deletions .github/workflows/docker_dpp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Docker Container (DPP)

on:
push:
paths:
- 'containers/addons/dpp/Dockerfile'
- 'containers/addons/dpp/environment.yml'

jobs:
push_to_registry:
name: Push Docker image to GitHub Packages
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Push to Docker Hub
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: beckerlab/aradeepopsis-dpp
path: containers/addons/dpp
tag_with_ref: true
- name: Push to GitHub Packages
uses: docker/build-push-action@v1
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
repository: gregor-mendel-institute/aradeepopsis/aradeepopsis-dpp
path: containers/addons/dpp
tag_with_ref: true
32 changes: 32 additions & 0 deletions .github/workflows/docker_shiny.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Docker Container (Shiny)

on:
push:
paths:
- 'containers/shiny/Dockerfile'
- 'containers/shiny/environment.yml'

jobs:
push_to_registry:
name: Push Docker image to GitHub Packages
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Push to Docker Hub
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: beckerlab/aradeepopsis-shiny
path: containers/shiny
tag_with_ref: true
- name: Push to GitHub Packages
uses: docker/build-push-action@v1
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
repository: gregor-mendel-institute/aradeepopsis/aradeepopsis-shiny
path: containers/shiny
tag_with_ref: true
2 changes: 1 addition & 1 deletion .github/workflows/minimal_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- master

jobs:
test:
CI:
env:
NXF_VER: ${{ matrix.nxf_ver }}
runs-on: ubuntu-latest
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## [v1.2](https://github.com/Gregor-Mendel-Institute/aradeepopsis/releases/tag/v1.2) - 2020-07-15

* updated `shiny` dependency `1.4.0` > `1.5.0`
* added a more informative log message if pipeline fails on systems with insufficient memory
* added `--ignore_label` parameter to exclude a segmentation class for trait calculation.
* added `--label_spec` parameter to allow for mapping of segmentation classes to pixel values of user-supplied segmentation masks. This is a requirement for the `--masks` parameter now.
* updated base.config to avoid out-of-memory issues when running with `--multiscale`
* added Dockerfile + Conda environment for DPP v2.1.0
* factored out Shiny dependencies into separate container (should be easier to deploy as a hosted Shiny app now)
* added `--model 'DPP'` and `--dpp_checkpoint` to allow for custom segmentation models, trained using the [Deep Plant Phenomics](https://github.com/p2irc/deepplantphenomics) framework
* added `--masks` parameter to skip semantic segmentation and run trait extraction using user-supplied masks
* fixed an issue where the pipeline would crash if the input image contains an alpha channel
* updated configuration for CBE cluster
* added log message to show current parameter settings when starting a pipeline run
* updated `scikit-image` `0.16.2` > `0.17.2`
* updated `imagemagick` dependency `7.0.9_27` > `7.0.10_23`

## [v1.1](https://github.com/Gregor-Mendel-Institute/aradeepopsis/releases/tag/v1.1) - 2020-05-13

* disabled task error strategy for pipeline runs on local computers
Expand Down
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# ![araDeepopsis](assets/logo/logo.png)

![Docker Container (Base)](https://github.com/Gregor-Mendel-Institute/aradeepopsis/workflows/Docker%20Container%20(Base)/badge.svg?branch=master)
![Docker Container (Shiny)](https://github.com/Gregor-Mendel-Institute/aradeepopsis/workflows/Docker%20Container%20(Shiny)/badge.svg?branch=master)
![Docker Docker (DPP)](https://github.com/Gregor-Mendel-Institute/aradeepopsis/workflows/Docker%20Container%20(DPP)/badge.svg?branch=master)

![](https://github.com/Gregor-Mendel-Institute/aradeepopsis/workflows/Integration%20test/badge.svg?branch=master)
[![Docker](https://github.com/Gregor-Mendel-Institute/aradeepopsis/workflows/Docker%20build/badge.svg)](https://hub.docker.com/r/beckerlab/aradeepopsis/)
[![Nextflow](https://img.shields.io/badge/nextflow-%E2%89%A520.01.0-important.svg)](https://www.nextflow.io/)
[![conda](https://img.shields.io/badge/install%20with-conda-brightgreen.svg)](https://conda.io/)

Expand Down Expand Up @@ -40,8 +43,18 @@ Depending on the model of choice, the pipeline extracts relevant phenotypic info

![Traits](docs/img/traits.png)

# Extensibility

The pipeline has a modular character, also allowing the use of [custom models](docs/parameters.md#custom-models) obtained from the [Deep Plant Phenomics](https://github.com/p2irc/deepplantphenomics)<sup>[[7]](#ref7)</sup> framework for the semantic segmentation step.

In addition, it is also possible to [feed](docs/parameters.md#--masks) the pipeline with segmentation masks obtained by other methods, while still making use the automated trait extraction and visualization capabilities of the pipeline.

# Usage

## Hardware requirements

Running the pipeline with the provided models requires at least 6GB of memory for singlescale inference, and at least 12GB for [`--multiscale`](docs/parameters.md#--multiscale).

## Setting up the pipeline

> Note: Windows users will have to set up the [WSL](https://docs.microsoft.com/en-us/windows/wsl/install-win10) first.
Expand All @@ -63,8 +76,7 @@ nextflow run Gregor-Mendel-Institute/aradeepopsis --images 'path/to/images/*{png
### Example to run on the CBE cluster using Singularity

```bash
module load singularity/3.4.1
module load nextflow/19.10.0
module load nextflow/20.01.0

nextflow run Gregor-Mendel-Institute/aradeepopsis --images 'path/to/images/*{png|jpg}' -profile cbe,singularity
```
Expand All @@ -75,6 +87,7 @@ nextflow run Gregor-Mendel-Institute/aradeepopsis --images 'path/to/images/*{png
| ------------- | ------------- | ------------- |
| [`--model`](docs/parameters.md#--model) | `C` | `<Character>` |
| [`--images`](docs/parameters.md#--images) | `None` | `<Path>` |
| [`--masks`](docs/parameters.md#--masks) | `false` | `<Path>` |
| [`--multiscale`](docs/parameters.md#--multiscale)| `false` | `<Boolean>` |
| [`--chunksize`](docs/parameters.md#--chunksize) | `10` | `<Integer>` |
| [`--ignore_senescence`](docs/parameters.md#--ignore_senescence) | `true` | `<Boolean>` |
Expand Down Expand Up @@ -102,4 +115,6 @@ A description of all traits is available [here](docs/output.md#Trait-table).
> <a name="ref5">[5]</a> **shiny: Easy web applications in R**<br />Rstudio Inc. (2014)
> <a name="ref6">[6]</a> **Digital photography provides a fast, reliable, and noninvasive method to estimate anthocyanin pigment concentration in reproductive and vegetative plant tissues**<br />Del Valle JC, Gallardo-López A, Buide ML, Whittall JB, Narbona E, 2018. Ecol Evol. 8(6):3064–76.
> <a name="ref6">[6]</a> **Digital photography provides a fast, reliable, and noninvasive method to estimate anthocyanin pigment concentration in reproductive and vegetative plant tissues**<br />Del Valle JC, Gallardo-López A, Buide ML, Whittall JB, Narbona E, 2018. Ecol Evol. 8(6):3064–76.
> <a name="ref7">[7]</a> **Deep Plant Phenomics: A Deep Learning Platform for Complex Plant Phenotyping Tasks**<br />Ubbens JR, Stavness I. Front Plant Sci. 2017 Jul 7;8:1190.
Binary file removed assets/color_legend/model_A.png
Binary file not shown.
Binary file removed assets/color_legend/model_B.png
Binary file not shown.
Binary file removed assets/color_legend/model_C.png
Binary file not shown.
15 changes: 11 additions & 4 deletions assets/shiny/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,19 @@ options(shiny.maxRequestSize=20*1024^2)

data <- read_csv("aradeepopsis_traits.csv")

labels <- Sys.getenv(c("LABELS"),"class_background=0,class_norm=1,class_senesc=2,class_antho=3") %>%
str_replace_all(.,"=[:digit:]+","") %>%
str_split(.,",") %>%
unlist() %>%
tail(-1)

imagenames <- data %>% select(file)
invalid <- ifelse(file.exists('invalid_images.txt'),length(read_lines('invalid_images.txt')),0)
traitcount <- ncol(data) - 2 # exclude filename and suffix
imagecount <- nrow(data)

# Define UI
ui <- navbarPage(title="araDeepopsis", id="nav", theme = shinytheme("flatly"),
ui <- navbarPage(title="aradeepopsis", id="nav", theme = shinytheme("flatly"),
tabPanel("Rosette Carousel",
sliderInput("chunk", label = "Select chunk:", min = 1, max = ceiling(imagecount/60), value = 1, width = '100%', step = 1),
slickROutput("slickr",width='100%',height='400px') %>% withSpinner()
Expand Down Expand Up @@ -89,7 +95,7 @@ ui <- navbarPage(title="araDeepopsis", id="nav", theme = shinytheme("flatly"),
actionButton("merge_data", "Analyze!"),
conditionalPanel(
condition="input.tabset3 > 0",
selectizeInput("exp_traits","Select Trait:", choices = colnames(data %>% select(-file,-format)), selected = "class_norm_area")
selectizeInput("exp_traits","Select Trait:", choices = colnames(data %>% select(-file,-format)), selected = glue::glue("{labels[1]}_area"))
)
),
mainPanel(
Expand All @@ -98,7 +104,8 @@ ui <- navbarPage(title="araDeepopsis", id="nav", theme = shinytheme("flatly"),
tabPanel("Traits over time",value=1,plotOutput("timeline") %>% withSpinner())
)
)
)
),
tags$style(type = 'text/css', '.navbar .navbar-brand {font-variant: small-caps;}')
)

server <- function(input, output, session) {
Expand Down Expand Up @@ -149,7 +156,7 @@ server <- function(input, output, session) {
output$radar = renderChartJSRadar({
data %>%
filter(file == input$explorer_files) %>%
select(one_of(c("class_norm_area","class_antho_area","class_senesc_area"))) %>%
select(any_of(glue::glue("{labels}_area"))) %>%
pivot_longer(everything(),names_to = "Label") %>%
mutate(value=value/sum(value)*100) %>%
chartJSRadar(.,maxScale = 100,scaleStartValue = 0,scaleStepWidth = 25,showLegend = F)
Expand Down
Loading

0 comments on commit 653d4c9

Please sign in to comment.