An R package that utilizes Shiny to provide a user interface for statistical analysis of two-dimensional confocal microscope images. Users can upload two images directly or a folder of images with the help of a user-generated csv file, edit their experimental design, create tables and graphs for analysis results, and generate a fully-formatted report of their experiment. For more information on BASIN, check out our documentation site. For tutorials on the BASIN workflow and running the application, check out the playlists on our YouTube channel.
A simplified version of BASIN is available through shinyApps at both https://basin.bicbioeng.org/ and http://bicbioeng.shinyapps.io/tryBASIN. This version only takes in 2 images, but the workflow is nearly identical to the complete version and serves as a gentle tutorial to most of BASIN's features. Note that for the full version of BASIN requires the user to download a csv containing the names of the images uploaded and assign 'control' and 'test' bioconditions manually, in addition to experiment number(s), which must be positive integers only.
- Make sure you have the latest version of R and Rstudio installed on your computer (free and open-source, available online). Rstudio is an IDE for the R programming language, and all successive steps should be ran through the Rstudio terminal.
- Install the required R and Bioconductor packages using the following commands:
install.packages(c("purrr", "plyr", "shiny", "shinyBS", "shinyjs", "shinydashboard", "shinycssloaders", "shinythemes", "shinyWidgets", "DT", "stringi", "ggpubr", "tcltk", "autothresholdr"))
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager") #installs Bioconductor
BiocManager::install("EBImage") #installs EBImage
- Download the BASIN-lite folder from this github repository.
- Find the ui.R or server.R file in the folder and open it using RStudio
- At the top right corner of the opened file, there should be a green button next to the text "Run App". Use that button to start your application.
BASIN-ML leverages machine learning for improved cell segmentation. This module requires both Python and R, as well as an extremely specific Python environment setup in order to function properly. Reference to external documentation is required, although we have provided all necessary links below.
- Install Anaconda on your local machine:
- Quick Setup - install Miniconda using the following link: https://docs.conda.io/en/latest/miniconda.html
- If any successive steps don’t work, uninstall Miniconda and install Anaconda instead using the following link: https://docs.anaconda.com/anaconda/install/
- Open the Anaconda terminal (Anaconda Prompt) and switch to the folder containing the “full_environment.yml” file using
cd path\to\folder\...
- Install the BASIN python environment using the command
conda env create -f full_environment.yml
- this will take a few minutes - Make sure you have the latest version of cellpose by running
pip install cellpose --upgrade
- Ensure the installation worked by executing the following commands in the terminal:
- Activate the environment using
conda activate basin
- Run cellpose using
python -m cellpose
- If the cellpose GUI appears, your installation has been successful
- Once Python installation is complete, you can always run cellpose by running
python -m cellpose
in the Anaconda terminal. Note that any time you open a new Anaconda terminal, you will have to re-run theconda activate basin
command in order to activate your cellpose environment.
- Make sure you have the latest version of R and Rstudio installed on your computer (free and open-source, available online). Rstudio is an IDE for the R programming language, and all successive steps should be ran through the Rstudio terminal.
- Install the required R and Bioconductor packages:
install.packages(c("purrr", "plyr", "shiny", "shinyBS", "shinyjs", "shinydashboard", "shinycssloaders", "shinythemes", "shinyWidgets", "DT", "stringi", "ggpubr", "tcltk", "autothresholdr"))
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager") #installs Bioconductor
BiocManager::install("EBImage") #installs EBImage
- Install the reticulate, keras, and tensorflow packages in RStudio using
install.packages(c(“reticulate”, “keras”, “tensorflow”))
- Test the ability for the packages to connect to the Python environment:
- Run the following commands in R and check for errors:
library(reticulate)
env <- conda_list()$name == "basin"
envPath <- conda_list()[env,]$python
envPath <- stringi::stri_replace(envPath,"",regex = "python.exe")
reticulate::use_condaenv(envPath, required=TRUE)
keras::use_condaenv(envPath, required=TRUE)
tensorflow::use_condaenv(envPath, required=TRUE)
- Download the BASIN-ML folder from this github repository.
- Find the ui.R or server.R file in the folder and open it using RStudio
- At the top right corner of the opened file, there should be a green button next to the text "Run App". Use that button to start your application. Note that it will take a few seconds for it to load the Python environment.
- Some users experience app crashes or freezes after the first run through. You will need to restart your R session if this happens.
Details on the features and functionality of BASIN can be found in the BASIN
vignette, which is accessible through the package itself. To install BASIN
in R, download the tarball file BASIN_0.99.0.tar.gz into your local machine
and use the command install.packages("path/to/BASIN")
, replacing the
"path/to/BASIN" with the location of the file. Once installed, load the
package using library(BASIN). The package vignette can be accessed using the
command browseVignettes("BASIN")
and will contain further instructions on
using the package.