Skip to content

Commit

Permalink
fix readme, write logfile
Browse files Browse the repository at this point in the history
  • Loading branch information
mjoppich committed Apr 10, 2019
1 parent 19added commit 2c22142
Show file tree
Hide file tree
Showing 6 changed files with 121 additions and 47 deletions.
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,19 @@ bioGUI specifically aims at Windows users, as Microsoft just introduced the Wind
This system allows the usage of said sophisticated tools on a regular Windows computer as most people have.
With bioGUI one also does not need any knowledge about the command line, because the task of executing a given tools becomes a point & click solution.

### What is bioGUI not?

It is not about generating a GUI by its own.

# Where can I get bioGUI?

bioGUI is available either as source from github, or as prebuilt-binary distribution from [github releases](https://github.com/mjoppich/bioGUI/releases).
*End-users* will probably prefer to download and unzip the [prebuilt binaries](https://github.com/mjoppich/bioGUI/releases).
bioGUI is available for *Windows*, *Mac OS* and *Linux* as prebuilt-binary distribution or source from [github releases](https://github.com/mjoppich/bioGUI/releases).
The binary distribution (zip-files) are targeted for *end-users*: [prebuilt binaries](https://github.com/mjoppich/bioGUI/releases).

After downloading the zip-archive, please unzip the archive to a location of your preference. Then simply start the executable (bioGUI.exe on Windows, or bioGUI on linux).

On Windows, please follow the steps on [how to setup WSL](http://biogui.readthedocs.io/en/latest/build_wsl.html).

On any aptitude supported platform (Windows with WSL, Ubuntu), please execute the "First Time ... Setup" from the list of available templates.
On any aptitude supported platform (Windows with WSL, Ubuntu), please download the "First Time Ubuntu/WSL/apt-get Setup" from the list of available templates and install it via *Install Template Module* (install program: *First Time Ubuntu/WSL/apt-get setup*).
For Mac OS, please execute download and execute *First Time Mac OS Setup*.

Unfortunately, there currently is no binary available for Mac OS X.
Please also refer to our [User Guide](http://biogui.readthedocs.io/en/latest/user_guide.html).

## Setup First Time Use

Expand All @@ -48,6 +45,15 @@ Unfortunately, there currently is no binary available for Mac OS X.
If you want to know which modules are already available, please visit the supporting information [website](https://www.bio.ifi.lmu.de/software/biogui/index.html). There you can see a list of available modules, submit your own or request new template.
If you have any problem, or you want to request a new template, you may also use the github issue tracker right in this repository!

## Developer's Guides

If you are a developer and want to write a *bioGUI* (install template), there's good news: it's fairly easy.

Please follow [this guide](http://biogui.readthedocs.io/en/latest/biogui_idea.html) for information on how to write the *install module*.
Within the *install module* you need to embed/write your actual GUI definition. This is explained in the [install template example](http://biogui.readthedocs.io/en/latest/install_template_example.html).

From my experience in writing *install modules*, it is best to copy an existing install template and modify this, for both the install part, as well as the *GUI* part.

## I want to know more about bioGUI

You can find a detailed documentation of bioGUI at [readthedocs](http://biogui.readthedocs.io/en/latest).
Expand Down
43 changes: 29 additions & 14 deletions doc/biogui_idea.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,28 @@ The text after the shebang is shown as title in the *Install template Module*.

.. code:: bash
echo "Dependencies: unzip"
if [ ! "$2" = "" ]; then
echo "Installing dependencies"
echo $2 | sudo -S apt-get update
echo $2 | sudo -S apt-get -y install unzip
if [ "$(uname)" == "Darwin" ]; then
echo "Installing brew gcc"
brew install gcc
else
echo "No dependencies"
echo $2 | sudo -S apt-get update
echo $2 | sudo -S apt-get install build-essential
fi
else
echo "No sudo password, not installing dependencies"
fi
If a **sudo** password is supplied, dependencies are installed. This must be compatible with Ubuntu's aptitude, as this is what WSL runs on.
Any developer is free to also support Mac OS and *brew*, for instance.
Using the `uname` switch, *bioGUI* also supports Mac OS and *brew*, for instance.

Since a lot of harm can be done using the super-user account, install modules are manually curated after submission.

.. code:: bash
Expand Down Expand Up @@ -109,12 +119,6 @@ For reasons of parsimony, this is only done when the expected file or folder doe
After downloading and unzipping, the application can be built in the target directory.
Finally, if wanted, the path to the application's executable is added to the $PATH variable.

.. code:: bash
#now fix spaces in path
perl -pi -e 's/my \$align_prog_s= File::Spec->catpath\(\$vol\,\$script_path\,\$align_bin_s\);/my \$align_prog_s= "\\\"".File::Spec->catpath(\$vol,\$script_path,\$align_bin_s).\"\\\"\";/' hisat2
perl -pi -e 's/my \$align_prog_l= File::Spec->catpath\(\$vol\,\$script_path\,\$align_bin_l\);/my \$align_prog_l= "\\\"".File::Spec->catpath(\$vol,\$script_path,\$align_bin_l).\"\\\"\";/' hisat2
Certain programs may need some fixes to work properly on Mac OS, Linux or WSL.
This is the place where such fixes could go.

Expand All @@ -127,7 +131,16 @@ Finally we can send the template to *bioGUI*, if an IP address and port have bee
IP=$4
PORT=$5
nc $IP $PORT << EOF
NCCMD=""
if [ "$(uname)" == "Darwin" ]; then
NCCMD="nc -c $IP $PORT"
else
NCCMD="nc -q 0 $IP $PORT"
fi
$NCCMD <<EOF
<template description="hisat2 2.0.5 aligner" title="hisat2 2.0.5">
...
Expand All @@ -143,7 +156,9 @@ Finally we can send the template to *bioGUI*, if an IP address and port have bee
fi
Make sure to use ``nc`` to send the content, as this will not work on Mac OS otherwise.
Make sure to use ``nc`` to send the content back to *bioGUI*.
Unfortunately the nc-programs differ on Mac OS and Ubuntu, hence the command must be altered according to the underlying OS.
In order to customize the template inbetween the ``EOF``, bash variables to be replaced must be written as ``${var-name}``.
This conflicts with how *bioGUI* expects variables. Therefore, make sure to escape the backslaash where you want to access variables in the *bioGUI* template!
Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

# General information about the project.
project = 'bioGUI'
copyright = '2017, Markus Joppich'
copyright = '2017-2019, Markus Joppich'
author = 'Markus Joppich'


Expand Down
79 changes: 57 additions & 22 deletions doc/user_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,64 @@ Most (install) templates will require you to have wget and netcat installed. Usi
You can get brew from `here <http://brew.sh/>`_

Downloading Templates
=====================

.. _install_download_templates:

Installing new software with Install Modules
============================================

After downloading an *Install Module*, the *Install Template Module* will list the downloaded install template (you might need to *reload* once).
The screenshot below shows the *Install Template Module*.
In the dropdown menu, the *hisat2* install template has been chosen.
Since this module is executed on Windows, *WSL* is selected.
*hisat2* is supposed to be installed into the *User Data Dir*, which is on *WSL* and linux usually ``~/.local/share/bioGUI``.
This is the directory where *bioGUI* installs new programs.
Advanced users may want to change this settings, but in general, it should be left.

In order to automatically install dependencies, the sudo-password must be supplied.
This is the password you set up during the installation of the *WSL* feature.
This gives *bioGUI* administrative rights within *WSL* such that it can install dependencies automatically.

Finally the path for the specific *GUI* template has to be set. *bioGUI* by default only searches the template directory besides the executable.
*GUI* templates must have the file extension ``.gui``. If your entered template name does not end with this extension, the extension is appended to your filename.
As a short-cut, if you just enter a name (e.g. mygui), *bioGUI* will save the new template in the template directoy with the filename `mygui.gui`.

.. image:: ./images/usage/install_template.PNG
:scale: 50


Use-case: Windows setup
=======================
The binary distribution (zip-files) are targeted for *end-users*: [prebuilt binaries](https://github.com/mjoppich/bioGUI/releases).
Download the Windows version.

Make sure that the Windows Subsystem for Linux (WSL) is installed.
Please follow the steps on [how to setup WSL](http://biogui.readthedocs.io/en/latest/build_wsl.html).

After downloading the zip-archive, please unzip the archive to a location of your preference. Then simply start the executable (bioGUI.exe on Windows).

On any aptitude supported platform (e.g. Windows with WSL, Ubuntu), please download the "First Time Ubuntu/WSL/apt-get Setup" from the list of available templates and install it via *Install Template Module* (install program: *First Time Ubuntu/WSL/apt-get setup*).

Below this process is shown by an animation.

Setup First Time Use
--------------------

Part of *bioGUI* is a user-friendly accessibility of templates for various programs.
.. image:: ./images/bioGUI_wsl_setup.gif
:scale: 50

Install an install module
-------------------------

.. image:: ./images/bioGUI_graphmap.gif
:scale: 50



Adding Own Templates
=====================

Part of *bioGUI* is a simple accessibility of templates for various programs.
Therefore, application developers and sophisticated users can upload their templates to our website in order to make their template available to other users.
The user has to submit his name, eMail address, a template name and the template itself.
He can select whether he wants to be an anonymous user (user name is always hidden) and whether this is an installation script (which downloads and creates the \ac{GUI} template specifically for this installed application) or a regular template.
Expand All @@ -55,7 +108,7 @@ A screenshot of the template submission is shown below.
.. image:: ./images/templates/template_submission.png
:scale: 50

Additionally the (`bioGUI website <https://www.bio.ifi.lmu.de/software/bioGUI>`_) also contains a searchable list of already available templates.
Additionally the (`bioGUI website <https://www.bio.ifi.lmu.de/software/biogui>`_) also contains a searchable list of already available templates.
Available templates are only shown and can be downloaded via the *bioGUI* application.

.. image:: ./images/templates/existing_templates.png
Expand All @@ -68,21 +121,3 @@ Since it is possible to copy or alter templates, *bioGUI* never overwrites exist

.. image:: ./images/templates/biogui_selection.png
:scale: 50

.. _install_download_templates:

Installing new software with Install Modules
--------------------------------------------

After downloading an *Install Module*, the *Install Template Module* will list the downloaded install template.
The screenshot below shows the *Install Template Module*.
In the dropdown menu, the *hisat2* install template has been chosen.
Since this module is executed on Windows, *WSL* is selected.
*hisat2* is supposed to be installed into the *User Data Dir*, which is on *WSL* and linux usually ``~/.local/share/bioGUI``.
In order to automatically install dependencies, the sudo-password is supplied, which has been set up during installing the *WSL* feature.
Finally the path for the specific *GUI* template has to be set. *bioGUI* by default only searches the template directory besides the executable.
*GUI* templates must have the file extension ``.gui``. If your entered template name does not end with this extension, the extension is appended to your filename.


.. image:: ./images/usage/install_template.PNG
:scale: 50
15 changes: 15 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,23 @@
#include <QApplication>
#include "bioGUIapp.h"

#include <iostream>
#include <fstream>
#include <string>

int main(int argc, char **argv)
{

std::ofstream out("log.txt");
std::streambuf *coutbuf = std::cout.rdbuf();
std::streambuf *cerrbuf = std::cerr.rdbuf();

std::cout.rdbuf(out.rdbuf());
std::cerr.rdbuf(out.rdbuf());

freopen("output.txt","w",stdout);


bioGUIapp* pApp = new bioGUIapp(argc, argv);
pApp->exec();
delete pApp;
Expand Down
7 changes: 5 additions & 2 deletions src/parsing/nodes/ExecutionOutputNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ Q_OBJECT
{

std::string sLocation = this->getNodeValueOrValue(m_sLocation, m_sLocation, pID2Node, pInputID2Value, pInputID2FunctionWidget);
LOGERROR("Opening File")
LOGERROR(sLocation)
m_pOutputStream = new std::ofstream(sLocation);

ExtendedProcFileBuffer* pBuffer = this->createProcFileBuffer(pProcess, QProcess::StandardOutput);
Expand All @@ -344,7 +346,8 @@ Q_OBJECT
{

std::string sLocation = this->getNodeValueOrValue(m_sLocation, m_sLocation, pID2Node, pInputID2Value, pInputID2FunctionWidget);

LOGERROR("Opening File")
LOGERROR(sLocation)
m_pOutputStream = new std::ofstream(sLocation);

ExtendedThreadFileBuffer* pBuffer = this->createThreadFileBuffer(pThread, QProcess::StandardOutput);
Expand Down Expand Up @@ -600,7 +603,7 @@ protected slots:
void receiveText(QString sString)
{

std::cerr << sString.toStdString();
//std::cerr << sString.toStdString();

if (m_pOutputStream)
{
Expand Down

0 comments on commit 2c22142

Please sign in to comment.