DISCERN
DISCERN is a deep learning approach to reconstruction expression information of single-cell RNAseq data sets using a high quality reference.
Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. An interactive tutorial can be found in Tutorial.ipynb.
Prerequisites
We use poetry for dependency management. You can get poetry by
pip install poetry
or (the officially recommended way)
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
Installing
To get discern you can clone the repository by
git clone https://github.com/imsb-uke/discern.git
poetry can be used to install all further dependencies in an virtual environment.
cd discern
poetry install --no-dev
To finally run discern you can also directly use poetry with
poetry run commands
or spawn a new shell in the virtual environment
poetry shell
For further examples the first approach is presented.
Using discern
You can use the main function of discern for most use cases. Usually you have to preprocess your data by:
poetry run discern process <parameters.json>
An example parameters.json is provided together with an hyperparameter_search.json for hyperparameter optimization using ray[tune]. The training can be done with
poetry run discern train <parameters.json>
Hyperparameter optimization needs a ray server with can be started with
poetry run ray start --head --port 57780 --redis-password='password'
and can started with
poetry run discern optimize <parameters.json>
For projection 2 different modes are available: Eval mode, which is a more general approach and can save a lot of files:
poetry run discern project --all_batches <parameters.json>
Or projection mode which offers a more fine grained controll to which is projected.
poetry run discern project --metadata="metadatacolumn:value" --metadata="metadatacolumn:" <parameters.json>
which creates to files, one is projected to the average batch calculated by a metadatacolumn and a contained value. The second file is projected to the the average for each value in “metadatacolumn”; individually.
DISCERN also supports online training. You can add new batches to your dataset after the usual train with:
poetry run discern onlinetraining --freeze --filename=<new_not_preprocessed_batch[es].h5ad> <parameters.json>
The data gets automatically preprocessed and added to the dataset. You can run project afterwards as usual (without the --filename flag). --freeze is important to freeze non-conditional layers in training.
Testing
For critical parts of the model several tests has been implemented. They can be run with:
poetry run pytest --cov=discern --cov-report=term
(Requires the development version of discern).
Some tests are slow and don’t run by default, but you can run them using:
poetry run pytest --runslow --cov=discern --cov-report=term
Coding style
To enforce code style guidlines pylint and mypy are use. Example commands are shown below:
poetry run pylint discern ray_hyperpara.py
poetry run mypy discern ray_hyperpara.py
For automatic code formatting yapf was used:
yapf -i <filename.py>
These tools are included in the dev-dependencies.
Metadata
Release files for discern-reconstruction 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| discern-reconstruction-0.1.1.tar.gz | 44.3 kB | Without provenance | Details for discern-reconstruction-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| discern_reconstruction-0.1.1-cp36-cp36m-manylinux_2_34_x86_64.whl | CPython 3.6 | CPython 3.6 pymalloc | Linux glibc 2.34+ x86-64 | Details for discern_reconstruction-0.1.1-cp36-cp36m-manylinux_2_34_x86_64.whl |
Total release size: 400.4 kB
Release files / discern-reconstruction-0.1.1.tar.gz
| Download URL | discern-reconstruction-0.1.1.tar.gz |
|---|---|
| Size | 44.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
10d6261077f8ac37bb8fc2cc645d15f61b9e04fe1ec49e3f2bfeca05443bb687
|
|
BLAKE2b-256 checksum How to use checksums |
eb78a555a87103f7fc1977f4ce2c8a48c9f02e61a210776a13b3a15fefe08ec9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.6.15 Linux/5.16.18-200.fc35.x86_64
|
Release files / discern_reconstruction-0.1.1-cp36-cp36m-manylinux_2_34_x86_64.whl
| Download URL | discern_reconstruction-0.1.1-cp36-cp36m-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 356.1 kB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
5db5dcf7715717dd472b3b44d158b75db7a79d100d793259ffc55549023870a5
|
|
BLAKE2b-256 checksum How to use checksums |
e7324b8f9cdced84ebbcfd9c8a3b746f9097c973d2f3f2a9278138398752d308
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.6.15 Linux/5.16.18-200.fc35.x86_64
|
Security for discern-reconstruction 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.