Skip to content

scRNA Metabolic Entropy Analysis is a Python package designed for the analysis of single-cell RNA sequencing data with a focus on entropy calculations within metabolic gene networks.

qiusir1/scRNA-Metabolic-Entropy-Analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scRNA Metabolic Entropy Analysis

Overview

scRNA Metabolic Entropy Analysis is a Python package designed for the analysis of single-cell RNA sequencing data with a focus on entropy calculations within metabolic gene networks. The package offers tools for data preprocessing, network analysis, and entropy computation.

Installation

Clone the repository:

git clone https://github.com/yourusername/scRNA_Entropy_Analysis.git

cd scRNA_Entropy_Analysis
pip install .

Usage

Import the package:

from entropy_analysis.data_preprocessing import load_and_preprocess_data, filter_genes, load_internal_data
from entropy_analysis.network_analysis import construct_network, get_subnetwork_matrices
from entropy_analysis.entropy_calculation import comp_srana

Load internal data

entrez_id, metabolic_Gene, network_data = load_internal_data()

Load and preprocess data

# Example usage

path = '/path/to/directory'
file_name = 'my_data_file.h5ad'
adata = load_and_preprocess_data(path, file_name) # adata is a normalized AnnData object.

''' note: please specify your groups to be calculated, e.g., 
cells = pd.read_csv("%s/cells.tsv" % PATH_I, sep="\t")
adata.obs["Diganosis"] =  cells["diagnosis"].values
adata.obs["celltype"] =  cells["celltype"].values
adata.obs["braak_diff"] =  cells["braak_diff"].values'''

Filter genes and prepare network data

adata_filtered, network_data_filtered = filter_genes(adata, entrez_id, metabolic_Gene, network_data)

Construct network and get subnetwork matrices

subgraph = construct_network(network_data_filtered)
adjMC_m, expMC_m = get_subnetwork_matrices(subgraph, adata_filtered)

Compute entropy

entropy_results = comp_srana(adjMC_m, expMC_m, local=True, mc_cores=16)
# The results now include 'SR', 'locS', 'nlocS', and 'expMC_var'

About

scRNA Metabolic Entropy Analysis is a Python package designed for the analysis of single-cell RNA sequencing data with a focus on entropy calculations within metabolic gene networks.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages