Protein Plots
Visualize transcript structures with protein domain overlays.
API reference
ProteinPlots
def ProteinPlots(
transcript_data:TranscriptData, protein_data:ProteinData, intron_scale:float=0.15, color_offset:int=0,
kwargs:VAR_KEYWORD
):
Extended TranscriptPlots with protein domain overlay capabilities.
Inherits all transcript plotting functionality from TranscriptPlots and adds methods for overlaying protein domains on transcript structures.
ProteinPlots.draw_transcripts_with_protein_domains
def draw_transcripts_with_protein_domains(
transcript_ids, # Transcript ID(s) to visualize
provider:str='ensembl', # Domain provider ("ensembl" or "interpro")
Note: InterPro only annotates canonical transcripts
max_domains:int=12, # Maximum domains to show per transcript
id_prefixes:Optional[List[str]]=None, # Filter domains by ID prefix (e.g., ["PF"] for Pfam)
sources:Optional[List[str]]=None, # Filter domains by source database
fig_width:float=18.0, # Figure width in inches
palette_name:str='Dark2', # Seaborn color palette name for protein domains
custom_domains:Optional[Dict[str, List[Dict]]]=None, # Custom domain annotations. Dict mapping transcript_id to list of domain dicts.
Each domain dict should have keys: 'name', 'label', 'start', 'end' (AA coords)
If provided, overrides API fetching for those transcripts.
show_aa_ticks:bool=True, # Show amino acid position ticks on domain track
): # The generated figure
Draw isoform exon structures + clean domain tracks.
For InterPro provider: domains are only shown on the first (canonical) transcript, since InterPro annotations are only available for canonical isoforms. Other transcripts are still shown for structural comparison.
Examples
Demonstrate protein domain visualization on transcripts.