Sign inSign up

bmplatform/biostatflow

By bmplatform

•Updated almost 3 years ago

BioStatFlow: Statistical Analysis Workflow for "OMICS" Data

Image
1

1.7K

bmplatform/biostatflow repository overview

⁠BioStatFlow - Statistical Analysis Workflow for "OMICS" Data

BioStatFlow facilitates access to statistical tools for biologists that are not specialists. It has been designed to execute statistical analyses sequentially, i.e. a linear chain of statistical analysis, so-called Workflow in BioStatFlow.

The BioStatFlow software components consist of:

  1. The BioStatFlow core, which is responsible for managing the input-output through the GUI (datasets, workflows, parameters of each analysis, and results), creating batch scripts, from the workflow definition files, launching the analysis scripts, managing the persistent sessions (including access management).

  2. The workflow and statistical analysis catalogs. These catalogs may be enriched at any time by adding either some statistical analyses or even a new workflow.

  3. The repository of persistent sessions. To save your work in a persistent session, you have to register before.


⁠How to use this image

⁠1- Create your local data repository for both temporary and persistent sessions
  • Example
mkdir -p /data/bsflow
⁠2- Create the home directory for application
  • Example
mkdir -p /opt/bsflow
mkdir -p /opt/bsflow/etc
⁠3- Create a small script
  • Create a small script called 'bsflow' containing the following code:
#!/bin/sh

# home directory for application
MYDIR=/opt/bsflow

# your local data repository for both temporary and persistent sessions
DATADIR=/data/bsflow

mkdir -p $DATADIR/sessions && chmod 777 $DATADIR/sessions
mkdir -p $DATADIR/tmp && chmod 777 $DATADIR/tmp

# bsflow
BSFLOW_PORT=8080
BSFLOW_IMAGE=bmplatform/biostatflow:latest
BSFLOW_CONTAINER=bsflow
BSFLOW_VOLS=

# Customized parameter file
BSFLOW_PAR="--env-file \$MYDIR/etc/bsflow.conf"

# Persistent sessions
BSFLOW_VOLS="-v $DATADIR/sessions:/opt/data/sessions  $BSFLOW_VOLS"

# Temporary sessions
BSFLOW_VOLS="-v $DATADIR/tmp:/var/www/html/tmp $BSFLOW_VOLS"

usage() { echo "usage: sh $0 start|stop|restart|ps|pull|purge";  exit 1; }

CMD=$1
case "$CMD" in
   start)
        # run BSFLOW
        sudo docker run -d $BSFLOW_PAR $BSFLOW_VOLS -p $BSFLOW_PORT:80 --name $BSFLOW_CONTAINER $BSFLOW_IMAGE
        # show logs
        sudo docker logs $BSFLOW_CONTAINER
        ;;
   stop)
        sudo docker rm -f $BSFLOW_CONTAINER
        ;;
   restart)
        ( sh $0 stop ; sh $0 start )
        ;;
   ps)
        sudo docker ps | head -1
        sudo docker ps | grep $BSFLOW_CONTAINER
        ;;
   shell)
        # run BSFLOW
        sudo docker run -it --rm  $BSFLOW_VOLS -p $BSFLOW_PORT:80 $BSFLOW_IMAGE /bin/bash
        ;;
   purge)
        rm -rf $DATADIR/tmp/*
        ;;
   pull)
        sudo docker pull $BSFLOW_IMAGE
        ;;
   *) usage
      exit 2
esac
⁠4- Create the configuration file
  • Create a small configuration file called 'bsflow.conf' under ./etc subdirectory
[GLOBAL]

# User management
USER_MGT=0

#Indicates if user is allowed to save session or not
SAVE_SESSION=1

# defines the base URL serving to recompose all the relative URLs 
URLBASE=http://www.exemple.org/bsflow/
URLROOT=/bsflow

For local use (i.e. on the same machine as the application), then the pathways must be configured as follows in the file ./etc/bsflow.conf

# defines the base URL serving to recompose all the relative URLs 
URLBASE=http://localhost:8080
URLROOT=/
⁠5- Configure your web server

If the BioStatFlow application is installed on a web server for network use, then you have to configure your web server (nginx or apache) in order to redirect the /bsflow path to the docker application and with the right port.

  • Configuration for a Nginx server (/etc/nginx/conf/my-site.conf)
server {
    listen 80 default;
    server_name $host;

    location /bsflow/ {
        proxy_pass http://localhost:8080/;
        proxy_redirect http://localhost:8080/ $scheme://$host/bsflow/;
    }
}
  • Configuration for an Apache server (/etc/httpd/conf/httpd.conf on CentOS 7)
LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so

<Proxy *>
   Allow from all
</Proxy>
ProxyPreserveHost On

# bsflow
ProxyPass /bsflow/ http://localhost:8080/
ProxyPassReverse /bsflow/ http://localhost:8080/

Notes:

  • Think to restart your web server

  • For local use, you don't need a web server

⁠6 - Get the docker images from DockerHub
  • (may take a while depending on your network speed and the traffic)
cd /opt/bsflow
sh ./bsflow pull
⁠7 - Start the application
sh ./bsflow start

Then, launch into your web browser, the BioStatFlow web application: i.e http://www.example.org/bsflow/⁠ or for local use : http://localhost:8080/⁠

⁠8 - Status of the application
sh ./bsflow ps
⁠9 - When finished, stop the application
sh ./bsflow stop
⁠10 - Clean the directory of temporary sessions
sh ./bsflow purge

⁠Information on this Docker image

Tag summary

Content type

Image

Digest

sha256:841ee7934…

Size

544.4 MB

Last updated

almost 3 years ago

docker pull bmplatform/biostatflow