Skip to main content
overall_fig.png

pypi Python 3.8+ Build codecov License: MIT Documentation Status Code style: black

GENetLib: A Python Library for Gene–environment Interaction Analysis via Deep Learning

GENetLib is a Python library designed for gene-environment interaction analysis via neural network, addressing the analytical challenges in complex disease research. This package is capable of handling a variety of input data types:

  • Scalar input data
  • Functional input data (or densely measured data)

This package also supports diverse output requirements:

  • Continuous output data
  • Binary output data
  • Survival output data

By integrating minimax concave penalty (MCP) and $L_2$-norm regularization within a neural network estimation framework, GENetLib offers an innovative solution for high-dimensional genetic data analysis. The framework is shown below.

framework

We provide a web-based documentation which introduces the meaning of function parameters, the usage of functions, detailed information about methods, and gives examples for each. The web page is available at documentations. This package has been uploaded to PyPI with previous versions, and the web page is available at PyPI package. Users can also check releases to get historical versions.

Features

GENetLib has the following features:

  • Comprehensiveness: Supports a variety of input and output formats, enabling the construction of comprehensive neural network models for G-E interaction analysis.
  • Flexibility: Offers a multitude of parameters allowing users to build models flexibly according to their specific needs.
  • Functional data compatibility: Implements methods for functional data analysis (FDA) in Python, facilitating the processing of functional data with Python.
  • Scalability: New methods for G-E interaction analysis via deep learning can be easily integrated into the system.

Installation

It is recommended to use pip for installation:

pip install GENetLib

To get further information about installation and independencies, please move to installation instructions.

Quick Start

We start with the two basic functions scalar_ge and func_ge.

scalar_ge

scalar_ge performs G-E interaction analysis via deep leanring when the input is scalar data.

from GENetLib.sim_data import sim_data_scalar
from GENetLib.scalar_ge import scalar_ge

# Get example data where input is scalar data and output is survival data
scalar_survival_linear = sim_data_scalar(rho_G = 0.25, rho_E = 0.3, dim_G = 500, dim_E = 5, n = 1500,
                                         dim_E_Sparse = 2, ytype = 'Survival', n_inter = 30)

# Set up the ScalerGE model
scalar_ge_res = scalar_ge(y = scalar_survival_linear['y'], G = scalar_survival_linear['G'], E = scalar_survival_linear['E'],
                          ytype = 'Survival',num_hidden_layers = 2, nodes_hidden_layer = [1000, 100], num_epochs = 100,
                          learning_rate1 = 0.06, learning_rate2 = 0.035, lambda1 = None, lambda2 = 0.09, Lambda = 0.1,
                          threshold = 0.01, split_type = 0, ratio = [7, 3], important_feature = True, plot = True)

func_ge

func_ge performs G-E interaction analysis via deep leanring when the input is functional data.

from GENetLib.sim_data import sim_data_func
from GENetLib.func_ge import func_ge

# Get example data where input is densely measured functional data and output is survival data
func_continuous = sim_data_func(n = 1500, m = 30, ytype = 'Continuous', seed = 123)

# Set up the FuncGE model
func_ge_res = func_ge(y = func_continuous['y'], X = func_continuous['X'], location = func_continuous['location'],
                      Z = func_continuous['Z'], ytype = 'Continuous', btype = 'Bspline', num_hidden_layers = 2,
                      nodes_hidden_layer = [100,10], num_epochs = 50, learning_rate1 = 0.02, learning_rate2 = 0.035,
                      nbasis1 = 5, params1 = 4, lambda1 = None, lambda2 = 0.01, Lambda = 0.01, Bsplines = 5,
                      norder1 = 4, split_type = 1, ratio = [3, 1, 1], plot_res = True)

For more information about the functions and methods, please check main functions.

Reference

The main referenced papers are:

Other referenced papers can be obtained in references.

License

GENetLib is licensed under the MIT License. See LICENSE for details.

Feedback

Release files for GENetLib 1.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for GENetLib 1.3.3
File Size Uploaded
genetlib-1.3.3.tar.gz 29.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for GENetLib 1.3.3
File Interpreter ABI Platform
genetlib-1.3.3-py3-none-any.whl Python 3 none any Details

Total release size: 66.8 kB

Release files / genetlib-1.3.3.tar.gz

Download URL genetlib-1.3.3.tar.gz
Size 29.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5140ab87dc5d52db37dc5be42cf3240d59f978f8fa3928dfb6d2745aea854a23
BLAKE2b-256 checksum
How to use checksums
1f0e1c6c9c836dd86cb22e2f2af6bba62c81171aabd96dd7f82052bf08533a62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / genetlib-1.3.3-py3-none-any.whl

Download URL genetlib-1.3.3-py3-none-any.whl
Size 37.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cdb4628c652ee6cc42c0c9c9a894375657133a1f63fb4c5a6e406f5c5c2323ec
BLAKE2b-256 checksum
How to use checksums
0d48500fb093f6b86daf9e7f7cbce6993f190ec12200f6e39f7ca0f8ce3ae47e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

This release

1.3.3 This release

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.9

2 release files

1.2.8

2 release files

1.2.7

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.9

2 release files

1.1.8

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.9

1 release file

1.0.8

1 release file

1.0.7

1 release file

1.0.6

1 release file

1.0.5

1 release file

1.0.4

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page