Rat Genetics Calculator

Rat Genetics Calculator body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; line-height: 1.6; color: #333; max-width: 800px; margin: 0 auto; padding: 20px; background-color: #f9f9f9; } .calculator-container { background: #ffffff; padding: 30px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); margin-bottom: 40px; } h2 { color: #2c3e50; border-bottom: 2px solid #eee; padding-bottom: 10px; margin-top: 0; } .grid-row { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 20px; } .col-half { flex: 1; min-width: 250px; } label { display: block; margin-bottom: 5px; font-weight: 600; color: #555; font-size: 0.9rem; } select { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 1rem; background-color: #fff; } .section-title { background-color: #f0f4f8; padding: 8px 12px; border-radius: 6px; margin-bottom: 15px; color: #2c3e50; font-weight: bold; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.5px; } button { background-color: #3498db; color: white; border: none; padding: 12px 24px; font-size: 1.1rem; border-radius: 6px; cursor: pointer; width: 100%; transition: background-color 0.2s; font-weight: bold; } button:hover { background-color: #2980b9; } #result { margin-top: 25px; padding: 20px; background-color: #eef7fb; border-radius: 8px; border-left: 5px solid #3498db; display: none; } .result-table { width: 100%; border-collapse: collapse; margin-top: 15px; } .result-table th, .result-table td { text-align: left; padding: 10px; border-bottom: 1px solid #ddd; } .result-table th { background-color: #dfe6e9; color: #2d3436; } .prob-high { color: #27ae60; font-weight: bold; } .article-content { background: #fff; padding: 30px; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); } .article-content h3 { color: #2c3e50; margin-top: 25px; } .article-content ul { padding-left: 20px; } .article-content li { margin-bottom: 8px; } .genotype-display { font-family: monospace; background: #eee; padding: 2px 4px; border-radius: 3px; }

Rat Genetics Calculator

Select the known genotypes of the Sire (Dad) and Dam (Mom) to predict the probabilities of offspring varieties.

Agouti Locus (Base Color)
AA – Homozygous Agouti Aa – Agouti (carries black) aa – Black (Non-Agouti)
AA – Homozygous Agouti Aa – Agouti (carries black) aa – Black (Non-Agouti)
Blue Locus (American Blue)
GG – Non-Blue (Does not carry) Gg – Non-Blue (Carries blue) gg – Blue
GG – Non-Blue (Does not carry) Gg – Non-Blue (Carries blue) gg – Blue
Pink-Eye Dilution Locus
PP – Standard Eye (Does not carry) Pp – Standard Eye (Carries pink) pp – Pink Eye Dilution
PP – Standard Eye (Does not carry) Pp – Standard Eye (Carries pink) pp – Pink Eye Dilution

Understanding Rat Coat Genetics

Predicting the outcome of a breeding pair is essential for responsible rat breeding. By understanding Mendelian genetics, breeders can determine the potential coat colors and types of a litter. This calculator focuses on three primary loci that determine the most common varieties found in fancy rats.

The Loci Explained

1. The Agouti Locus (A)

This locus determines the pattern of the hair shaft. It is the "base" layer of the rat's color.

  • A- (Agouti): The dominant trait. Each hair has bands of color (usually slate grey at the base, yellow/orange in the middle, and black tips). This is the wild type color.
  • aa (Black): The recessive trait. The hair is a solid color (monochromatic) from root to tip. A rat must have two copies of the 'a' gene to appear Black.

2. The Blue Locus (G)

Often referred to as "American Blue" or "Slate Blue", this is a simple recessive dilution gene. Note: Genetics notation varies, but 'g' is commonly used for American Blue.

  • G- (Non-Blue): The rat retains its full pigment density.
  • gg (Blue): The black pigment is diluted to a slate grey/blue color. A Black rat (aa) with blue dilution (gg) becomes an American Blue. An Agouti rat (A-) with blue dilution (gg) becomes a Blue Agouti.

3. The Pink-Eyed Dilution Locus (P)

This gene dilutes pigment and removes black pigment from the eyes, turning them pink/red.

  • P- (Standard): Normal eye color (black or dark ruby) and coat density.
  • pp (Pink Eye): Dilutes the coat significantly.
    • Black (aa) + Pink Eye (pp) = Beige.
    • Agouti (A-) + Pink Eye (pp) = Amber (or Fawn).

Combined Phenotypes

When these genes interact, they create composite colors. For example, a rat that is homozygous recessive for all three traits (aa gg pp) would technically be a "Silver Beige" or "Platinum," combining the Blue and Pink-Eye dilutions on a Black base.

function calculateGenetics() { // 1. Get Inputs var sireA = document.getElementById('sireA').value; var damA = document.getElementById('damA').value; var sireG = document.getElementById('sireG').value; var damG = document.getElementById('damG').value; var sireP = document.getElementById('sireP').value; var damP = document.getElementById('damP').value; // 2. Helper function to calculate Punnett Square logic for a single locus // Returns object with probability of Dominant Phenotype (A-) and Recessive Phenotype (aa) // We only care about Phenotype for the final list, but we need genotype logic internally function getLocusProbabilities(g1, g2) { // g1 and g2 are strings like "Aa", "aa", "AA" // Break down alleles var alleles1 = g1.split("); var alleles2 = g2.split("); var outcomes = []; for (var i = 0; i < alleles1.length; i++) { for (var j = 0; j < alleles2.length; j++) { // Sort so Uppercase comes first (Aa not aA) var allele = (alleles1[i] < alleles2[j]) ? alleles1[i] + alleles2[j] : alleles2[j] + alleles1[i]; outcomes.push(allele); } } // Total outcomes is always 4 var counts = {}; for (var k = 0; k 0) { phenotypes.push({ name: name, probability: probability * 100 }); } } // 1. Agouti (A- G- P-) addPhenotype("Agouti (Standard)", probA.dom, probG.dom, probP.dom); // 2. Black (aa G- P-) addPhenotype("Black", probA.rec, probG.dom, probP.dom); // 3. Blue Agouti (A- gg P-) addPhenotype("Blue Agouti", probA.dom, probG.rec, probP.dom); // 4. American Blue (aa gg P-) addPhenotype("American Blue", probA.rec, probG.rec, probP.dom); // 5. Amber/Fawn (A- G- pp) addPhenotype("Amber / Fawn", probA.dom, probG.dom, probP.rec); // 6. Beige (aa G- pp) addPhenotype("Beige", probA.rec, probG.dom, probP.rec); // 7. Silver Fawn (A- gg pp) addPhenotype("Silver Fawn (Blue + Pink Eye Agouti)", probA.dom, probG.rec, probP.rec); // 8. Silver Beige/Platinum (aa gg pp) addPhenotype("Silver Beige / Platinum", probA.rec, probG.rec, probP.rec); // 5. Sort by probability descending phenotypes.sort(function(a, b) { return b.probability – a.probability; }); // 6. Generate Output HTML var resultDiv = document.getElementById('result'); var html = "

Predicted Offspring Phenotypes

"; if (phenotypes.length === 0) { html += "Error in calculation."; } else { html += ""; html += ""; html += ""; for (var i = 0; i = 50) ? "prob-high" : ""; html += ""; html += ""; html += ""; html += ""; } html += "
Variety / PhenotypeProbability
" + phenotypes[i].name + "" + phenotypes[i].probability.toFixed(1) + "%
"; } resultDiv.innerHTML = html; resultDiv.style.display = "block"; }

Leave a Comment