granger causality analysis
Project description
gnr
This file will become your README and also the index of your documentation.
Developer Guide
Setup
# create conda environment
$ mamba env create -f env.yml
# update conda environment
$ mamba env update -n gnr --file env.yml
# $ mamba env update -n gnr --file env.mac.yml
Install
pip install -e .
# install from pypi
pip install gnr
nbdev
# activate conda environment
$ conda activate gnr
# make sure the gnr package is installed in development mode
$ pip install -e .
# make changes under nbs/ directory
# ...
# compile to have changes apply to the gnr package
$ nbdev_prepare
Note: it might be useful to use the following snippet to enable hot reloading:
%load_ext autoreload
%autoreload 2
Publishing
# publish to pypi
$ nbdev_pypi
# publish to conda
$ nbdev_conda --build_args '-c conda-forge'
Usage
Installation
Install latest from the GitHub repository:
$ pip install git+https://github.com/dsm-72/gnr.git
or from conda
$ conda install -c dsm-72 gnr
or from pypi
$ pip install gnr
df_trj = make_mock_genes_x_tbins()
df_trj.head()
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | ... | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
wasf | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ... | 9 | 9 | 9 | 9 | 9 | 9 | 9 | 9 | 9 | 9 |
colq | 9 | 9 | 9 | 9 | 9 | 9 | 9 | 9 | 9 | 9 | ... | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
gpr1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ... | 9 | 9 | 9 | 9 | 9 | 9 | 9 | 9 | 9 | 9 |
chrm3 | 9 | 9 | 9 | 9 | 9 | 9 | 9 | 9 | 9 | 9 | ... | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
lmod2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | ... | 8 | 8 | 8 | 9 | 9 | 9 | 9 | 9 | 9 | 9 |
5 rows × 100 columns
gc_op = GrangerCausality(n_jobs=2)
df_res = gc_op.fit_transform(df_trj, fit_params={'standard_scaler':True, 'signed_correlation': True})
df_res.head()
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
wasf_y | colq_y | gpr1_y | chrm3_y | lmod2_y | tek_y | kank3_y | oca2_y | taz_y | map4k1_y | |
---|---|---|---|---|---|---|---|---|---|---|
wasf_x | 1.000000 | 0.683091 | 0.314458 | 0.144127 | 0.000818 | 1.000000 | 1.000000 | 0.000066 | 0.102470 | 0.006449 |
colq_x | 1.000000 | 1.000000 | 0.779284 | 1.000000 | 1.000000 | 0.001091 | 0.192685 | 0.675090 | 1.000000 | 0.806543 |
gpr1_x | 0.805541 | 0.042286 | 1.000000 | 0.892251 | 0.795418 | 0.823063 | 1.000000 | 0.542452 | 0.001091 | 0.852052 |
chrm3_x | 0.001091 | 0.073638 | 0.168425 | 1.000000 | 0.632585 | 1.000000 | 0.102470 | 0.542452 | 1.000000 | 0.367649 |
lmod2_x | 0.683091 | 0.000104 | 0.031086 | 0.220671 | 1.000000 | 0.683091 | 0.000818 | 0.367649 | 1.000000 | 0.017608 |
gc_op.plot_df_org(figsize=(4,4))
gc_op.plot_df_res(figsize=(4,4))
Documentation
Documentation can be found hosted on GitHub repository pages. Additionally you can find package manager specific guidelines on conda and pypi respectively.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gnr-0.0.4.tar.gz
(16.0 kB
view details)
Built Distribution
gnr-0.0.4-py3-none-any.whl
(16.3 kB
view details)
File details
Details for the file gnr-0.0.4.tar.gz
.
File metadata
- Download URL: gnr-0.0.4.tar.gz
- Upload date:
- Size: 16.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 086b6a42722c0afa4c65ec0c39a3dde17ae1a1a032f38e4dd0681e71880dadf7 |
|
MD5 | 2f14f38b25ba8a59a6e5932d24f28b44 |
|
BLAKE2b-256 | 7bf64d62dba254665d3fa33b116f41f6919cbf8deaf2ef80a8fa994e5791096a |
File details
Details for the file gnr-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: gnr-0.0.4-py3-none-any.whl
- Upload date:
- Size: 16.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21ebfeed74e05dd28962dd100e5a76f5736f931984d4f4d7742413d0233da451 |
|
MD5 | 0055c9bde1e00955e7b1d21cc469284e |
|
BLAKE2b-256 | 615d42ab5ef75fcf7260839bef67086b8e1124fec8fa5b7c751f7c76b44440db |