Skip to main content

.

Project description

Adaptive Joint Graphical Model

Python modules required to be installed

  • The package needs these Python modules to be installed beforehand.
    1. pywt, install using: "conda install pywavelets"
    2. prox_tv, install using: "pip install prox_tv"
    3. Other commonly used Python packages: numpy, pandas, scipy, scikit-learn

We recommend using Python version ≥ 3.7. The package can only be used on Mac or Linux, not on Windows, because the "prox_tv" module is not available for Windows.

Install the package

Data description and loading

In the following example, we consider generating samples from three subtypes. The method of sample generation is consistent with the simulation study described in paper. Each subtype has the same number of genes and the same number of samples($p=200$, ${n_k} = 300$).

In AJGM, the input data should be a matrix where each row represents the gene expression values of different samples. In this example, the input matrix has 900 rows and 200 columns.

Parameters of AJGM

  • X: In the AJGM code, we use X to represent the samples $x$.
  • Y: In the AJGM code, we use Y to represent the representative samples ${x^{'}}$.
  • L: Number of subtypes.
  • lambda1, lambda2, lambda3: Penalty parameters $\lambda_1, \lambda_2, \lambda_3$.
  • miu, tre: Parameters for adaptive weights $\gamma$, $tre$ (all default: 0.1).
  • impute_x: Boolean, whether to perform imputation for samples X (default: False).
  • impute_y: String, specifies imputation method for representative samples Y: 'x': Imputation method if we set representative samples Y as X. 'sample': Imputation method if we generate representative samples Y by sampling. 'none': Do not perform imputation for Y (default).
  • EMthreshold: EM algorithm convergence threshold (default: 0.1).
  • MAX_iter: Maximum number of iterations for the EM algorithm (default: 100).

Fitting AJGM

We first use method setting ${x_l}$ as $x_l^{'}$ to obtain representative sample Y. Since the generated data follows a mixture of multivariate normal distributions, data imputation is not necessary.

res1=AJGM(X=A, Y=A, L=3, lambda1=0.01, lambda2=0.01, lambda3=0.1,miu=0.1,tre=0.1,impute_x=False,
impute_y='none', EMthreshold=0.1, MAX_iter=100)

We then use sampling to generation representative sample Y. The function ‘sample_multivariate_normal‘ can obtain Y through sampling. The parameter n represents the number of samples obtained through sampling.

B=sample_multivariate_normal(A, n=100)
res1=AJGM(X=A, Y=B, L=3, lambda1=0.01, lambda2=0.01, lambda3=0.1,miu=0.1,tre=0.1,impute_x=False,
impute_y='none', EMthreshold=0.1, MAX_iter=100)

Structure of the output

The AJGM function returns a dictionary with the following components:

  • pie: Estimated parameters $\pi$.
  • mu: Estimated parameters $\mu$.
  • covinv: Estimated parameters $\Omega$ (The precision matrices for $K$ subtypes and an overall precision matrix). The matrix covinv is of size $p$ rows by $p*(K+1)$ columns. Columns $1$ to $p$ represent the precision matrices for subgroup 1, columns $p+1$ to $2p$ represent subgroup 2, and so on. Columns $pK+1$ to $p*(K+1)$ represent the precision matrix for the overall network.
  • membership: Cell classification results.

References

  1. Souvik Seal, Qunhua Li, Elle Butler Basner, Laura M Saba, and Katerina Kechris. Rcfgl: Rapid condition adaptive fused graphical lasso and applica-tion to modeling brain region co-expression networks. PLoS computational biology, 19(1):e1010758, 2023.
  2. Tan. Research on gene network inference method and application based on probabilistic graph modeling. PhD thesis, Central China Normal University, 2022.

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

AJGM-1.0.9.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

AJGM-1.0.9-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file AJGM-1.0.9.tar.gz.

File metadata

  • Download URL: AJGM-1.0.9.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.16

File hashes

Hashes for AJGM-1.0.9.tar.gz
Algorithm Hash digest
SHA256 1c6ef602c56fc8fa4567788da9414d57a5cbedc45a672403a30330e4c50f8e01
MD5 d5d8f964b54209c407d37b2379fa60a3
BLAKE2b-256 07b987755c6a3903aca3c8617adf6b18ba7d79a14adc3bd85b6c3b31f4ded982

See more details on using hashes here.

File details

Details for the file AJGM-1.0.9-py3-none-any.whl.

File metadata

  • Download URL: AJGM-1.0.9-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.16

File hashes

Hashes for AJGM-1.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 3d009108ef05876f0ca3bd192898b205214e283dbc541d4aa23f1d48bd6805b4
MD5 d37403d7c7644ee95daedc83c72981ae
BLAKE2b-256 522eec81eb4bc18834e50e4b8c90e790005bea9753fd03590ee550b720425b0b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page