PROG0039 - Sacred Cat of Burma

no tags 

Point coloration refers to animal coat coloration with a pale body and relatively darker extremities: face, ears, feet, tail, and (in males) scrotum. Colorpointed breeds occurs in certain species of rabbits, rats, sheep and horses, but most are found in the family of cats (Felidae) where it is a form of partial albinism resulting from a mutation in tyrosinase — an enzyme involved with melanin production. The mutated enzyme is thermolabile: it fails to work at normal body temperatures, but becomes active in cooler areas of the skin. As a result, dark pigment is limited to the coldest areas of the body, that is, the extremities. Pointed kittens are born white, since the womb is uniformly warm. As the kittens age, the cooler areas darken while warmer areas remain cream to white in color.

An example of a colorpointed cat is the Birman (also called the "Sacred Cat of Burma"), a domestic long-haired breed that is distinguished by a silky coat, deep blue eyes and contrasting white "gloves" or "socks" on each paw. The breed name is derived from Birmanie, the French name for Burma. Recognized point colors are seal, chocolate, blue and lilac (a softer silver-grey).

heilige Birmaan

When breeding Birman purelines it is essential to have some basic understanding of the genetics that determines what point colors the litter of a couple of cats may have. Each cat has two C-genes $c_p$ and $c_m$ where the first is paternal and the second is maternal in ancestry. In addition, each cat also has two D-genes $c_p$ and $c_m$ where again the first is paternal and the second is maternal in ancestry. The point color is completely determined by the combination of these four genes.

genotype
The point color of a Birman is completely determined by the combination of four genes: two C-genes and two D-genes, in each case one that paternal and one that is maternal in ancestry.

There are two alleles (alternative forms) of the C-gene that we will represent by the letters C and c, and two alleles of the D-genes that we will represent by the letters D and d. As a result, we can represent the cat's point coloration genotype by the string $c_pc_md_pd_m$, with $c_p, c_m \in \{\texttt{C}, \texttt{c}\}$ and $d_p, d_m \in \{\texttt{D}, \texttt{d}\}$. The relationship between the 16 possible genotypes of the C- and D-genes and the resulting point colors is given in the following color table, where we have used the abbreviation choc for the point color chocolate.

color table
Color table that indicates the resulting point color for each of the 16 possible combinations of C- and D-genes, where we have used the abbreviation choc for the point color chocolate.

A Birman having genotype $c_pc_md_pd_m$ randomly passes one of its two C-genes ($c_p$ or $c_m$) and one of its two D-genes ($d_p$ or $d_m$) on to each of its kittens. In other words, the cat passes one of four possible combinations $gh$ of a C-gene $g$ and a D-gene $h$ on to each of its kittens, with $g \in \{c_p, c_m\}$ and $h \in \{d_p, d_m\}$. It is custom practice to fix a generic order of these four possible combinations in the following way: $c_pd_p$, $c_pd_m$, $c_md_p$ and $c_md_m$.

combinations
The generic order of the four possible combinations of a C-gene and a D-gene that each cat passes on to its kittens.

If a male Birman with genotype $c_pc_md_pd_m$ mates with a female Birman with genotype $c'_pc'_md'_pd'_m$, each of their kittens has a genotype $gg'hh'$, where $g \in \{c_p, c_m\}$, $g' \in \{c'_p, c'_m\}$, $h \in \{d_p, d_m\}$ and $h' \in \{d'_p, d'_m\}$. Because the C-genes and D-genes are independently passed on to the offspring, each possible genotype of the kittens occurs with equal chance. Geneticist Reginald Punnet invented a diagram that visually represents the possible genotypes of a particular crossing of two cats: the Punnett square. This is a $4 \times 4$ grid whose rows are labeled top to bottom with the four possible combinations of the genes that are passed on by the male cat (in their generic order), and whose columns are labeled left to right with the four possible combinations of the genes that are passed on by the female cat (again in their generic order). Each cell of the grid then contains the genotype of a kitten resulting from the combination of the paternal and maternal genes.

By determining the corresponding point color for each possible genotype of the kittens, breeders use the Punnett square to derive the distribution of point colors in the offspring of the crossed cats. Below we give an exampe of a Punnett square for a male and female Birman that both have genotype CcDd. From this diagram we can derive that the first generation of kittens will have a distribution 9:3:3:1 of the point colors seal:chocolate:blue:lilac.

Punnett square
Punnett square for a male and female Birman that both have genotype CcDd. From this diagram we can derive that the first generation of kittens will have a distribution 9:3:3:1 of the point colors seal:chocolate:blue:lilac.

Assignment

In this assignment we represent the genotype of a Birman by a string $c_pc_md_pd_m$ of four letters, where $c_p, c_m \in \{\texttt{C}, \texttt{c}\}$ and $d_p, d_m \in \{\texttt{D}, \texttt{d}\}$. Your task:

  • Write a function color that takes the genotype of a Birman. The function must return the string that describes the point color of the Birman: seal, chocolate, blue or lilac.
  • Write a function combinations that takes the genotype of a Birman. The function must return the four possible combinations of C- and D-genes that the Birman may pass on to its offspring, listed in the generic order. This result must be represented as a list of 2-letter strings.
  • Write a function punnett that takes the genotypes of a male and female Birman as two individual string arguments. The function also has an optional third argument pprint that takes a Boolean value (default value: False). The function must return the Punnett square that contains the possible genotypes of the first generation kittens of the two cats whose genotypes are given. If the value False was passed to the pprint argument, the result must be returned as a list of lists, where the inner lists represent the successive rows of the square. If the value True was passed to the pprint argument, the result must be returned as a string, where the rows of the square are at separate lines and the genotypes on the same row are separated from each other by a single space.
  • Write a function colorDistribution that takes the genotypes of a male and female Birman as two individual string arguments. The function must return a dictionary whose keys are the point colors that may occur in the offspring of the two cats whose genotypes are given (seal, chocolate, blue and/or lilac). For each color that is used as a key in the dictionary, the associated value must indicate how many of the 16 possible genotypes of the kittens result in that particular color.

Example

>>> color('CcDd')
'seal'
>>> color('ccdd')
'lilac'

>>> combinations('CcDd')
['CD', 'Cd', 'cD', 'cd']
>>> combinations('ccdd')
['cd', 'cd', 'cd', 'cd']

>>> print(punnett('CcDd', 'CcDd'))
[['CCDD', 'CCDd', 'CcDD', 'CcDd'], ['CCdD', 'CCdd', 'CcdD', 'Ccdd'], ['cCDD', 'cCDd', 'ccDD', 'ccDd'], ['cCdD', 'cCdd', 'ccdD', 'ccdd']]
>>> print(punnett('CcDd', 'CcDd', pprint=True))
CCDD CCDd CcDD CcDd
CCdD CCdd CcdD Ccdd
cCDD cCDd ccDD ccDd
cCdD cCdd ccdD ccdd
>>> print(punnett('cCDd', 'CcdD', pprint=True))
cCDd cCDD ccDd ccDD
cCdd cCdD ccdd ccdD
CCDd CCDD CcDd CcDD
CCdd CCdD Ccdd CcdD

>>> colorDistribution('CcDd', 'CcDd')
{'blue': 3, 'seal': 9, 'lilac': 1, 'chocolate': 3}
>>> colorDistribution('cCDD', 'cCDD')
{'seal': 12, 'chocolate': 4}
>>> colorDistribution('ccDD', 'ccDD')
{'chocolate': 16}
>>> colorDistribution('ccdd', 'CcDd')
{'blue': 4, 'lilac': 4, 'seal': 4, 'chocolate': 4}

Epilogue

While most cats have something mysterious about them (in the first place we think about the cat Winston Churchill from the 1983 Stephen King book Pet Semetary), Birmans are one of few breeds that can boast their own legend.

The cats that live at the temple of Lao-Sun. A long time ago several groups of Kittah-priests lived in the mysterious land of Tibet. They adored the god Song-Hyo and the goddess Tsun Kyan-Kse. They built wonderful places to worship their gods: beautiful decorated temples covered with gold-leaf and surrounded by high walls for protection. These high walls offered protection to the priests and at the same time secured the hundred of white cats that were kept in each temple. The cats played an important role in the religion of the Kittah's: some of the priests had such pure souls that they couldn't be missed on earth. When they died the goddess transmitted the souls of the priests to the white cats.

Temple on mount Lugh. In a temple built on the mountain Lugh lived a priest called Mun-Ha. He was very religious so that it was said that the god Song-Hyo himself created the tresses in Mun-Ha's golden beard. Mun-Ha's thoughts were dedicated only to the god and the goddess of the soul-transmission: it was the goddess who decided which of the priests' souls were allowed to live again in the body of a sacred cat and it was she who decided when this soul was transmitted to another Kittah-priest. Tsun Kyan-Kse had sapphire eyes. The white cat Sinh who was always at the side of his master Mun-Ha had golden eyes a reflection of his masters golden beard.

In an evil night the temple was attacked by a band of murderous Phoums from Siam who killed Mun-Ha who was still meditating before the golden statue of the goddess. Until his last moment he gazed into the sapphire eyes of Tsun Kyan-Kse and then the miracle of the soul transmission took place: Sinh jumped on the head of his fallen master and continued to gaze into the eyes of the goddess. At that moment Sinh's eye color changed into sapphire just as radiant as the eyes of the goddess. His white fur changed into a dark color at the extremities of his body and a dark mask appeared on his face. The rest of his body took on a golden color except for his feet: they turned white at the spots where his feet touched the hair of the old priest. Only once Sinh turned his head towards the huge temple gate and the Kittah-priests managed to close the gate so that further ransacking was stopped.

For seven days and nights Sinh remained seated there and gazed into the goddesses' eyes, neither eating nor drinking. He died on the seventh day taking Mun-Ha's soul to Tsun Kyan-Kse. It was seven days later when the Kittah-priests collected around the statue of the goddess to decide who would become the successor of Mun-Ha. All the temple cats appeared and all of them had Sinh's coloring pattern. In utter silence the cats grouped themselves around the youngest of the Kittah-priests and thus the goddess choose Mun-Ha's successor.

This is the legend of the Sacred Birman Cat: they have the brilliant blue eyes of the goddess, the golden hue that reflected from both their master and the golden statue of the goddess and with dark brown as a symbol of the impurity of the earth: the wicked murder of the priest but with white feet as a symbol of the purity of the soul.

De term puntkleurig wordt gebruikt voor dieren met een bleke lichaamskleur en relatief donkere extremiteiten: gezicht, poten, oren, staart en scrotum (bij de mannelijke exemplaren). Zo zijn er puntkleurige soorten konijnen, ratten, schapen en paarden, maar de meeste puntkleurige soorten vinden we binnen de familie van de katachtigen (Felidae). Een voorbeeld hiervan is de heilige Birmaan (ook kortweg Birmaan), een huiskattenras met een licht crèmekleurig lichaam en gekleurde punten. Birmanen hebben punten in één van de volgende vier kleuren: seal (donkerbruin), chocolate (melkchocoladebruin), blue (blauwgrijs) en lilac (licht blauwgrijs). De lichaamsbouw van deze soort houdt het midden tussen Perzische en Siamese katten. Birmanen verschillen van andere soorten puntkleurige katten door hun witte voeten, die handschoenen genoemd worden. Hun vacht is halflang, niet zo lang en dik als van een Perzische kat, en klit niet. Eén van de opvallendste kenmerken van Birmanen zijn hun blauwe ogen.

heilige Birmaan

Bij het kweken van raszuivere Birmanen is een beetje kennis van de genetica nodig om te bepalen welke puntkleuren het nageslacht van een koppel katten kan hebben. Elke kat heeft immers twee C-genen $c_v$ en $c_m$ waarvan de eerste geërfd werd van de vader en de tweede van de moeder. Daarnaast heeft elke kat ook twee D-genen $d_v$ en $d_m$ waarvan ook weer de eerste geërfd werd van de vader en de tweede van de moeder. De puntkleur wordt volledig bepaald door de combinatie van deze vier genen.

genotype
De puntkleur van een heilige Birmaan wordt volledig bepaald door de combinatie van vier genen: twee C-genen en twee D-genen waarbij er telkens één wordt geërfd van de vader en één van de moeder.

Er zijn twee allelen (varianten) van het C-gen die we zullen aanduiden met de letters C en c, en er zijn ook twee allelen van het D-gen die we zullen aanduiden met de letters D en d. Daarom kunnen we het genotype van een kat dat bepalend is voor haar puntkleur voorstellen door de string $c_vc_md_vd_m$, waarbij $c_v, c_m \in \{\texttt{C}, \texttt{c}\}$ en $d_v, d_m \in \{\texttt{D}, \texttt{d}\}$. Het verband tussen de 16 mogelijke genotypes van de C- en D-genen en de resulterende puntenkleuren wordt weergeven in onderstaande kleurentabel, waarbij we de puntkleur chocolate afgekort hebben tot choc.

kleurentabel
Kleurentabel die voor elk van de 16 mogelijke genotypes van de C- en D-genen aangeeft in welke puntkleur ze resulteren, waarbij we de puntkleur chocolate afgekort hebben tot choc.

Een kat met genotype $c_vc_md_vd_m$ geeft willekeurig één van zijn twee C-genen ($c_v$ of $c_m$) en willekeurig één van zijn D-genen ($d_v$ of $d_m$) door aan elk van zijn of haar kinderen. De kat geeft dus telkens één van de vier mogelijke combinaties $gh$ van een C-gen $g$ en een D-gen $h$ door aan elk kind, met $g \in \{c_v, c_m\}$ en $h \in \{d_v, d_m\}$. Het is standaard praktijk om de generische volgorde van deze vier mogelijke combinaties als volgt vast te leggen: $c_vd_v$, $c_vd_m$, $c_md_v$ en $c_md_m$.

combinaties
De standaard volgorde van de vier mogelijke combinaties van een C-gen en een D-gen die elke kat kan doorgeven aan zijn of haar kinderen.

Als een kater met genotype $c_vc_md_vd_m$ paart met een kattin met genotype $c'_vc'_md'_vd'_m$, dan heeft elk van hun kittens een genotype $gg'hh'$, waarbij $g \in \{c_v, c_m\}$, $g' \in \{c'_v, c'_m\}$, $h \in \{d_v, d_m\}$ en $h' \in \{d'_v, d'_m\}$. Omdat C- en D-genen onafhankelijk van elkaar worden doorgegeven, heeft elk mogelijke genotype van de kittens evenveel kans om voor te komen. De geneticus Reginald Punnet bedacht een handig hulpmiddel om de mogelijke genotypes na paring van twee katten visueel voor te stellen: het vierkant van Punnett. Dit is een $4 \times 4$ rooster waarvan de rijen van boven naar onder gelabeld worden met de vier mogelijke combinaties van genen die worden doorgegeven door de kater (in hun generische volgorde), en de kolommen van links naar rechts met de vier mogelijke combinaties van genen die worden doorgegeven door de kattin (opnieuw in hun generische volgorde). Elke cel van het rooster bevat dan het genotype van een kitten na combinatie van de genen van de kater en de kattin.

Door voor elk mogelijk genotype van de kittens de corresponderende puntkleur te bepalen, kan op basis van het vierkant van Punnett ook eenvoudig de verdeling van de puntkleuren van het nageslacht van een kattenpaar bepaald worden. Als voorbeeld geven we hieronder het vierkant van Punnett voor een kater en kattin die beide genotype CcDd hebben. Hieruit volgt dat de eerste generatie nakomelingen een verdeling 9:3:3:1 van de puntkleuren seal:chocolate:blue:lilac zal hebben.

vierkant van Punnett
Vierkant van Punnett voor een kater en een kattin die beide genotype CcDd hebben voor de vier genen die hun puntkleur bepalen. Hieruit volgt dat de eerste generatie nakomelingen een verdeling 9:3:3:1 van de puntkleuren seal:chocolate:blue:lilac zal hebben.

Opgave

In deze opgave stellen we het genotype van een Birmaan voor door een string $c_vc_md_vd_m$ van vier letters, waarbij $c_v, c_m \in \{\texttt{C}, \texttt{c}\}$ en $d_v, d_m \in \{\texttt{D}, \texttt{d}\}$. Gevraagd wordt:

  • Schrijf een functie kleur waaraan het genotype van een Birmaan moet doorgegeven worden. De functie moet een string teruggeven die de puntkleur van de Birmaan omschrijft: seal, chocolate, blue of lilac.
  • Schrijf een functie combinaties waaraan het genotype van een Birmaan moet doorgegeven worden. De functie moet de vier mogelijke combinaties van C- en D-genen teruggeven die de Birmaan aan zijn of haar nageslacht kan doorgegeven, opgelijst in hun generische volgorde. Dit resultaat moet voorgesteld worden als een lijst van strings van twee letters.
  • Schrijf een functie punnett waaraan twee genotypes van Birmanen moeten doorgegeven worden, respectievelijk dat van een kater en dat van een kattin. De functie heeft ook nog een optioneel derde argument pprint waaraan een Booleaanse waarde kan doorgegeven worden (standaardwaarde: False). De functie moet het vierkant van Punnett teruggeven met de genotypes van de mogelijke nakomelingen van de twee katten waarvan het genotype gegeven is. Indien aan het argument pprint de waarde False werd doorgegeven, dan moet dit resultaat teruggegeven worden onder de vorm van een lijst van lijsten, waarbij de binnenste lijsten de opeenvolgende rijen van het vierkant voorstellen. Indien aan het argument pprint de waarde True werd doorgegeven, dan moet het resultaat teruggegeven worden onder de vorm van een string, waarbij de rijen van het vierkant op opeenvolgende regels staan en de genotypes op dezelfde rij van elkaar gescheiden worden door één enkele spatie.
  • Schrijf een functie kleurverdeling waaraan twee genotypes van Birmanen moeten doorgegeven worden, respectievelijk dat van een kater en dat van een kattin. De functie moet een dictionary teruggeven waarvan de sleutels gevormd worden door de puntkleuren die kunnen voorkomen bij de nakomelingen van de twee katten met gegeven genotype (seal, chocolate, blue en/of lilac). Voor elke kleur die als sleutel voorkomt in de dictionary, moet de geassocieerde waarde aangeven hoeveel van de 16 mogelijke genotypes van de kittens resulteren in die bepaalde kleur.

Voorbeeld

>>> kleur('CcDd')
'seal'
>>> kleur('ccdd')
'lilac'

>>> combinaties('CcDd')
['CD', 'Cd', 'cD', 'cd']
>>> combinaties('ccdd')
['cd', 'cd', 'cd', 'cd']

>>> print(punnett('CcDd', 'CcDd'))
[['CCDD', 'CCDd', 'CcDD', 'CcDd'], ['CCdD', 'CCdd', 'CcdD', 'Ccdd'], ['cCDD', 'cCDd', 'ccDD', 'ccDd'], ['cCdD', 'cCdd', 'ccdD', 'ccdd']]
>>> print(punnett('CcDd', 'CcDd', pprint=True))
CCDD CCDd CcDD CcDd
CCdD CCdd CcdD Ccdd
cCDD cCDd ccDD ccDd
cCdD cCdd ccdD ccdd
>>> print(punnett('cCDd', 'CcdD', pprint=True))
cCDd cCDD ccDd ccDD
cCdd cCdD ccdd ccdD
CCDd CCDD CcDd CcDD
CCdd CCdD Ccdd CcdD

>>> kleurverdeling('CcDd', 'CcDd')
{'blue': 3, 'seal': 9, 'lilac': 1, 'chocolate': 3}
>>> kleurverdeling('cCDD', 'cCDD')
{'seal': 12, 'chocolate': 4}
>>> kleurverdeling('ccDD', 'ccDD')
{'chocolate': 16}
>>> kleurverdeling('ccdd', 'CcDd')
{'blue': 4, 'lilac': 4, 'seal': 4, 'chocolate': 4}

Epiloog

Hoewel de meeste katten wel iets mysterieus hebben (en dan denken we in de eerste plaats aan de kat Winston Churchill uit het boek Pet Sematary (1983) van Stephen King), zijn er naast de Birmaan maar weinig rassen die kunnen bogen op een eigen legende.

De katten die in te tempel van Lao-Sun wonen.In het verre verleden woonde er in het mysterieuze Tibet een groep Kittah-priesters die de god Song-Hyo en de godin Tsun Kyan-Kse aanbaden. Om dit in alle rust te kunnen doen en om hun goden te vereren, bouwden ze prachtige tempels die met bladgoud bedekt waren en omringd waren door hoge muren. Deze hoge muren dienden tevens ter bescherming van de  honderd witte katten die elke tempel bewoonden. Deze katten speelden een belangrijke rol in de godsdienst van de Kittahs: de priesters die zo puur waren dat hun ziel op aarde niet kon worden gemist, lieten na hun dood hun ziel overgaan in zo'n witte kat.

Tempel op de berg Lugh.In een tempel die gebouwd was boven op de berg Lugh woonde een priester die Mun-Ha heette en die zo gelovig was dat men beweerde dat de god Song-Ho zelf zijn gouden baard had gevlochten. Mun-Ho wijdde al zijn gedachten aan de dienst van de godin Tsun Kyan-Kse, de heerseres van de zielsverhuizing. De godin bepaalde welke ziel van de Kittah-priesters het werd toegestaan om opnieuw te leven in een heilig dier en zij bepaalde wanneer de ziel van het heilige dier weer overging in een Kittah-priester. De godin had stralende saffierblauwe ogen. De witte kater Sinh die altijd aan de zijde van Mun-Ha zat wanneer hij mediteerde had goudkleurige ogen — een reflectie van de goudkleurige baard van zijn meester.

Op een kwade nacht werd de tempel overvallen door een bende moordzuchtige Phoums uit Siam en werd Mun-Ho vermoord terwijl hij in standvastige aanbidding voor het beeld van de godin geknield zat. Tot op het laatste moment keek hij in de saffieren ogen van de godin en toen gebeurde het wonder van de zielsverhuizing: de kater Sinh sprong op het hoofd van zijn in elkaar gezakte meester en keek strak in de ogen van de godin. Op dat moment veranderde de oogkleur van Sinh in een even stralend blauw als dat van de godin, zijn witte vacht werd donker aan de poten, staart en oren en hij kreeg een donker masker. Zijn vacht kreeg een goudkleurige zweem. Enkel daar waar zijn poten het hoofd van zijn meester raakten, bleef de vacht zuiver wit. Eenmaal draaide Sinh zijn kop om in de richting van de grote toegangspoort van de tempel. De Kittahs volgden zijn blik en slaagden erin de zware bronzen toegangsdeur van de tempel te sluiten zodat de tempel verder onheil werd bespaard.

Zeven dagen lang bleef Sinh in de ogen van de godin kijken en at of dronk niet. Na zeven dagen overleed Sinh en nam hij de ziel van Mun-Ha mee naar Tsun Kyan-Kse. Weer zeven dagen later verzamelden de priesters zich bij het beeld van de godin om te beslissen wie de opvolger van Mun-Ho moest worden. Alle katten van de tempel kwamen ook naar het beeld. Ze hadden allemaal dezelfde gedaantewisseling ondergaan als Sinh. In diepe stilte gingen de katten om de jongste Kittah-priester heen zitten en zo koos de godin de opvolger van Mun-Ho.

Zo ontstond volgens de legende de Heilige Birmaan: ogen van een godin, een gouden glans die van zowel de godin als van zijn meester kwam en een donkerbruine kleur als symbool voor de onreinheid van de aarde, de laffe moord op het reine maar met witte voeten als symbool van de zuiverheid van de ziel.



Added by:Peter Dawyndt
Date:2011-07-24
Time limit:10s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:PY_NBC
Resource:None