omics.co.in logo omics.co.in

Day 10: Conserved Protein Domain Architecture: CDD, Pfam & InterProScan

Tested Stacks: GATK 4.6.1 Samtools 1.21 Nextflow 24.10 Seurat v5.1 Python 3.12
Prerequisites: Basic Linux CLI & Sequencing Formats
📚 Chapter 10 of 15 0% Course Completed

1. The Modular Architecture of Proteins

In structural and evolutionary biology, a protein domain is an autonomous, conserved structural and functional unit that folds independently of the rest of the polypeptide chain, exhibits an independent evolutionary trajectory, and frequently mediates a distinct biochemical function (e.g. ATP binding, phosphotyrosine recognition, DNA binding, or transmembrane anchoring).

Through evolutionary processes such as exon shuffling, gene duplication, and retrotransposition, Nature combines elementary domains into diverse multidomain proteins. Consequently, classifying a protein by its domain architecture reveals its molecular function far more reliably than raw sequence identity.

Domain DatabaseCurating InstitutionUnderlying Computational ModelDatabase Strengths
NCBI CDD (Conserved Domain Database)NCBI / NLMPosition-Specific Scoring Matrices (PSSMs) calculated via RPS-BLAST (Reverse Position-Specific BLAST).Combines models from Pfam, SMART, COG, PRK, and TIGRFAMs with NCBI 3D structure-based curated domain boundaries.
PfamEMBL-EBIProfile Hidden Markov Models (Profile HMMs) generated via HMMER3 from curated seed alignments.Gold standard for hierarchical protein family and domain classifications (Pfam-A curated, Pfam-B automated).
SMARTEMBLProfile HMMs specialized in signaling, extracellular, and chromatin regulation domains.Highly accurate boundary determination for signaling domains (SH2, SH3, PH, Kinases).
InterProEMBL-EBI ConsortiumIntegrative meta-database combining 13 distinct resources (Pfam, CATH-Gene3D, SUPERFAMILY, PROSITE, PRINTS).Unified accessioning (IPR...) that resolves synonymies and links GO terms and biological pathways.

2. Profile Hidden Markov Models (HMMs) in Domain Detection

Traditional consensus sequences fail to capture positional variability across diverse domain homologues. Profile HMMs (developed by Sean Eddy in HMMER) model an alignment column-by-column as a statistical Markov chain comprising three fundamental states:

  • Match States ($M_k$): Probability distribution over the 20 amino acids at conserved consensus positions.
  • Insert States ($I_k$): Probability of inserting one or more non-conserved amino acids between columns.
  • Delete States ($D_k$): Probability of omitting a consensus residue (deletions).
$$\log \left( \frac{P(\text{Sequence} \mid \text{HMM})}{P(\text{Sequence} \mid \text{Null Model})} \right) \implies \text{Bit Score}$$

3. Production Python Script: Programmatic InterProScan REST API Query

#!/usr/bin/env python3
"""
Day 10 Practical: Automated Domain Annotation via InterProScan API
Submits a protein sequence and extracts Pfam, SMART, and CDD domain matches.
"""

import urllib.request
import urllib.parse
import json
import time
import sys

INTERPRO_API = "https://www.ebi.ac.uk/Tools/services/rest/iprscan5"

def submit_interpro_job(sequence_fasta: str, email: str):
    """Submit FASTA sequence to EBI InterProScan REST service."""
    params = urllib.parse.urlencode({
        "email": email,
        "title": "OmicsDomainScan",
        "goterms": "true",
        "pathways": "true",
        "sequence": sequence_fasta
    }).encode("utf-8")
    
    req = urllib.request.Request(f"{INTERPRO_API}/run", data=params)
    with urllib.request.urlopen(req) as resp:
        job_id = resp.read().decode("utf-8").strip()
    print(f"InterProScan Job Submitted. Job ID: {job_id}")
    return job_id

def poll_and_fetch_results(job_id: str):
    """Poll job status until FINISHED, then download JSON output."""
    status_url = f"{INTERPRO_API}/status/{job_id}"
    while True:
        with urllib.request.urlopen(status_url) as resp:
            status = resp.read().decode("utf-8").strip()
        print(f"Job Status: {status}...")
        if status == "FINISHED":
            break
        elif status in ["ERROR", "FAILURE", "NOT_FOUND"]:
            print("Job failed on EBI server.", file=sys.stderr)
            return None
        time.sleep(5)
        
    result_url = f"{INTERPRO_API}/result/{job_id}/json"
    with urllib.request.urlopen(result_url) as resp:
        return json.loads(resp.read().decode("utf-8"))

if __name__ == "__main__":
    # Human p53 DNA-binding core domain sequence
    p53_fragment = (
        ">P53_CORE_DOMAIN\n"
        "MPEAAPPVAPAPAAPTPAAPAPAPSWPLSSSVPSQKTYQGSYGFRLGFLHSGTAKSVTCTYSPALNKMFCQLAKTCP"
        "VQLWVDSTPPPGTRVRAMAIYKQSQHMTEVVRRCPHHERCSDSDGLAPPQHLIRVEGNLRVEYLDDRNTFRHSVVVP"
        "YEPPEVGSDCTTIHYNYMCNSSCMGGMNRRPILTIITLEDSSGNLLGRNSFEVRVCACPGRDRRTEEENLRKKGEPH"
        "HELP"
    )
    print("Submitting protein sequence to InterProScan API...")
    # Example simulated output inspection
    print("Identified Domain: P53 DNA-binding domain (Pfam: PF00870, InterPro: IPR011615)")
    print("Coordinates: Residues 102 - 292 | E-value: 2.4e-68")
⚠️

Common Pitfalls & Troubleshooting Checklist

  • Java Heap Exhaustion (GATK / Picard): If processes terminate with java.lang.OutOfMemoryError, set your environment variable explicitly: export _JAVA_OPTIONS="-Xmx16g -Djava.io.tmpdir=/tmp".
  • Index Timestamp Mismatch: If tools complain that a BAM index is missing or out of date, regenerate with samtools index -@ 4 sample.bam.
  • Conda Channel Conflicts: Avoid ABI incompatibilities between bioconda and conda-forge by setting strict priority: conda config --set channel_priority strict.
  • Chromosome Naming Contamination: Always verify whether reference FASTA headers use chr1 or 1; divergent naming causes silent alignment drops.
Was this guide helpful to your research?
Help us maintain 100% accurate, peer-reviewed bioinformatics standards.
📝 Propose Edit on GitHub ↗