A toolkit for molecular annotation of brain networks, integrating transcriptome, neurotransmitters, and mitochondria.
Project description
BrainNetAnno
A toolkit for molecular annotation of brain networks, integrating transcriptome, neurotransmitters, and mitochondria.
Features
- CPU-only implementations (NumPy/SciPy/Scikit-learn/Statsmodels/Matplotlib)
- Shared utilities in
BrainNetAnno.utils - PLS pipelines:
*_pls_cge.run_*_pls_pipeline - Enrichment analyses:
gene_celltype.run_pipeline,gene_layer.run_pipeline
Requirements
- Python >= 3.8
- Main dependencies (see
pyproject.toml):- numpy, pandas, scipy, scikit-learn, statsmodels, matplotlib
Installation
From source:
pip install BrainNetAnno
Or build a wheel and install:
python -m pip install -U build
python -m build
pip install dist/BrainNetAnno-<version>-py3-none-any.whl
Quickstart (Python API)
- Transcriptome PLS-CGE pipeline:
from BrainNetAnno.transcriptome_pls_cge import run_transcriptome_pls_pipeline
run_transcriptome_pls_pipeline(
t_values_file="path/to/fc_deviation.csv", # square matrix CSV, no header
gene_expression_file="path/to/gene_contrib.csv", # contains 'Region_Pair'
output_best_genes_csv="path/to/best_genes.csv",
fig_outputfile="path/to/rmse_variance.tif",
)
- Cell-type enrichment:
from BrainNetAnno.gene_celltype import run_pipeline
res = run_pipeline(
celltype_csv="path/to/celltypes_PSP.csv", # columns: gene, class
target_genes_csv="path/to/best_genes_SCZ.csv", # column: Gene Index
output_csv="path/to/celltype_enrichment_results.csv",
)
print(res.head())
- Cortical layer enrichment:
from BrainNetAnno.gene_layer import run_pipeline
res = run_pipeline(
layer_marker_path="path/to/41593_2020_787_MOESM3_ESM.xlsx", # sheet: Table S4B
target_genes_path="path/to/best_genes_all.csv",
output_csv="path/to/ALL_gene_layer_analysis_results.csv",
)
print(res.head())
- Neurotransmitter PLS pipeline:
from BrainNetAnno.neurotransmitter_pls_cge import run_neurotransmitter_pls_pipeline
best_n, df = run_neurotransmitter_pls_pipeline(
fc_matrix_path="path/to/fc_deviation.csv", # square matrix CSV, no header
nt_contrib_csv="path/to/nt_contrib.csv", # contains 'Region_Pair'
output_weights_csv="path/to/nt_weights.csv",
)
print(best_n)
print(df.head())
- Mitochondrial PLS pipeline:
from BrainNetAnno.mitochondrial_pls_cge import run_mitochondrial_pls_pipeline
best_n, df = run_mitochondrial_pls_pipeline(
fc_matrix_path="path/to/fc_deviation.csv", # square matrix CSV, no header
nt_contrib_csv="path/to/mito_contrib.csv", # contains 'Region_Pair'
output_weights_csv="path/to/mito_weights.csv",
)
print(best_n)
print(df.head())
Data Format
- FC deviation/weights CSV: square numeric matrix without header; only upper-triangle non-zero entries are used.
- Gene contribution CSV: must include a
Region_Paircolumn formatted asi-j, where i < j. - Cell-type markers CSV: columns
geneandclass(gene symbols are uppercased internally). - Layer markers Excel: sheet contains columns named
t_stat_LayerX(e.g., Layer1..Layer6) and agenecolumn.
Development & Testing
- Build and install locally:
python -m pip install -U build
python -m build
pip install dist/BrainNetAnno-<version>-py3-none-any.whl
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
brainnetanno-0.1.0.tar.gz
(22.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file brainnetanno-0.1.0.tar.gz.
File metadata
- Download URL: brainnetanno-0.1.0.tar.gz
- Upload date:
- Size: 22.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc5f8d3312628dbcda14edf98159dc11e049c5569a7cfd828ffb85988c5e20ec
|
|
| MD5 |
a6cef203c87c5820a4849971f061d036
|
|
| BLAKE2b-256 |
9a97c1375819c00bab209b67e7ccb8cd6b35c061fc6ee883314182a27ae655ed
|
File details
Details for the file brainnetanno-0.1.0-py3-none-any.whl.
File metadata
- Download URL: brainnetanno-0.1.0-py3-none-any.whl
- Upload date:
- Size: 33.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09988cab3e0d415bf267720ac2a878c7477609d29ee142386d01f3c6ac09686d
|
|
| MD5 |
60df1b45754cffe2292fee37300dd1e8
|
|
| BLAKE2b-256 |
e1bf3c067055103c82ca56c92860af499664d4457ea38d8c0edb2928e4689fec
|