Skip to main content

Scanpy-like pipeline for bulk RNA-seq in Python

Project description

BULLKpy 🧬

Captura de pantalla 2026-01-03 a las 19 13 16

BULLKpy is a Python pipeline for bulk RNA-seq analysis, inspired by Scanpy but adapted for bulk transcriptomics. It integrates QC, normalization, clustering, differential expression, gene set enrichment analysis (GSEA), and rich visualization utilities.

Developed and used for TCGA and large-scale cancer transcriptomics analyses.


📄 Documentation

BULLKpy documentation in Read The Docs:

https://bullkpy.readthedocs.io/en/latest/


📦 Project structure

bullkpy-skeleton/
├── src/                # BULLKpy Python package   └── bullkpy/
│       ├── pp/         # preprocessing       ├── tl/         # tools (DE, clustering, GSEA, associations)       ├── pl/         # plotting       ├── io.py
│       └── settings.py
│
├── notebooks/          # analysis notebooks (examples, use cases)
├── data/               # large input datasets (NOT tracked by git)
├── docs/		# Read the Docs at `https://bullkpy.readthedocs.io/en/latest/` 
├── results/            # analysis outputs (NOT tracked by git)
│
├── pyproject.toml      # package configuration
├── README.md
├── LICENSE
└── .gitignore

🚀 Installation

Clone the repository:

git clone https://github.com/malumbres/BULLKpy.git
cd BULLKpy

Install in editable mode:

pip install -e .

🧪 Typical workflow

import bullkpy as bk
import pandas
import seaborn as sns

# Load data
adata = bk.read_counts("counts.tsv")

# QC
bk.pp.qc_metrics(adata)
bk.pl.qc_metrics(adata)
bk.pp.filter_genes(adata)
bk.pp.filter_samples(adata)

# PCA + UMAP
bk.pp.highly_variable_genes(adata)
bk.tl.pca(adata)
bk.pl.pca_scatter(adata)
bk.tl.pca_variance_ratio(adata)
bk.tl.pca_loadings(adata)
bk.pl.pca_loadings_bar(adata)
bk.pl.pca_loadings_heatmap(adata)
bk.tl.neighbors(adata)
bk.tl.cluster(adata, method="leiden")
bk.tl.umap(adata)
bk.tl.umap_graph(adata)
bk.pl.umap(adata)

# Clustering
bk.tl.leiden_resolution_scan(adata)
bk.pl.ari_resolution_heatmap(adata)
bk.tl.cluster(adata)
bk.tl.cluster_metrics(adata)

# Genes and gene signatures
bk.tl.score_genes(adata, signature)
bk.tl.score_genes_cell_cycle(adata)

# Correlations and associations
bk.pl.corr_heatmap(adata)
bk.tl.gene_gene_correlations(adata)
bk.tl.gene_gene_correlations(adata)
bk.tl.top_gene_obs_correlations(adata)
bk.tl.obs_obs_corr_matrix(adata)
bk.pl.corrplot_obs(adata)
bk.tl.plot_corr_scatter(adata)
bk.tl.gene_categorical_association(adata)
bk.pl.association_heatmap(dfg)
bk.tl.obs_categorical_association(adata)
bk.pl.boxplot_with_stats(adata)
bk.pl.categorical_confusion(adata)
bk.pl.gene_association(adata)
bk.pl.gene_association_volcano(adata)
bk.tl.pairwise_posthoc(y, method="mwu")
bk.tl.cat_cat_association(adata)
bk.pl.dotplot_association(df_all)
bk.pl.heatmap_association(df_all)
bk.tl.rank_genes_categorical(adata)
bk.pl.rankplot_association(dfo)
bk.pl.volcano_categorical(res)
bk.tl.posthoc_per_gene(adata)

# Marker genes and Differential expression
res = bk.tl.de(adata)
bk.tl.de_glm(data)
bk.pl.volcano(res)
bk.pl.rankplot(res)
bk.pl.ma(res)

# GSEA, genesets and pathway analysis
bk.tl.gsea_preranked(adata)
bk.pl.gsea_bubbleplot(df_gsea)
bk.pl.gsea_leading_edge_heatmap(adata)
bk.pl.leading_edge_jaccard_heatmap(pre_res)
bk.pl.leading_edge_overlap_matrix(pre_res)
bk.tl.list_enrichr_libraries()

# Plots
bk.pl.violin(adata)
bk.pl.dotplot(adata)
bk.pl.heatmap_de(adata)
bk.pl.sample_distances(adata)
bk.pl.sample_correlation_clustergram(adata)
bk.pl.gene_plot(adata)
bk.pl.oncoprint(adata)

📊 Features

•	Bulk RNA-seq, small and large projects. QC & filtering
•	PCA, UMAP, Leiden, k-means clustering
•	Gene scores and signatures
•	Gene–obs and obs–obs associations and correlations
•	Differential expression from counts or log data
•	GSEA preranked pipeline (GSEApy)
•	Leading-edge GSEA analysis
•	Oncoprint-style mutation plots
•	Scanpy-like API (pp, tl, pl)

⚠️ Notes

•	data/ and results/ are not versioned
•	Designed for small or large datasets (TCGA-scale)
•	Requires Python ≥ 3.9

📄 License

MIT License

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

bullkpy-0.0.1.tar.gz (110.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bullkpy-0.0.1-py3-none-any.whl (145.5 kB view details)

Uploaded Python 3

File details

Details for the file bullkpy-0.0.1.tar.gz.

File metadata

  • Download URL: bullkpy-0.0.1.tar.gz
  • Upload date:
  • Size: 110.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for bullkpy-0.0.1.tar.gz
Algorithm Hash digest
SHA256 582fada0fb23d56841e82167cca9ee0058dbf5c608039d80eb55a0c0ac998ad4
MD5 b3a3c2373e2d1405dcc0f3cc84712104
BLAKE2b-256 3394686b172179e15dd7806325da7df714d6fd6d097c984baefb299bbe6760d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for bullkpy-0.0.1.tar.gz:

Publisher: release.yml on malumbres/BULLKpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bullkpy-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: bullkpy-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 145.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for bullkpy-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9f648d6070e92b11d20a87f1c4c6bb20f96be72f78b867344cee12237d24b6f6
MD5 5641b39cdf950d42e6071b899307a103
BLAKE2b-256 108db84ac6975e1df9b09600d737d71ae491daff11f73e787e8fab8e0b5f9d4e

See more details on using hashes here.

Provenance

The following attestation bundles were made for bullkpy-0.0.1-py3-none-any.whl:

Publisher: release.yml on malumbres/BULLKpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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