Skip to content

Commit

Permalink
Merge pull request #37 from HiDiHlabs/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
sebastiantiesmeyer authored Sep 28, 2021
2 parents e882ec0 + 7140266 commit 1d2af12
Show file tree
Hide file tree
Showing 15 changed files with 153 additions and 120 deletions.
6 changes: 6 additions & 0 deletions ReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
0.2.0
- Version and copyright added to interface
- Drag and drop fixed

0.1.0
- Alpha release
Binary file added docs/res/imgs/ControlPanel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/res/imgs/DownloadPlot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/res/imgs/KDE.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/res/imgs/KDE_Optimization.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/res/imgs/ParameterPreview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/res/imgs/Threshold_Optimization.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/res/imgs/inferredCelltypes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 26 additions & 21 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,16 @@ what the differences are follow the guide ":ref:`local-or-server`"
Requirements
============

..
TODO Check requirements
SSAM-lite and SSAM-lite-server should run on all modern browsers supporting JavaScript ES5
and webGL.
SSAM-lite and SSAM-lite-server should run on all modern browsers supporting JavaScript
and webGL. It has been verified to run on Firefox, Chrome, Edge and Safari.

SSAM-lite requires an internet connection to access the TensorFlow.js (v2.0.0)
library.

SSAM-lite-server requires Python (v3.9.7) as well as the Python packages
Flask (v0.8), pandas (v1.3.2) and NumPy (v1.20.3). It also requires the
TensorFlow.js (v2.0.0) library, however, this will be downloaded upon first setup
Flask (v0.8), pandas (v1.3.2), NumPy (v1.20.3), and Numba (v0.53.1). It also requires the
TensorFlow.js (v2.0.0), Plotly (v2.5.1), and Bootstrap (v4.0.0) JavaScript libraries.
However, these will be downloaded upon first setup
and after that, no internet connection is required anymore.


Expand Down Expand Up @@ -63,42 +61,49 @@ To install SSAM-lite-server you first need to clone the
git clone https://github.com/HiDiHlabs/ssam-lite-server.git
Next we create a ``conda`` environment and activate it.
Next, we change into the cloned directory, create a ``conda`` environment including
all packages and dependencies, and activate it.

.. code-block:: bash
conda create -n ssam-lite-server
cd ssam-lite-server
conda env create -f environment_ssam-lite-server.yml
conda activate ssam-lite-server
.. note::

You can set the environment name to your preferences.
You can adjust the YAML file to set the environment name to your preferences. Or
alternatively, create your own environment and install the required Python version and
packages with the following command.

.. code-block:: bash
conda install python=3.9.7 flask=0.8 numpy=1.20.3 pandas=1.3.2 numba=0.53.1
Now we need to install the required Python version and some
additional Python packages.
We also retrieve the static files required by SSAM-lite-server including the Bootstrap, Plotly
and TensorFlow.js JavaScript libraries.

.. code-block:: bash
conda install python=3.9.7 flask=0.8 numpy=1.20.3 pandas=1.3.2
python fetch_static_files.py
..
Download the background signature matrix from Dropbox <https://www.dropbox.com/s/8qxkgg16zelg6ya/new_sheet.tar.xz?dl=0>
Decompress it and save it in the folder :file: `app/data/genetics/`

Finally, start the Flask app (the default port will be 5000).

.. code-block:: bash
export FLASK_APP=./ssam-lite-server/flask/run.py
export FLASK_APP=run.py
flask run
.. note::

The port and further settings can be made in the *run.py* file or when starting the app with
``flask run``. For further information we would refer the reader to the
`Flask documentation <https://flask.palletsprojects.com/>`__.

..
TODO check with Shashwat
Upon first setup the app will download some JavaScript dependencies such as
the TensorFlow.js library
`Flask documentation <https://flask.palletsprojects.com/>`__.
4 changes: 2 additions & 2 deletions docs/source/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ Click on "Get going!"
You are in the **Data Center** now. Click on "Coordinates" and select the *coordinates.csv* from the *Codeluppi_osmFISH* directory in the test data.
Do the same for the "Signatures" (obviously use the *signature.csv* from the same directory this time, *duh!*)

In the **Parameters** section leave the *Vector field wdith* and *KDE kernel bandwidth* at their default and set the
In the **Parameters** section leave the *Vector field wdith* at its default, set the *KDE kernel bandwidth* to 5 and the
*Cell assignment threshold* to 50.

The time is flying by so we head straight for **Analysis** without any further explanation and click on
"Run Kernel Density Estimation". Time for a short break now, this step might take 1 or 2 minutes.
"Run Kernel Density Estimation". Time for a short break now, this step might take a few seconds.

When the KDE has been estimated scroll further down and hit "Infer Cell Types". Done!

Expand Down
20 changes: 13 additions & 7 deletions docs/source/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,22 @@ SSAM-lite lets you interactively explore and adjust the plots to your needs.
Alternatively, when hovering over a plot a small control panel will be displayed in the top right corner
which offers some additional functionality.

Additional information on a data point can be displayed by hovering over it.
.. image:: ../res/imgs/Control Panel.png
:width: 300
:align: center
:alt: Control panel for plots

|
TODO screenshot
Additional information on a data point can be displayed by hovering over it.


Data
===========

The data will be uploaded in the **Data Center** section of the tool. By clicking the "Coordinates"
or "Signatures" button and selecting the correct files.
The data will be uploaded in the **Data Center** section of the tool. Just click the "Coordinates"
or "Signatures" button and selecting the correct files. Alternatively, drag and drop the file from your
file browser onto the corresponding button to upload it.
To be able to use SSAM-lite you need to prepare your data in csv format.
Two input files are required and must be structured as follows:

Expand Down Expand Up @@ -198,8 +204,8 @@ the browser to recalculate (this might take a few moments).

Once you are happy with your choice you can proceed with the actual analysis.

For our example analysis we are going to proceed with a *Vector field width* of 500, a *KDE kernel bandwidth*
of 1, and a *Cell assignment threshold* of 50.
For our example analysis we are going to proceed with a *Vector field width* of 1500, a *KDE kernel bandwidth*
of 3, and a *Cell assignment threshold* of 12.


Analysis
Expand Down Expand Up @@ -233,7 +239,7 @@ and refine those before rerunning the analysis.
Save results
================

All plots are produced with `Plotly <https://plotly.com/>`__ and can be downloaded
All plots are produced with Plotly and can be downloaded
by hovering over the plot which triggers a control panel to appear in the upper right corner,
now click the camera icon which lets you download the current plot as png file.

Expand Down
Loading

0 comments on commit 1d2af12

Please sign in to comment.