P2CS-Web
Two-component systems, rebuilt for exploration
Documentation / API
Public, versioned access to the P2CS-Web catalogue.
The API exposes the same release-defined data used by the website. It is public, read-oriented, requires no account, and is intended for reproducible retrieval rather than bulk database mirroring.
Start here
Interactive schema documentation and a machine-readable contract are provided with the API.
Interactive API (Swagger)OpenAPI JSONGeneral help
Use the canonical /api/v1 address in scripts. The interactive documentation above is delivered through the website proxy so it remains available even when the deployment does not expose /api/v1directly at the reverse proxy level.
export P2CS_API_BASE_URL="https://www.p2cs.org/api/v1"
curl -fsS "$P2CS_API_BASE_URL/health"Conventions
The same conventions apply to all public routes.
- All identifiers in path segments must be URL encoded. For example, a gene identifier containing
#uses%23. - Paged list responses contain
itemsandpagination. Gene lists returnpage,page_size,total: null, andhas_nextto avoid an expensive global count; other lists provide their total when available. - Use conservative page sizes and iterate over pages. Route-specific limits are declared in Swagger and OpenAPI.
- Optional GFF, FASTA, PFAM, HK/TM, or structure-derived outputs return an availability message or
404when the source is not present for a record. - Validation errors use
422; missing records use404; invalid searchable input may return400.
Example: genome search and export
Use the same filters for an interactive list and for an export of all matching rows.
curl -sG "$P2CS_API_BASE_URL/genomes" \
--data-urlencode "query=K-12" \
--data-urlencode "assembly_level=Complete Genome" \
--data-urlencode "page=1" \
--data-urlencode "page_size=25"
curl -L -G "$P2CS_API_BASE_URL/genomes/export" \
--data-urlencode "query=K-12" \
--data-urlencode "assembly_level=Complete Genome" \
--data-urlencode "format=xlsx" \
-o p2cs_genomes.xlsxExample: a gene and its linked cluster
Use URL encoding for the complete gene identifier and preserve it in downstream requests.
GENE_ID='GCF_000006925%23SF2603'
CLUSTER_ID='RROC_2433902'
curl -sS "$P2CS_API_BASE_URL/genes/$GENE_ID"
curl -sS "$P2CS_API_BASE_URL/genes/$GENE_ID/domain-bioview.svg" -o domains.svg
curl -sG "$P2CS_API_BASE_URL/genes/$GENE_ID/clusters/$CLUSTER_ID/members" \
--data-urlencode "page=1" \
--data-urlencode "page_size=50"
INCOMPLETE_HK_ID='GCF_040545925%23ABID56_RS04515'
curl -sS "$P2CS_API_BASE_URL/genes/$INCOMPLETE_HK_ID"Example: sequence search and exploratory MSA
POST bodies are JSON. The MSA tree is a distance-based exploratory display, not a phylogenetic reconstruction.
curl -sS -X POST "$P2CS_API_BASE_URL/protein-search" \
-H "content-type: application/json" \
--data '{"sequence": ">query\nMKKIAVIGCGNIGLELAKELGADVVVV", "engine": "mmseq2", "target": "RR", "max_results": 25}'
curl -sS -X POST "$P2CS_API_BASE_URL/protein-search/msa" \
-H "content-type: application/json" \
--data '{"sequence": ">query\nMKKIAVIGCGNIGLELAKELGADVVVV", "target": "RR", "min_identity_percent": 30, "max_results": 100, "max_sequences": 25}'Example: incomplete HK catalogue
The IHK catalogue includes all incomplete HK proteins and exposes the derived IHKOC and HMM evidence layers.
curl -sS "$P2CS_API_BASE_URL/ihk/stats"
curl -sG "$P2CS_API_BASE_URL/ihk" \
--data-urlencode "gene_type=Classic" \
--data-urlencode "evidence=significant" \
--data-urlencode "page=1" \
--data-urlencode "page_size=25"
curl -sS "$P2CS_API_BASE_URL/ihk/IHK_00003806"Service and home
Lightweight service checks and release-level catalogue summaries.
- GET
/healthService health check.
- GET
/home/countsCurrent genome, gene, HK, RR, and cluster counts.
- GET
/home/summaryHome-page counts and family distributions.
Genomes
Paged genome discovery, taxonomy selectors, export, and genome-level summaries.
- GET
/genomesSearch and filter genomes; versioned GCF/GCA accessions are matched to their base accession.
- GET
/genomes/taxonomy-treeTaxonomy selector for the active genome filters.
- GET
/genomes/exportComplete filtered genome result as TSV or XLSX.
- GET
/genomes/metagenomesPaged metagenome catalogue.
- GET
/genomes/{genome_id}Genome metadata and optional quality fields.
- GET
/genomes/{genome_id}/gene-statsTCS census by class and type.
- GET
/genomes/{genome_id}/family-distributionsHK and RR family distributions.
- GET
/genomes/{genome_id}/tcs-organizationOrphan and grouped TCS organizations.
- GET
/genomes/{genome_id}/circular-mapGenome map payload when local GFF/FNA sources are available.
- GET
/genomes/{genome_id}/visual-assetsGenerate or reuse static genome visualization assets.
- GET
/genomes/{genome_id}/visual-assets/{asset_name}Serve one cached SVG or PNG genome visualization.
Genes
Paged gene searches, detail records, sequence data, contexts, and optional structural annotations.
- GET
/genesSearch genes by identifier, class, type, family, genome, TCS organization, or HK/RR domains within an organization.
- GET
/genes/family-distributionsGlobal family distributions.
- GET
/genes/{gene_id}Full gene record, HK/TM protein features when available, clusters, context, domains, external references, and supplementary HisKA annotation for incomplete HKs.
- GET
/genes/{gene_id}/protein-sequenceProtein sequence and FASTA when a local source is available.
- GET
/genes/{gene_id}/domain-bioview.svgDomain annotation as SVG.
- GET
/genes/{gene_id}/clusters/{cluster_id}/membersPaged members of a linked cluster.
- GET
/genes/{gene_id}/clusters/{cluster_id}/taxonomy-sankeyTaxonomic Sankey payload for a linked cluster.
- GET
/genes/{gene_id}/structure-predictionMassiveFold or UniProt structure availability.
- GET
/genes/{gene_id}/structure-prediction/fileStructure file selected with path and optional download parameters.
- GET
/genes/{gene_id}/structure-domain-map.svgStructure-domain map using the selected renderer.
- GET
/genes/{gene_id}/structure-domain-map/fileGenerated SVG or CSV artifact selected with artifact.
Clusters
HKOC and RROC cluster search, PFAM summaries, MSA, and optional structure outputs.
- GET
/clustersSearch HKOC, RROC, or IHKOC clusters by identifier, linked gene, representative, kind, run, or identity; HK rows include representative TM features when available.
- GET
/clusters/architecture-statsHK and RR PFAM architecture statistics.
- GET
/clusters/{cluster_id}/pfam-architecturePositioned PFAM or IHK HMM architecture for a representative.
- POST
/clusters/{cluster_id}/msaMMseqs2/MAFFT representative-cluster MSA workflow.
- POST
/clusters/{cluster_id}/msa/logoSequence logo for supplied aligned FASTA.
- GET
/clusters/{cluster_id}/structure-predictionMassiveFold structure availability and files.
- GET
/clusters/{cluster_id}/structure-prediction/fileStructure or workspace file selected with path.
- GET
/clusters/{cluster_id}/structure-domain-map.svgGenerated two-dimensional structure-domain map.
- GET
/clusters/{cluster_id}/structure-domain-map/fileGenerated SVG or CSV artifact selected with artifact.
External mappings
Resolve P2CS proteins from RefSeq, UniProt, GI, Gene Ontology, and related annex mappings.
- GET
/annexes/external-mappingsPaged external mappings; scope is p2cs or all.
Protein sequence workflows
Search a submitted protein against the local HK, RR, or incomplete-HK database, optionally followed by MSA.
- POST
/protein-searchMMseqs2, BLASTP, or DIAMOND representative search.
- POST
/protein-search/msaSearch, align selected representatives, and generate an exploratory distance tree.
Incomplete HK catalogue
Search all incomplete histidine kinases and inspect IHKOC cluster and HMM evidence.
- GET
/ihk/statsCounts for incomplete HKs, IHKOC clusters, HMM evidence, and gene types.
- GET
/ihkPaged search by IHK identifier, gene identifier, type, IHKOC cluster, profile, or evidence.
- GET
/ihk/{identifier}IHK annotation, sequence, cluster membership, HMM bounds, and representative evidence.
Support and citation
Please provide enough context for a result or API issue to be reproduced.
For questions, data issues, or integration requests, contact P2CS Contact at philippe.ortet@cea.fr. Include the full request URL, date, identifier, and returned message. Cite the P2CS-Web resource and record the access date for analyses that use the live catalogue.