Inigen
[![Tests][badge-tests]][link-tests] ![Documentation][badge-docs]
Inigen (Intrinsic and Neighborhood-Induced Gene Expression generatioN)
Resources
- An installation guide, tutorials and API documentation is available in the documentation.
- Please use issues to submit bug reports.
- If you would like to contribute, check out the contributing guide.
- If you find Inigen useful for your research, please consider citing the Inigen manuscript.
Reference
Installing the Python Environment
SANGER INTERNAL: The environment is already available on farm.
To activate it:
module load cellgen/conda
conda activate /nfs/team361/aa36/PythonEnvs_2/envinigendec27/
Alternatively, you can create the python environment yourself:
git clone https://github.com/Lotfollahi-lab/inigen.git # clone the repo
cd ./inigen/
conda env create -f environment.yml --prefix SOME_EMPTY_PATH
Installing WandB
It's highly recommended to setup wandb before proceeding.
To do so:
- Go to https://wandb.ai/ and create an account.
- Create a project called "inigen".
Quick Start
You can use inigen as a local package, because it's not pip installable at the moment.
To do so:
git clone https://github.com/Lotfollahi-lab/inigen.git # clone the repo
cd ./inigen/
The easiest way to run inigen is through the command line interface (CLI). This involves two steps
- Creating four config files (you duplicate/modify template config files).
- Running inigen with a single command line.
Rule of thumbs §1 for modifying the config files
In the template config files, there are TODO-s of different types that you may need to modify
- Category 1:
TODO:ESSENTIAL:TUNE: the basic/essential parts to run inigen. - Category 2:
TODO:TUNE: less essneitial and/or technical details. - Category 3:
TODO:check: parameters of even less importance compared to category 1 and category 2.
If you are, for example, a biologist with no interest/experience in computational methods, you can only modify "Category 1" above and leave the rest of configurations untouched. "Category 2" and "Category 3" come next in both priority and the level of details.
Step 1 of Using the CLI: Making 4 config files
Please follow these steps
-
Training data config file:
- Make a copy of
./cli/SampleConfigFiles/config_data_train.ymland rename it toYOUR_CONFIG_DATA_TRAIN.yml - Read the block of comments tarting with "# inigen expects a list of .h5ad files stored on disk, ...".
- Modify some parts marked by
TODO:...and according to "Rule of thumbs §1" explained above.
- Make a copy of
-
Testing data config file:
- Make a copy of
YOUR_CONFIG_DATA_TRAIN.ymland rename it toYOUR_CONFIG_DATA_TEST.yml - Rename all ocrrences of
config_dataloader_traintoconfig_dataloader_test
- Make a copy of
-
Model config file:
- Make a copy of
./cli/SampleConfigFiles/config_model.ymland rename it toYOUR_CONFIG_MODEL.yml. - Modify some parts marked by
TODO:...and according to "Rule of thumbs §1" explained above.
- Make a copy of
-
Training config file:
- Make a copy of
./cli/SampleConfigFiles/config_training.ymland rename it toYOUR_CONFIG_TRAINING.yml. - Modify some parts marked by
TODO:...and according to "Rule of thumbs §1" explained above.
- Make a copy of
Step 2 of Using the CLI: Running inigen
cd ./inigen/ # if you haven't already done it above.
cd ./cli/
python inigen_cli.py \
--file_config_data_train YOUR_CONFIG_DATA_TRAIN.yml \
--file_config_data_test YOUR_CONFIG_DATA_TEST.yml \
--file_config_model YOUR_CONFIG_MODEL.yml \
--file_config_training YOUR_CONFIG_TRAINING.yml \
--path_output "./Your/Output/Path/ToDump/Results/" \
--flag_verbose "True" \
The recommended way of accessing inigen predictions is by adata_inigenOutput_norm.h5ad and adata_inigenOutput_unnorm.h5ad created in the provided --path_outputand adata.obsm and adata.uns in these files.
In the former file ..._norm.h5ad the readcount matrix adata.X as well as inigen predictions Xint and Xspl are row normalised, while in the latter file _unnorm.h5ad they are not.
inigen dumps a README file in the provided --path_output, as well as each subfolder therein.
Common Issues
- Use absolute paths (and not relative paths like
../../some/path/) in the config files, as well as when runningpython inigen_cli.py .... - TODO: intro to the script for tune window width.
- It's common to face out of memory issue in the very last step where the big anndata objects
adata_inigenOutput_norm.h5adandadata_inigenOutput_unnorm.h5adare created and dumped. If that step fails, the results are still accesible in the output path the subfolderCheckpointAndPredictions/. One can laod the.ptfiles by
import torch
dict_results = torch.load(
"the/output/path/CheckpointAndPredictions/predictions_slice_1.pt",
map_location='cpu'
)
Release notes
TODOTODO See the changelog.
Contact
For questions and help requests, you can reach out in the scverse discourse. If you found a bug, please use the issue tracker.
Citation
t.b.a
Metadata
Release files for inigen 0.0.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 | |
|---|---|---|---|
| inigen-0.0.1.tar.gz | 4.3 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| inigen-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 4.4 MB
Release files / inigen-0.0.1.tar.gz
| Download URL | inigen-0.0.1.tar.gz |
|---|---|
| Size | 4.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
32af9bd1656397e5d0dc8634f663e7e8d4aa7bb51bb028fb56659e2dace04799
|
|
BLAKE2b-256 checksum How to use checksums |
ea6d1c16f35b8644323a4b835fdf12364512fd889c7f4d4e0c7c1190ee30044c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.12
|
Release files / inigen-0.0.1-py3-none-any.whl
| Download URL | inigen-0.0.1-py3-none-any.whl |
|---|---|
| Size | 98.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c10466745835f878b10431e51b5ff603fe48060ce0b161def1410c014d9f147a
|
|
BLAKE2b-256 checksum How to use checksums |
ac5717d8315f22b90efb3214a392004f0cd488392634fafbc91dc7624414d88e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.12
|