Skip to main content

Python client for Malva Index

Project description

Malva Client

PyPI Documentation GitHub

Python client for the Malva genomic search platform. Search genes, sequences, and natural language queries across >7,000 single-cell and spatial transcriptomics samples.

For full documentation, visit malva-client.readthedocs.io.

Installation

pip install malva-client

For single-cell analysis workflows:

pip install malva-client scanpy

Authentication

Generate an API token at malva.bio (login with ORCID, then go to Profile > Generate API Token), then configure the client:

malva_client config --server https://malva.mdc-berlin.de --token YOUR_API_TOKEN

Quick Start (CLI)

malva_client search "CD3D" --output results.csv
malva_client search "ATCGATCGATCGATCGATCGATCG" --output sequence_results.json --format json
malva_client search "CD4 T cells in brain tissue" --output nl_results.csv --format csv

Quick Start (Python)

from malva_client import MalvaClient

client = MalvaClient()

# Search for a gene and inspect aggregate expression rows
results = client.search("CD3D")
print(results.df.head())

# Search a DNA sequence of at least 24 nt
sequence_results = client.search_sequences("ATCGATCGATCGATCGATCGATCG")
print(sequence_results.df.head())

Per-cell matrices

# First run a normal expression search
result = client.search("SPP1")

# Retrieve positive cells from that search job
cells = client.retrieve_cells(result, include_sample_metadata=False)
sample_id = int(cells.cells.iloc[0]["sample_id"])

# Inspect cells from one real encoded sample ID
sample_cells = client.retrieve_cells(result, sample_ids=[sample_id], include_sample_metadata=True)
cell_ids = sample_cells.get_cell_ids()
cell_df = sample_cells.to_dataframe(include_sample_metadata=True)
print(cell_ids.head())
print(cell_df.head())

# Fetch all cells for that sample once from metadata for denominator analyses
all_cells = client.get_cells_by_metadata(sample_ids=[sample_id])
print(all_cells.head())

# Full-database retrieval is also available; it queues a server-side export.
# all_cells = client.get_cells_by_metadata(include_all_database_cells=True)

Working with Results

# Enrich results with metadata
results.enrich_with_metadata()

# Filter and aggregate
filtered = results.filter_by(disease='normal', organ='brain')
by_cell_type = results.aggregate_by('cell_type', agg_func='mean')
print(filtered.df.head())
print(by_cell_type.head())

See the tutorials for coverage analysis, dataset discovery, cell-level searches, and more.

Indexing Your Own Data

For local indexing and quantification, see Malva Tools (malva CLI).

Citation

If you use Malva in your research, please cite:

[TBA]

License

The Clear BSD License - Copyright (c) 2025-2026 Malva

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

malva_client-0.3.4.tar.gz (76.9 kB view details)

Uploaded Source

Built Distribution

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

malva_client-0.3.4-py3-none-any.whl (64.1 kB view details)

Uploaded Python 3

File details

Details for the file malva_client-0.3.4.tar.gz.

File metadata

  • Download URL: malva_client-0.3.4.tar.gz
  • Upload date:
  • Size: 76.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for malva_client-0.3.4.tar.gz
Algorithm Hash digest
SHA256 0db413d743433decc30b542977ae40943b60c0c99293a3bde8bf28177ff7b874
MD5 0cc43215248af0251b9598a9ea5817d1
BLAKE2b-256 47ba630db3681e93f5d9c43a96bd39c5b449308f65d4b246deb2093d902a5a4b

See more details on using hashes here.

File details

Details for the file malva_client-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: malva_client-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 64.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for malva_client-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2082d9512a36c268623103a8ea0a8f6c4dc4a3a9db66583529a8734dfba07b63
MD5 a7785c71a1d0015915ee3f8cf4e51ed4
BLAKE2b-256 7679965c2197cb47a8ded06ff8a169f37b6939ffcef082001ca8e5983e9332bc

See more details on using hashes here.

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