write a introduction of mendeline inheritance of 6 pages with flowchart class 12 isc
Mendelian inheritance class 12 ISC biology syllabus laws of inheritance
ls /home/daytona/workspace/ && ls /home/daytona/skills/docx/
mkdir -p /home/daytona/workspace/mendelian-inheritance
~/mendelian-inheritance/create_doc.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
HeadingLevel, AlignmentType, BorderStyle, WidthType, ShadingType,
VerticalAlign, PageBreak, UnderlineType, Header, Footer, PageNumber,
NumberFormat, TableBorders
} = require('docx');
const fs = require('fs');
// Helper: bold heading paragraph
function heading1(text) {
return new Paragraph({
heading: HeadingLevel.HEADING_1,
children: [new TextRun({ text, bold: true, size: 32, color: "1F3864" })],
spacing: { before: 300, after: 120 },
});
}
function heading2(text) {
return new Paragraph({
heading: HeadingLevel.HEADING_2,
children: [new TextRun({ text, bold: true, size: 26, color: "2E74B5" })],
spacing: { before: 240, after: 80 },
});
}
function heading3(text) {
return new Paragraph({
heading: HeadingLevel.HEADING_3,
children: [new TextRun({ text, bold: true, size: 24, color: "2E74B5" })],
spacing: { before: 200, after: 60 },
});
}
function para(text, opts = {}) {
return new Paragraph({
children: [new TextRun({ text, size: 24, ...opts })],
spacing: { before: 80, after: 80 },
alignment: AlignmentType.JUSTIFIED,
});
}
function boldPara(text) {
return new Paragraph({
children: [new TextRun({ text, size: 24, bold: true })],
spacing: { before: 80, after: 80 },
alignment: AlignmentType.JUSTIFIED,
});
}
function bullet(text, level = 0) {
return new Paragraph({
children: [new TextRun({ text, size: 24 })],
bullet: { level },
spacing: { before: 40, after: 40 },
alignment: AlignmentType.JUSTIFIED,
});
}
function pageBreak() {
return new Paragraph({ children: [new PageBreak()] });
}
function emptyLine() {
return new Paragraph({ children: [new TextRun({ text: "" })], spacing: { before: 60, after: 60 } });
}
// Colored box paragraph (simulated with shading)
function boxedPara(text, color = "EBF3FB") {
return new Paragraph({
children: [new TextRun({ text, size: 24 })],
spacing: { before: 120, after: 120 },
alignment: AlignmentType.JUSTIFIED,
shading: { type: ShadingType.SOLID, color },
indent: { left: 360, right: 360 },
border: {
top: { style: BorderStyle.SINGLE, size: 6, color: "2E74B5" },
bottom: { style: BorderStyle.SINGLE, size: 6, color: "2E74B5" },
left: { style: BorderStyle.SINGLE, size: 6, color: "2E74B5" },
right: { style: BorderStyle.SINGLE, size: 6, color: "2E74B5" },
}
});
}
// Table cell helper
function cell(text, opts = {}) {
return new TableCell({
children: [new Paragraph({
children: [new TextRun({ text, size: 22, bold: opts.bold || false })],
alignment: AlignmentType.CENTER,
spacing: { before: 60, after: 60 },
})],
verticalAlign: VerticalAlign.CENTER,
shading: opts.shading ? { type: ShadingType.SOLID, color: opts.shading } : undefined,
margins: { top: 80, bottom: 80, left: 120, right: 120 },
});
}
// ===== PUNNETT SQUARE TABLE for Monohybrid Cross (Tall x Dwarf) =====
function punnettMonohybrid() {
return new Table({
width: { size: 40, type: WidthType.PERCENTAGE },
alignment: AlignmentType.CENTER,
borders: {
top: { style: BorderStyle.SINGLE, size: 8, color: "2E74B5" },
bottom: { style: BorderStyle.SINGLE, size: 8, color: "2E74B5" },
left: { style: BorderStyle.SINGLE, size: 8, color: "2E74B5" },
right: { style: BorderStyle.SINGLE, size: 8, color: "2E74B5" },
insideHorizontal: { style: BorderStyle.SINGLE, size: 4, color: "9DC3E6" },
insideVertical: { style: BorderStyle.SINGLE, size: 4, color: "9DC3E6" },
},
rows: [
new TableRow({ children: [
cell("", { shading: "BDD7EE", bold: true }),
cell("T (tall)", { shading: "BDD7EE", bold: true }),
cell("t (dwarf)", { shading: "BDD7EE", bold: true }),
]}),
new TableRow({ children: [
cell("T (tall)", { shading: "BDD7EE", bold: true }),
cell("TT (Tall)", { shading: "FFFFFF" }),
cell("Tt (Tall)", { shading: "FFFFFF" }),
]}),
new TableRow({ children: [
cell("t (dwarf)", { shading: "BDD7EE", bold: true }),
cell("Tt (Tall)", { shading: "FFFFFF" }),
cell("tt (Dwarf)", { shading: "FFF2CC" }),
]}),
],
});
}
// Punnett for F2 of monohybrid (Tt x Tt)
function punnettF2() {
return new Table({
width: { size: 40, type: WidthType.PERCENTAGE },
alignment: AlignmentType.CENTER,
borders: {
top: { style: BorderStyle.SINGLE, size: 8, color: "2E74B5" },
bottom: { style: BorderStyle.SINGLE, size: 8, color: "2E74B5" },
left: { style: BorderStyle.SINGLE, size: 8, color: "2E74B5" },
right: { style: BorderStyle.SINGLE, size: 8, color: "2E74B5" },
insideHorizontal: { style: BorderStyle.SINGLE, size: 4, color: "9DC3E6" },
insideVertical: { style: BorderStyle.SINGLE, size: 4, color: "9DC3E6" },
},
rows: [
new TableRow({ children: [
cell("F1 x F1", { shading: "BDD7EE", bold: true }),
cell("T", { shading: "BDD7EE", bold: true }),
cell("t", { shading: "BDD7EE", bold: true }),
]}),
new TableRow({ children: [
cell("T", { shading: "BDD7EE", bold: true }),
cell("TT (Tall)", { shading: "E2EFDA" }),
cell("Tt (Tall)", { shading: "E2EFDA" }),
]}),
new TableRow({ children: [
cell("t", { shading: "BDD7EE", bold: true }),
cell("Tt (Tall)", { shading: "E2EFDA" }),
cell("tt (Dwarf)", { shading: "FFF2CC" }),
]}),
],
});
}
// Dihybrid cross RRYY x rryy (F1 = RrYy, F2 9:3:3:1)
function dihybridF1() {
return new Table({
width: { size: 40, type: WidthType.PERCENTAGE },
alignment: AlignmentType.CENTER,
borders: {
top: { style: BorderStyle.SINGLE, size: 8, color: "2E74B5" },
bottom: { style: BorderStyle.SINGLE, size: 8, color: "2E74B5" },
left: { style: BorderStyle.SINGLE, size: 8, color: "2E74B5" },
right: { style: BorderStyle.SINGLE, size: 8, color: "2E74B5" },
insideHorizontal: { style: BorderStyle.SINGLE, size: 4, color: "9DC3E6" },
insideVertical: { style: BorderStyle.SINGLE, size: 4, color: "9DC3E6" },
},
rows: [
new TableRow({ children: [
cell("Parents", { shading: "BDD7EE", bold: true }),
cell("RRYY (Round Yellow)", { shading: "BDD7EE", bold: true }),
cell("x", { shading: "FFFFFF", bold: true }),
cell("rryy (Wrinkled Green)", { shading: "BDD7EE", bold: true }),
]}),
new TableRow({ children: [
cell("Gametes", { shading: "BDD7EE", bold: true }),
cell("RY", { shading: "E2EFDA" }),
cell("", { shading: "FFFFFF" }),
cell("ry", { shading: "FFF2CC" }),
]}),
new TableRow({ children: [
cell("F1", { shading: "BDD7EE", bold: true }),
cell("RrYy (Round Yellow) - All F1 plants", { shading: "E2EFDA" }),
cell("", { shading: "FFFFFF" }),
cell("", { shading: "FFFFFF" }),
]}),
],
});
}
// ===== FLOWCHART simulated as bordered tables =====
function flowchartBox(text, shading = "BDD7EE", bold = false, width = 60) {
return new Table({
width: { size: width, type: WidthType.PERCENTAGE },
alignment: AlignmentType.CENTER,
rows: [
new TableRow({ children: [
new TableCell({
children: [new Paragraph({
children: [new TextRun({ text, size: 22, bold })],
alignment: AlignmentType.CENTER,
spacing: { before: 80, after: 80 },
})],
shading: { type: ShadingType.SOLID, color: shading },
margins: { top: 100, bottom: 100, left: 200, right: 200 },
borders: {
top: { style: BorderStyle.SINGLE, size: 8, color: "2E74B5" },
bottom: { style: BorderStyle.SINGLE, size: 8, color: "2E74B5" },
left: { style: BorderStyle.SINGLE, size: 8, color: "2E74B5" },
right: { style: BorderStyle.SINGLE, size: 8, color: "2E74B5" },
}
})
]})
]
});
}
function arrowPara() {
return new Paragraph({
children: [new TextRun({ text: "↓", size: 32, bold: true, color: "2E74B5" })],
alignment: AlignmentType.CENTER,
spacing: { before: 30, after: 30 },
});
}
function flowchartDiamond(text) {
return new Table({
width: { size: 60, type: WidthType.PERCENTAGE },
alignment: AlignmentType.CENTER,
rows: [
new TableRow({ children: [
new TableCell({
children: [new Paragraph({
children: [new TextRun({ text: "◆ " + text + " ◆", size: 22, bold: true, color: "1F3864" })],
alignment: AlignmentType.CENTER,
spacing: { before: 80, after: 80 },
})],
shading: { type: ShadingType.SOLID, color: "FFE699" },
margins: { top: 80, bottom: 80, left: 200, right: 200 },
borders: {
top: { style: BorderStyle.DOUBLE, size: 6, color: "C55A11" },
bottom: { style: BorderStyle.DOUBLE, size: 6, color: "C55A11" },
left: { style: BorderStyle.DOUBLE, size: 6, color: "C55A11" },
right: { style: BorderStyle.DOUBLE, size: 6, color: "C55A11" },
}
})
]})
]
});
}
// Two-column comparison table
function comparisonTable() {
function hdrCell(text) {
return new TableCell({
children: [new Paragraph({
children: [new TextRun({ text, bold: true, size: 22, color: "FFFFFF" })],
alignment: AlignmentType.CENTER,
})],
shading: { type: ShadingType.SOLID, color: "1F3864" },
margins: { top: 80, bottom: 80, left: 120, right: 120 },
});
}
function dataCell(text, shade = "FFFFFF") {
return new TableCell({
children: [new Paragraph({
children: [new TextRun({ text, size: 22 })],
alignment: AlignmentType.LEFT,
})],
shading: { type: ShadingType.SOLID, color: shade },
margins: { top: 80, bottom: 80, left: 120, right: 120 },
});
}
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
alignment: AlignmentType.CENTER,
borders: {
top: { style: BorderStyle.SINGLE, size: 8, color: "1F3864" },
bottom: { style: BorderStyle.SINGLE, size: 8, color: "1F3864" },
left: { style: BorderStyle.SINGLE, size: 8, color: "1F3864" },
right: { style: BorderStyle.SINGLE, size: 8, color: "1F3864" },
insideHorizontal: { style: BorderStyle.SINGLE, size: 4, color: "9DC3E6" },
insideVertical: { style: BorderStyle.SINGLE, size: 4, color: "9DC3E6" },
},
rows: [
new TableRow({ children: [ hdrCell("Feature"), hdrCell("Dominant Trait"), hdrCell("Recessive Trait") ] }),
new TableRow({ children: [ dataCell("Expression", "BDD7EE"), dataCell("Expressed in heterozygote (Tt)"), dataCell("Only in homozygote (tt)") ] }),
new TableRow({ children: [ dataCell("Symbol", "BDD7EE"), dataCell("Capital letter (T, R, Y)"), dataCell("Lowercase letter (t, r, y)") ] }),
new TableRow({ children: [ dataCell("Example (pea)", "BDD7EE"), dataCell("Tall stem, Round seed, Yellow cotyledon"), dataCell("Dwarf stem, Wrinkled seed, Green cotyledon") ] }),
new TableRow({ children: [ dataCell("F1 Appearance", "BDD7EE"), dataCell("Visible in F1 generation"), dataCell("Hidden in F1; reappears in F2") ] }),
],
});
}
// Mendel's Traits Table
function traitsTable() {
function hdrCell(text) {
return new TableCell({
children: [new Paragraph({
children: [new TextRun({ text, bold: true, size: 22, color: "FFFFFF" })],
alignment: AlignmentType.CENTER,
})],
shading: { type: ShadingType.SOLID, color: "2E74B5" },
margins: { top: 80, bottom: 80, left: 100, right: 100 },
});
}
function dataCell(text, shade = "FFFFFF") {
return new TableCell({
children: [new Paragraph({
children: [new TextRun({ text, size: 21 })],
alignment: AlignmentType.CENTER,
})],
shading: { type: ShadingType.SOLID, color: shade },
margins: { top: 60, bottom: 60, left: 100, right: 100 },
});
}
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
alignment: AlignmentType.CENTER,
borders: {
top: { style: BorderStyle.SINGLE, size: 8, color: "2E74B5" },
bottom: { style: BorderStyle.SINGLE, size: 8, color: "2E74B5" },
left: { style: BorderStyle.SINGLE, size: 8, color: "2E74B5" },
right: { style: BorderStyle.SINGLE, size: 8, color: "2E74B5" },
insideHorizontal: { style: BorderStyle.SINGLE, size: 4, color: "9DC3E6" },
insideVertical: { style: BorderStyle.SINGLE, size: 4, color: "9DC3E6" },
},
rows: [
new TableRow({ children: [ hdrCell("Sr. No."), hdrCell("Trait Studied"), hdrCell("Dominant Form"), hdrCell("Recessive Form") ] }),
new TableRow({ children: [ dataCell("1", "EBF3FB"), dataCell("Seed shape", "EBF3FB"), dataCell("Round", "EBF3FB"), dataCell("Wrinkled", "EBF3FB") ] }),
new TableRow({ children: [ dataCell("2"), dataCell("Seed color"), dataCell("Yellow"), dataCell("Green") ] }),
new TableRow({ children: [ dataCell("3", "EBF3FB"), dataCell("Seed coat color", "EBF3FB"), dataCell("Grey/Colored", "EBF3FB"), dataCell("White", "EBF3FB") ] }),
new TableRow({ children: [ dataCell("4"), dataCell("Pod shape"), dataCell("Inflated/Full"), dataCell("Constricted") ] }),
new TableRow({ children: [ dataCell("5", "EBF3FB"), dataCell("Pod color", "EBF3FB"), dataCell("Green", "EBF3FB"), dataCell("Yellow", "EBF3FB") ] }),
new TableRow({ children: [ dataCell("6"), dataCell("Flower position"), dataCell("Axial"), dataCell("Terminal") ] }),
new TableRow({ children: [ dataCell("7", "EBF3FB"), dataCell("Stem height", "EBF3FB"), dataCell("Tall (6 ft)", "EBF3FB"), dataCell("Dwarf (1.5 ft)", "EBF3FB") ] }),
],
});
}
// ===== DOCUMENT BUILD =====
const doc = new Document({
creator: "Orris AI",
title: "Mendelian Inheritance - Class 12 ISC",
description: "Introduction to Mendelian Inheritance for Class 12 ISC Biology",
styles: {
default: {
document: {
run: { font: "Times New Roman", size: 24 },
},
},
},
sections: [
{
properties: {
page: {
margin: { top: 1080, bottom: 1080, left: 1080, right: 1080 },
},
},
headers: {
default: new Header({
children: [
new Paragraph({
children: [new TextRun({ text: "Mendelian Inheritance | Class 12 ISC Biology", size: 18, italics: true, color: "666666" })],
alignment: AlignmentType.RIGHT,
border: { bottom: { style: BorderStyle.SINGLE, size: 6, color: "2E74B5" } },
})
]
})
},
footers: {
default: new Footer({
children: [
new Paragraph({
children: [
new TextRun({ text: "Page ", size: 18, color: "666666" }),
new PageNumber(),
new TextRun({ text: " | Principles of Inheritance and Variation", size: 18, color: "666666" }),
],
alignment: AlignmentType.CENTER,
border: { top: { style: BorderStyle.SINGLE, size: 6, color: "2E74B5" } },
})
]
})
},
children: [
// ===== PAGE 1: TITLE + BIOGRAPHY =====
new Paragraph({
children: [new TextRun({ text: "PRINCIPLES OF INHERITANCE AND VARIATION", size: 40, bold: true, color: "1F3864" })],
alignment: AlignmentType.CENTER,
spacing: { before: 0, after: 60 },
}),
new Paragraph({
children: [new TextRun({ text: "Introduction to Mendelian Inheritance", size: 32, bold: true, color: "2E74B5" })],
alignment: AlignmentType.CENTER,
spacing: { before: 0, after: 60 },
}),
new Paragraph({
children: [new TextRun({ text: "Class 12 ISC Biology", size: 26, italics: true, color: "666666" })],
alignment: AlignmentType.CENTER,
spacing: { before: 0, after: 300 },
}),
heading1("1. Introduction"),
para("Heredity is the transmission of characters from parents to offspring. Variation refers to the differences among individuals of the same species. The branch of biology that deals with heredity and variation is called Genetics. The term 'Genetics' was coined by William Bateson in 1906. However, the scientific foundations of genetics were laid much earlier by Gregor Johann Mendel through his famous experiments on the garden pea plant (Pisum sativum) in the 1860s."),
para("Mendel's work remained largely unrecognized for about 35 years until it was independently rediscovered in 1900 by three scientists: Hugo de Vries (Netherlands), Carl Correns (Germany), and Erich von Tschermak (Austria). Today, Mendel's principles form the cornerstone of classical genetics and are an essential part of the Class 12 ISC Biology curriculum under the chapter 'Principles of Inheritance and Variation.'"),
emptyLine(),
heading1("2. Gregor Johann Mendel - The Father of Genetics"),
para("Gregor Johann Mendel (1822-1884) was an Austrian monk and naturalist. He was born on 22nd July 1822 in Heinzendorf, Austria (now the Czech Republic). He studied natural sciences and mathematics at the University of Vienna and later became an abbot of the Augustinian Monastery of St. Thomas in Brno (then Brunn), Moravia."),
para("Between 1856 and 1863, Mendel performed careful and methodical hybridization experiments on the garden pea plant (Pisum sativum) in the monastery garden. He published his results in 1866 in the paper 'Versuche uber Pflanzenhybriden' (Experiments on Plant Hybridization). His two main conclusions - the Law of Segregation and the Law of Independent Assortment - are collectively known as Mendel's Laws of Heredity or Mendelian Inheritance."),
emptyLine(),
heading2("2.1 Why Mendel Chose Pisum sativum"),
para("Mendel selected the garden pea plant (Pisum sativum) as his experimental organism for the following reasons:"),
bullet("It is an annual plant, completing its life cycle quickly within one growing season."),
bullet("It has bisexual flowers (perfect flowers) that are naturally self-pollinating, reducing the chance of accidental cross-contamination."),
bullet("Cross-pollination can be easily performed by hand (artificial hybridization)."),
bullet("It produces a large number of offspring, making statistical analysis reliable."),
bullet("It has many easily distinguishable, contrasting pairs of characters (traits)."),
bullet("Pure breeding (true-breeding) varieties for each trait were readily available."),
bullet("It is easy and inexpensive to grow and maintain."),
emptyLine(),
heading2("2.2 The Seven Pairs of Contrasting Characters"),
para("Mendel studied seven pairs of contrasting traits in the garden pea plant. These traits show clear-cut, discrete variations with no intermediate forms:"),
emptyLine(),
traitsTable(),
emptyLine(),
para("The choice of these seven traits was particularly fortunate: each of the seven genes studied by Mendel happens to be located on a different chromosome (or is far enough apart on the same chromosome), which ensured they were inherited independently."),
pageBreak(),
// ===== PAGE 2: TERMINOLOGY + FLOWCHART 1 =====
heading1("3. Important Terminologies in Mendelian Genetics"),
heading2("3.1 Key Terms"),
para("Before studying Mendel's laws, it is important to understand the following key terms:"),
bullet("Gene: The basic unit of heredity. A gene is a segment of DNA that codes for a specific trait or protein."),
bullet("Allele: Alternative forms of a gene. For example, the gene for plant height has two alleles - 'T' for tall and 't' for dwarf."),
bullet("Locus (plural: Loci): The specific position of a gene on a chromosome."),
bullet("Homozygous: An organism possessing two identical alleles for a given gene (e.g., TT or tt). Also called pure breeding."),
bullet("Heterozygous: An organism possessing two different alleles for a given gene (e.g., Tt). Also called hybrid."),
bullet("Genotype: The genetic composition of an organism (e.g., TT, Tt, tt)."),
bullet("Phenotype: The observable or expressed character of an organism (e.g., Tall or Dwarf)."),
bullet("Dominant allele: The allele that expresses itself in both homozygous (TT) and heterozygous (Tt) conditions."),
bullet("Recessive allele: The allele that expresses itself only in the homozygous condition (tt); it is masked by the dominant allele in the heterozygous state."),
bullet("Monohybrid cross: A cross between parents differing in only one pair of contrasting characters."),
bullet("Dihybrid cross: A cross between parents differing in two pairs of contrasting characters."),
bullet("F1 Generation (First Filial Generation): The offspring produced from a cross between two parental (P) plants."),
bullet("F2 Generation (Second Filial Generation): The offspring produced by self-fertilization or crossing of F1 plants."),
bullet("Test cross: A cross between an organism of unknown genotype with a homozygous recessive organism to determine the genotype."),
bullet("Back cross: A cross between the F1 hybrid and any of its parents."),
bullet("Punnett Square: A grid-based diagram used to predict the genotypic and phenotypic outcomes of a genetic cross (devised by Reginald C. Punnett)."),
emptyLine(),
heading2("3.2 Dominant vs Recessive Traits"),
emptyLine(),
comparisonTable(),
emptyLine(),
// FLOWCHART 1: Genotype to Phenotype
heading2("3.3 Flowchart: Relationship between Genotype and Phenotype"),
emptyLine(),
flowchartBox("GENE (Alleles on chromosomes)", "BDD7EE", true),
arrowPara(),
new Paragraph({
children: [
new TextRun({ text: "Homozygous Dominant (TT) | Heterozygous (Tt) | Homozygous Recessive (tt)", size: 22, italics: true, color: "1F3864", bold: true })
],
alignment: AlignmentType.CENTER,
spacing: { before: 30, after: 30 },
}),
arrowPara(),
flowchartBox("GENOTYPE determines...", "E2EFDA", true),
arrowPara(),
new Table({
width: { size: 80, type: WidthType.PERCENTAGE },
alignment: AlignmentType.CENTER,
rows: [
new TableRow({ children: [
new TableCell({
children: [
new Paragraph({ children: [new TextRun({ text: "Dominant Phenotype", bold: true, size: 22, color: "1F3864" })], alignment: AlignmentType.CENTER }),
new Paragraph({ children: [new TextRun({ text: "(TT or Tt = TALL)", size: 21 })], alignment: AlignmentType.CENTER }),
],
shading: { type: ShadingType.SOLID, color: "E2EFDA" },
margins: { top: 80, bottom: 80, left: 120, right: 120 },
}),
new TableCell({
children: [
new Paragraph({ children: [new TextRun({ text: "Recessive Phenotype", bold: true, size: 22, color: "C00000" })], alignment: AlignmentType.CENTER }),
new Paragraph({ children: [new TextRun({ text: "(tt = DWARF)", size: 21 })], alignment: AlignmentType.CENTER }),
],
shading: { type: ShadingType.SOLID, color: "FFF2CC" },
margins: { top: 80, bottom: 80, left: 120, right: 120 },
}),
]})
]
}),
emptyLine(),
para("Summary: Phenotype = Genotype + Environment. The genotype sets the potential; the environment may influence the final expression."),
pageBreak(),
// ===== PAGE 3: LAW OF DOMINANCE + MONOHYBRID =====
heading1("4. Mendel's Laws of Inheritance"),
para("Based on his hybridization experiments, Mendel proposed three laws. (Note: the Law of Dominance is sometimes considered a separate law, but in the ISC syllabus, the two principal laws are the Law of Segregation and the Law of Independent Assortment.)"),
emptyLine(),
heading2("4.1 Law of Dominance (First Law)"),
boxedPara("Statement: When two homozygous individuals with contrasting characters are crossed, only one of the two characters (the dominant character) appears in the F1 generation. The other character (the recessive character) is completely masked.", "EBF3FB"),
emptyLine(),
para("In the cross between a pure tall (TT) and pure dwarf (tt) pea plant, all F1 offspring were tall (Tt). The tall trait dominated over the dwarf trait. The dwarf trait, though not expressed, was not destroyed - it reappeared in the F2 generation."),
emptyLine(),
heading2("4.2 Monohybrid Cross - Law of Segregation (Second Law)"),
boxedPara("Statement: The Law of Segregation (or Law of Purity of Gametes) states that during gamete formation, the two alleles of a gene pair segregate (separate) from each other so that each gamete receives only one allele of a gene. The two alleles are reunited randomly at fertilization.", "EBF3FB"),
emptyLine(),
para("Experiment: Mendel crossed a pure tall pea plant (TT) with a pure dwarf pea plant (tt)."),
emptyLine(),
heading3("Step 1: P Generation Cross (TT x tt)"),
emptyLine(),
punnettMonohybrid(),
emptyLine(),
para("Result: All F1 offspring were Tall (Tt). Phenotypic ratio in F1 = 1 Tall : 0 Dwarf."),
emptyLine(),
heading3("Step 2: F1 Self-Fertilization (Tt x Tt) → F2 Generation"),
emptyLine(),
punnettF2(),
emptyLine(),
para("Result of F2 Generation:"),
bullet("Genotypic ratio: 1 TT : 2 Tt : 1 tt"),
bullet("Phenotypic ratio: 3 Tall : 1 Dwarf (3:1 ratio)"),
bullet("The recessive character (dwarf) reappears in F2 in 25% of offspring."),
emptyLine(),
// FLOWCHART 2: Monohybrid Cross
heading2("4.3 Flowchart: Monohybrid Cross Summary"),
emptyLine(),
flowchartBox("P Generation: Pure Tall (TT) x Pure Dwarf (tt)", "BDD7EE", true),
arrowPara(),
flowchartBox("Gametes: T (from tall) and t (from dwarf)", "EBF3FB", false),
arrowPara(),
flowchartBox("F1 Generation: All Tall (Tt) - Law of Dominance", "E2EFDA", true),
arrowPara(),
flowchartBox("F1 x F1 Self-fertilization: Tt x Tt", "BDD7EE", false),
arrowPara(),
flowchartBox("F2 Generation: Gametes T and t from each F1 plant", "EBF3FB", false),
arrowPara(),
new Table({
width: { size: 70, type: WidthType.PERCENTAGE },
alignment: AlignmentType.CENTER,
rows: [
new TableRow({ children: [
new TableCell({
children: [new Paragraph({ children: [new TextRun({ text: "TT (Tall) - 1/4", size: 22, bold: true })], alignment: AlignmentType.CENTER })],
shading: { type: ShadingType.SOLID, color: "E2EFDA" },
margins: { top: 80, bottom: 80, left: 80, right: 80 },
}),
new TableCell({
children: [new Paragraph({ children: [new TextRun({ text: "Tt (Tall) - 2/4", size: 22, bold: true })], alignment: AlignmentType.CENTER })],
shading: { type: ShadingType.SOLID, color: "E2EFDA" },
margins: { top: 80, bottom: 80, left: 80, right: 80 },
}),
new TableCell({
children: [new Paragraph({ children: [new TextRun({ text: "tt (Dwarf) - 1/4", size: 22, bold: true })], alignment: AlignmentType.CENTER })],
shading: { type: ShadingType.SOLID, color: "FFF2CC" },
margins: { top: 80, bottom: 80, left: 80, right: 80 },
}),
]})
]
}),
arrowPara(),
flowchartBox("Phenotypic Ratio: 3 Tall : 1 Dwarf (Genotypic Ratio: 1:2:1)", "FFE699", true),
emptyLine(),
para("Significance: The reappearance of the dwarf trait in F2 proves that the alleles do not blend - they segregate and maintain their identity. This is the physical basis of the Law of Segregation."),
pageBreak(),
// ===== PAGE 4: DIHYBRID + LAW OF INDEPENDENT ASSORTMENT =====
heading1("5. Dihybrid Cross and the Law of Independent Assortment"),
para("After successfully establishing the Law of Segregation through monohybrid crosses, Mendel extended his studies to observe what happens when two pairs of contrasting traits are followed simultaneously. This led to the formulation of the Law of Independent Assortment."),
emptyLine(),
heading2("5.1 The Law of Independent Assortment (Third Law)"),
boxedPara("Statement: The Law of Independent Assortment states that when two pairs of traits are combined in a hybrid, segregation of one pair of characters is independent of the other pair of characters. In other words, genes for different traits assort (distribute) independently of one another during gamete formation.", "EBF3FB"),
emptyLine(),
para("Experiment: Mendel crossed a pure round yellow seeded plant (RRYY) with a pure wrinkled green seeded plant (rryy). Round (R) is dominant over wrinkled (r); Yellow (Y) is dominant over green (y)."),
emptyLine(),
heading2("5.2 Dihybrid Cross: P Generation and F1"),
emptyLine(),
dihybridF1(),
emptyLine(),
para("All F1 plants showed round yellow seeds (RrYy). This confirms dominance of R over r and Y over y."),
emptyLine(),
heading2("5.3 F2 Generation: Self-fertilization of F1 (RrYy x RrYy)"),
para("Each F1 plant (RrYy) produces four types of gametes in equal proportions: RY, Ry, rY, and ry. The Punnett square for a dihybrid cross is a 4x4 grid (16 combinations):"),
emptyLine(),
// 4x4 Punnett for dihybrid
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
alignment: AlignmentType.CENTER,
borders: {
top: { style: BorderStyle.SINGLE, size: 8, color: "2E74B5" },
bottom: { style: BorderStyle.SINGLE, size: 8, color: "2E74B5" },
left: { style: BorderStyle.SINGLE, size: 8, color: "2E74B5" },
right: { style: BorderStyle.SINGLE, size: 8, color: "2E74B5" },
insideHorizontal: { style: BorderStyle.SINGLE, size: 4, color: "9DC3E6" },
insideVertical: { style: BorderStyle.SINGLE, size: 4, color: "9DC3E6" },
},
rows: [
new TableRow({ children: [
cell("RrYy x RrYy", { shading: "1F3864", bold: true }),
cell("RY", { shading: "BDD7EE", bold: true }),
cell("Ry", { shading: "BDD7EE", bold: true }),
cell("rY", { shading: "BDD7EE", bold: true }),
cell("ry", { shading: "BDD7EE", bold: true }),
]}),
new TableRow({ children: [
cell("RY", { shading: "BDD7EE", bold: true }),
cell("RRYY (R.Y)", { shading: "E2EFDA" }),
cell("RRYy (R.Y)", { shading: "E2EFDA" }),
cell("RrYY (R.Y)", { shading: "E2EFDA" }),
cell("RrYy (R.Y)", { shading: "E2EFDA" }),
]}),
new TableRow({ children: [
cell("Ry", { shading: "BDD7EE", bold: true }),
cell("RRYy (R.Y)", { shading: "E2EFDA" }),
cell("RRyy (R.G)", { shading: "D9EAD3" }),
cell("RrYy (R.Y)", { shading: "E2EFDA" }),
cell("Rryy (R.G)", { shading: "D9EAD3" }),
]}),
new TableRow({ children: [
cell("rY", { shading: "BDD7EE", bold: true }),
cell("RrYY (R.Y)", { shading: "E2EFDA" }),
cell("RrYy (R.Y)", { shading: "E2EFDA" }),
cell("rrYY (W.Y)", { shading: "FFF2CC" }),
cell("rrYy (W.Y)", { shading: "FFF2CC" }),
]}),
new TableRow({ children: [
cell("ry", { shading: "BDD7EE", bold: true }),
cell("RrYy (R.Y)", { shading: "E2EFDA" }),
cell("Rryy (R.G)", { shading: "D9EAD3" }),
cell("rrYy (W.Y)", { shading: "FFF2CC" }),
cell("rryy (W.G)", { shading: "FFE4E1" }),
]}),
],
}),
emptyLine(),
para("Key: R.Y = Round Yellow | R.G = Round Green | W.Y = Wrinkled Yellow | W.G = Wrinkled Green"),
emptyLine(),
para("Phenotypic Ratio in F2 Generation: 9 Round Yellow : 3 Round Green : 3 Wrinkled Yellow : 1 Wrinkled Green (9:3:3:1)"),
emptyLine(),
heading2("5.4 Flowchart: Dihybrid Cross Summary"),
emptyLine(),
flowchartBox("P Generation: RRYY (Round Yellow) x rryy (Wrinkled Green)", "BDD7EE", true),
arrowPara(),
flowchartBox("Gametes: RY only (from RRYY) | ry only (from rryy)", "EBF3FB", false),
arrowPara(),
flowchartBox("F1: All RrYy (Round Yellow) - Confirms Law of Dominance", "E2EFDA", true),
arrowPara(),
flowchartBox("F1 x F1: RrYy x RrYy (Self-fertilization)", "BDD7EE", false),
arrowPara(),
flowchartBox("Gametes from each F1: RY : Ry : rY : ry (1:1:1:1)", "EBF3FB", false),
arrowPara(),
new Table({
width: { size: 90, type: WidthType.PERCENTAGE },
alignment: AlignmentType.CENTER,
rows: [
new TableRow({ children: [
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "9 Round Yellow", size: 22, bold: true })], alignment: AlignmentType.CENTER })], shading: { type: ShadingType.SOLID, color: "E2EFDA" }, margins: { top: 80, bottom: 80, left: 60, right: 60 } }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "3 Round Green", size: 22, bold: true })], alignment: AlignmentType.CENTER })], shading: { type: ShadingType.SOLID, color: "D9EAD3" }, margins: { top: 80, bottom: 80, left: 60, right: 60 } }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "3 Wrinkled Yellow", size: 22, bold: true })], alignment: AlignmentType.CENTER })], shading: { type: ShadingType.SOLID, color: "FFF2CC" }, margins: { top: 80, bottom: 80, left: 60, right: 60 } }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "1 Wrinkled Green", size: 22, bold: true })], alignment: AlignmentType.CENTER })], shading: { type: ShadingType.SOLID, color: "FFE4E1" }, margins: { top: 80, bottom: 80, left: 60, right: 60 } }),
]})
]
}),
arrowPara(),
flowchartBox("F2 Phenotypic Ratio: 9 : 3 : 3 : 1 - Confirms Law of Independent Assortment", "FFE699", true),
pageBreak(),
// ===== PAGE 5: TEST CROSS + BACK CROSS + EXCEPTIONS =====
heading1("6. Test Cross and Back Cross"),
heading2("6.1 Test Cross"),
para("A test cross is used to determine whether an organism showing a dominant phenotype is homozygous dominant (TT) or heterozygous (Tt). The unknown organism is crossed with a homozygous recessive individual (tt)."),
emptyLine(),
flowchartDiamond("Is the dominant phenotype individual TT or Tt?"),
arrowPara(),
new Table({
width: { size: 90, type: WidthType.PERCENTAGE },
alignment: AlignmentType.CENTER,
rows: [
new TableRow({ children: [
new TableCell({
children: [
new Paragraph({ children: [new TextRun({ text: "Case 1: TT x tt", bold: true, size: 22 })], alignment: AlignmentType.CENTER }),
new Paragraph({ children: [new TextRun({ text: "Offspring: All Tt (Tall)", size: 21 })], alignment: AlignmentType.CENTER }),
new Paragraph({ children: [new TextRun({ text: "Ratio: 1 Tall : 0 Dwarf", size: 21 })], alignment: AlignmentType.CENTER }),
new Paragraph({ children: [new TextRun({ text: "=> Homozygous Dominant (TT)", bold: true, size: 21, color: "1F3864" })], alignment: AlignmentType.CENTER }),
],
shading: { type: ShadingType.SOLID, color: "E2EFDA" },
margins: { top: 80, bottom: 80, left: 120, right: 120 },
}),
new TableCell({
children: [
new Paragraph({ children: [new TextRun({ text: "Case 2: Tt x tt", bold: true, size: 22 })], alignment: AlignmentType.CENTER }),
new Paragraph({ children: [new TextRun({ text: "Offspring: Tt (Tall) and tt (Dwarf)", size: 21 })], alignment: AlignmentType.CENTER }),
new Paragraph({ children: [new TextRun({ text: "Ratio: 1 Tall : 1 Dwarf", size: 21 })], alignment: AlignmentType.CENTER }),
new Paragraph({ children: [new TextRun({ text: "=> Heterozygous (Tt)", bold: true, size: 21, color: "C00000" })], alignment: AlignmentType.CENTER }),
],
shading: { type: ShadingType.SOLID, color: "FFF2CC" },
margins: { top: 80, bottom: 80, left: 120, right: 120 },
}),
]})
]
}),
emptyLine(),
para("The test cross is an important genetic tool used in plant breeding and genetic counseling to determine the genotype of an individual."),
emptyLine(),
heading2("6.2 Back Cross"),
para("A back cross is a cross between the F1 hybrid and either of its parents (homozygous dominant or homozygous recessive). When the F1 is crossed back with the recessive parent, it is also a test cross. Back crosses are used in plant and animal breeding programs to transfer desirable traits into established varieties."),
emptyLine(),
heading1("7. Incomplete Dominance"),
boxedPara("Definition: In incomplete dominance (also called partial or blending dominance), neither allele is completely dominant over the other, and the F1 heterozygote shows an intermediate phenotype - a blend of the two parental traits.", "EBF3FB"),
emptyLine(),
para("Classic Example: In Antirrhinum majus (snapdragon) or Mirabilis jalapa (Four o'clock plant):"),
bullet("P: Red flowers (RR) x White flowers (R'R')"),
bullet("F1: All Pink flowers (RR') - Intermediate phenotype"),
bullet("F2: 1 Red (RR) : 2 Pink (RR') : 1 White (R'R') - Phenotypic ratio 1:2:1"),
emptyLine(),
para("Note: The phenotypic ratio (1:2:1) equals the genotypic ratio in incomplete dominance, unlike complete dominance where the phenotypic ratio is 3:1. This occurs because the heterozygote is distinguishable from both homozygotes."),
emptyLine(),
heading1("8. Codominance"),
boxedPara("Definition: In codominance, both alleles are fully expressed simultaneously in the heterozygote. Neither allele is dominant over the other - both are equally expressed.", "EBF3FB"),
emptyLine(),
para("Classic Example: ABO Blood Group System in humans (controlled by gene I):"),
bullet("Alleles: IA (produces A antigen), IB (produces B antigen), i (produces neither antigen)"),
bullet("IA and IB are codominant to each other; both are dominant over i"),
bullet("Genotype IAIB shows both A and B antigens - Blood type AB (codominance)"),
bullet("Genotype IAIA or IAi - Blood type A; IBIB or IBi - Blood type B; ii - Blood type O"),
emptyLine(),
heading2("8.1 Flowchart: Incomplete Dominance vs Codominance"),
emptyLine(),
flowchartDiamond("Are Both Alleles Equal in Expression?"),
arrowPara(),
new Table({
width: { size: 90, type: WidthType.PERCENTAGE },
alignment: AlignmentType.CENTER,
rows: [
new TableRow({ children: [
new TableCell({
children: [
new Paragraph({ children: [new TextRun({ text: "INCOMPLETE DOMINANCE", bold: true, size: 22, color: "C55A11" })], alignment: AlignmentType.CENTER }),
new Paragraph({ children: [new TextRun({ text: "Intermediate/blended phenotype", size: 21 })], alignment: AlignmentType.CENTER }),
new Paragraph({ children: [new TextRun({ text: "Red + White = Pink (snapdragon)", size: 21 })], alignment: AlignmentType.CENTER }),
new Paragraph({ children: [new TextRun({ text: "F2 Ratio: 1:2:1", size: 21, bold: true })], alignment: AlignmentType.CENTER }),
],
shading: { type: ShadingType.SOLID, color: "FCE4D6" },
margins: { top: 80, bottom: 80, left: 120, right: 120 },
}),
new TableCell({
children: [
new Paragraph({ children: [new TextRun({ text: "CODOMINANCE", bold: true, size: 22, color: "1F3864" })], alignment: AlignmentType.CENTER }),
new Paragraph({ children: [new TextRun({ text: "Both alleles expressed simultaneously", size: 21 })], alignment: AlignmentType.CENTER }),
new Paragraph({ children: [new TextRun({ text: "A + B antigens both present (AB blood type)", size: 21 })], alignment: AlignmentType.CENTER }),
new Paragraph({ children: [new TextRun({ text: "No blending - both traits visible", size: 21, bold: true })], alignment: AlignmentType.CENTER }),
],
shading: { type: ShadingType.SOLID, color: "DAE8FC" },
margins: { top: 80, bottom: 80, left: 120, right: 120 },
}),
]})
]
}),
emptyLine(),
pageBreak(),
// ===== PAGE 6: MULTIPLE ALLELES + SUMMARY FLOWCHART + SIGNIFICANCE =====
heading1("9. Multiple Alleles"),
para("So far, we have considered genes with only two alleles. However, a gene may exist in more than two allelic forms in a population. This is called multiple allelism. The ABO blood group system (described above) is a classic example of multiple alleles (IA, IB, i)."),
emptyLine(),
heading2("9.1 Blood Group Inheritance Table"),
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
alignment: AlignmentType.CENTER,
borders: {
top: { style: BorderStyle.SINGLE, size: 8, color: "2E74B5" },
bottom: { style: BorderStyle.SINGLE, size: 8, color: "2E74B5" },
left: { style: BorderStyle.SINGLE, size: 8, color: "2E74B5" },
right: { style: BorderStyle.SINGLE, size: 8, color: "2E74B5" },
insideHorizontal: { style: BorderStyle.SINGLE, size: 4, color: "9DC3E6" },
insideVertical: { style: BorderStyle.SINGLE, size: 4, color: "9DC3E6" },
},
rows: [
new TableRow({ children: [
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "Blood Type", bold: true, size: 22, color: "FFFFFF" })], alignment: AlignmentType.CENTER })], shading: { type: ShadingType.SOLID, color: "1F3864" }, margins: { top: 80, bottom: 80, left: 120, right: 120 } }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "Possible Genotypes", bold: true, size: 22, color: "FFFFFF" })], alignment: AlignmentType.CENTER })], shading: { type: ShadingType.SOLID, color: "1F3864" }, margins: { top: 80, bottom: 80, left: 120, right: 120 } }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "Antigens on RBC", bold: true, size: 22, color: "FFFFFF" })], alignment: AlignmentType.CENTER })], shading: { type: ShadingType.SOLID, color: "1F3864" }, margins: { top: 80, bottom: 80, left: 120, right: 120 } }),
]}),
new TableRow({ children: [
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "A", size: 22 })], alignment: AlignmentType.CENTER })], shading: { type: ShadingType.SOLID, color: "FCE4D6" }, margins: { top: 60, bottom: 60, left: 120, right: 120 } }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "IAIA or IAi", size: 22 })], alignment: AlignmentType.CENTER })], shading: { type: ShadingType.SOLID, color: "FCE4D6" }, margins: { top: 60, bottom: 60, left: 120, right: 120 } }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "A antigen only", size: 22 })], alignment: AlignmentType.CENTER })], shading: { type: ShadingType.SOLID, color: "FCE4D6" }, margins: { top: 60, bottom: 60, left: 120, right: 120 } }),
]}),
new TableRow({ children: [
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "B", size: 22 })], alignment: AlignmentType.CENTER })], shading: { type: ShadingType.SOLID, color: "EBF3FB" }, margins: { top: 60, bottom: 60, left: 120, right: 120 } }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "IBIB or IBi", size: 22 })], alignment: AlignmentType.CENTER })], shading: { type: ShadingType.SOLID, color: "EBF3FB" }, margins: { top: 60, bottom: 60, left: 120, right: 120 } }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "B antigen only", size: 22 })], alignment: AlignmentType.CENTER })], shading: { type: ShadingType.SOLID, color: "EBF3FB" }, margins: { top: 60, bottom: 60, left: 120, right: 120 } }),
]}),
new TableRow({ children: [
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "AB", size: 22 })], alignment: AlignmentType.CENTER })], shading: { type: ShadingType.SOLID, color: "E2EFDA" }, margins: { top: 60, bottom: 60, left: 120, right: 120 } }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "IAIB", size: 22 })], alignment: AlignmentType.CENTER })], shading: { type: ShadingType.SOLID, color: "E2EFDA" }, margins: { top: 60, bottom: 60, left: 120, right: 120 } }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "Both A and B antigens", size: 22 })], alignment: AlignmentType.CENTER })], shading: { type: ShadingType.SOLID, color: "E2EFDA" }, margins: { top: 60, bottom: 60, left: 120, right: 120 } }),
]}),
new TableRow({ children: [
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "O", size: 22 })], alignment: AlignmentType.CENTER })], shading: { type: ShadingType.SOLID, color: "FFF2CC" }, margins: { top: 60, bottom: 60, left: 120, right: 120 } }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "ii", size: 22 })], alignment: AlignmentType.CENTER })], shading: { type: ShadingType.SOLID, color: "FFF2CC" }, margins: { top: 60, bottom: 60, left: 120, right: 120 } }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "Neither A nor B", size: 22 })], alignment: AlignmentType.CENTER })], shading: { type: ShadingType.SOLID, color: "FFF2CC" }, margins: { top: 60, bottom: 60, left: 120, right: 120 } }),
]}),
],
}),
emptyLine(),
heading1("10. Master Flowchart: Summary of Mendelian Inheritance"),
emptyLine(),
flowchartBox("START: Parental (P) Generation - Pure Breeding Lines", "BDD7EE", true),
arrowPara(),
flowchartBox("Cross between contrasting traits (hybridization)", "EBF3FB", false),
arrowPara(),
flowchartBox("F1 Generation - All show DOMINANT trait (Law of Dominance)", "E2EFDA", true),
arrowPara(),
flowchartDiamond("How many traits studied?"),
arrowPara(),
new Table({
width: { size: 90, type: WidthType.PERCENTAGE },
alignment: AlignmentType.CENTER,
rows: [
new TableRow({ children: [
new TableCell({
children: [
new Paragraph({ children: [new TextRun({ text: "ONE TRAIT (Monohybrid)", bold: true, size: 22, color: "2E74B5" })], alignment: AlignmentType.CENTER }),
new Paragraph({ children: [new TextRun({ text: "F2 Ratio: 3:1 (phenotype)", size: 21 })], alignment: AlignmentType.CENTER }),
new Paragraph({ children: [new TextRun({ text: "Genotype: 1:2:1", size: 21 })], alignment: AlignmentType.CENTER }),
new Paragraph({ children: [new TextRun({ text: "Law of SEGREGATION", bold: true, size: 21, color: "C55A11" })], alignment: AlignmentType.CENTER }),
],
shading: { type: ShadingType.SOLID, color: "EBF3FB" },
margins: { top: 80, bottom: 80, left: 120, right: 120 },
}),
new TableCell({
children: [
new Paragraph({ children: [new TextRun({ text: "TWO TRAITS (Dihybrid)", bold: true, size: 22, color: "2E74B5" })], alignment: AlignmentType.CENTER }),
new Paragraph({ children: [new TextRun({ text: "F2 Ratio: 9:3:3:1 (phenotype)", size: 21 })], alignment: AlignmentType.CENTER }),
new Paragraph({ children: [new TextRun({ text: "16 combinations in Punnett", size: 21 })], alignment: AlignmentType.CENTER }),
new Paragraph({ children: [new TextRun({ text: "Law of INDEPENDENT ASSORTMENT", bold: true, size: 21, color: "C55A11" })], alignment: AlignmentType.CENTER }),
],
shading: { type: ShadingType.SOLID, color: "E2EFDA" },
margins: { top: 80, bottom: 80, left: 120, right: 120 },
}),
]})
]
}),
arrowPara(),
flowchartBox("Apply Test Cross to determine exact genotype", "FFE699", false),
arrowPara(),
flowchartBox("Exceptions: Incomplete Dominance | Codominance | Multiple Alleles", "FFF2CC", false),
arrowPara(),
flowchartBox("CONCLUSION: Traits are controlled by discrete units (genes) that segregate and assort independently during gamete formation.", "1F3864", true),
emptyLine(),
heading1("11. Significance and Applications of Mendelian Genetics"),
bullet("Mendelian laws form the foundation of classical and modern genetics."),
bullet("They help predict the probability of offspring phenotypes and genotypes."),
bullet("Used in genetic counseling to predict risk of hereditary diseases (e.g., sickle cell anemia, cystic fibrosis)."),
bullet("Form the basis of plant and animal breeding programs for the development of improved varieties and breeds."),
bullet("Mendel's concept of 'factors' (genes) later became the basis of Chromosomal Theory of Inheritance (Sutton and Boveri, 1902)."),
bullet("Understanding Mendelian ratios helps identify deviations such as linkage, epistasis, and sex-linked inheritance."),
emptyLine(),
heading1("12. Limitations of Mendel's Laws"),
bullet("Mendel's laws do not apply to linked genes (genes located on the same chromosome)."),
bullet("They do not account for polygenic inheritance (traits controlled by multiple genes, e.g., height, skin color in humans)."),
bullet("Incomplete dominance, codominance, and epistasis are exceptions that Mendel's original laws did not address."),
bullet("Sex-linked inheritance follows modified patterns due to the presence of sex chromosomes (X and Y)."),
bullet("Cytoplasmic inheritance (maternal inheritance) does not follow Mendelian principles."),
emptyLine(),
new Paragraph({
children: [new TextRun({ text: "--- End of Introduction: Mendelian Inheritance ---", size: 22, italics: true, color: "666666" })],
alignment: AlignmentType.CENTER,
spacing: { before: 200, after: 80 },
}),
new Paragraph({
children: [new TextRun({ text: "Reference: Emery's Elements of Medical Genetics and Genomics | Basic Medical Biochemistry (Lieberman, 6th ed.) | ISC Biology Class 12 Syllabus", size: 18, italics: true, color: "999999" })],
alignment: AlignmentType.CENTER,
}),
],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("/home/daytona/workspace/mendelian-inheritance/Mendelian_Inheritance_Class12_ISC.docx", buffer);
console.log("Document created successfully!");
}).catch(err => {
console.error("Error:", err);
process.exit(1);
});
cd /home/daytona/workspace/mendelian-inheritance && node create_doc.js 2>&1
cd /home/daytona/workspace/mendelian-inheritance && node -e "const d = require('…
cd /home/daytona/workspace/mendelian-inheritance && node -e "const { PageNumberE…
~/mendelian-inheritance/create_doc.js
Error: String not found in file: ' HeadingLevel, AlignmentType, BorderStyle, WidthType, ShadingType, VerticalAlign, PageBreak, UnderlineType, Header, Footer, PageNumber, NumberFormat, TableBorders'
head -5 /home/daytona/workspace/mendelian-inheritance/create_doc.js
sed -i 's/UnderlineType, Header, Footer, PageNumber,/Header, Footer, PageNumberE…
~/mendelian-inheritance/create_doc.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/mendelian-inheritance/create_doc.js'
~/mendelian-inheritance/create_doc.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/mendelian-inheritance/create_doc.js'
cd /home/daytona/workspace/mendelian-inheritance && node create_doc.js 2>&1