Forward Primer Scatter Plot
The main scatter plot displays all forward primer candidates across genomic positions.Plot Characteristics
Function:posDegScatter() (phl.py:196-231)
- X-axis: Primer positions in the genome
- Y-axis: Number of degeneracies (log scale)
- Markers: Green circles (
rgb(34, 156, 0)) - Marker size: 10 pixels
- Opacity: 0.5 for better visibility of overlapping points
Log Scale Y-Axis
The y-axis uses a logarithmic scale to display degeneracies ranging from very low to very high values effectively. The scale shows exponents in power format (e.g., 10¹, 10², 10³).
Interactive Features
- Click Mode:
event+select- responds to both click events and selection (phl.py:215) - Hover Text: Displays the forward primer sequence when hovering over a point (phl.py:200)
- Click Action: Clicking a point selects it as the forward primer and updates the zoom view
When you click a point in the scatter plot, the interface displays: “You choose primer on [position] with [degeneracies] degeneracies” (protege.py:650-662)
Reverse Primer Zoom Plot
After selecting a forward primer, the zoom plot shows reverse primer candidates in the surrounding region.Plot Characteristics
Function:zoomDegScatter() (phl.py:234-264)
- X-axis: Primer positions (zoomed region)
- Y-axis: Number of degeneracies (log scale)
- Markers: Red circles (
rgb(255, 17, 0)) - Marker size: 10 pixels
- Opacity: 0.5
- Text: Reverse primer sequences (phl.py:237)
Dynamic Updates
The zoom plot automatically updates when you select a forward primer (protege.py:664-691):Zoom Range Logic
The zoom view ensures primers are displayed within a reasonable range (protege.py:677-685):- If the zoom limit exceeds the lower bound, it starts from index 0
- If the zoom limit exceeds the upper bound, it extends to the maximum index
- This prevents errors when selecting primers near the start or end of the dataset
Melting Temperature Distribution
The temperature distribution plot visualizes the Tm ranges for selected primer pairs.Plot Generation
Function: Created using Plotly Figure Factorycreate_distplot() (protege.py:396-415, 748-800)
- Data: Two distributions - one for forward primer, one for reverse primer
- Labels: “Forward Primer” and “Reverse Primer”
- Curve Type: Normal distribution curves
- Show Rug: Disabled (no individual data points shown below curves)
- Bin Size: 2°C bins for histogram
Initial State
Before selecting primers, the plot displays placeholder data with zero values (protege.py:396-401):Updated State
After selecting both primers, the plot shows actual Tm distributions (protege.py:752-800):Tm Calculation Methods
Tm Calculation Methods
The distribution updates based on the selected Tm approximation method:
- Wallace Rule of Thumb (tApprox = 1):
TmWallace()method - GC Content Approx 2 (tApprox = 2):
TmAp2()method - GC Content Approx 3 (tApprox = 3):
TmAp3()method - Nearest Neighbor (tApprox = 4):
TmNN()method
Visual Styling
- Background: Semi-transparent white (
rgba(255,255,255,0.75)) (protege.py:410-411) - Height: 530 pixels (consistent with scatter plots)
- Overlapping Curves: Allows comparison of forward vs. reverse primer Tm ranges
Visual Feedback and Hover States
Click Data Display
The interface provides textual feedback for user interactions: Forward Primer Click (protege.py:650-662):Hover Information
When hovering over data points:- Forward scatter plot: Shows forward primer sequence (phl.py:200)
- Reverse zoom plot: Shows reverse primer sequence (phl.py:237)
- Position and degeneracy: Automatically displayed by Plotly
All plots use a semi-transparent background to create a cohesive visual design while maintaining readability.
Interactive Selection
Both scatter plots support click-based selection:- Single click selects a primer
- Selected primer information is displayed immediately
- Dependent plots update automatically via Dash callbacks
- No manual refresh required
'event+select' enables both event-driven callbacks and visual selection highlighting on the plots.