- Define families with genders and relationships.
- Define easy and intermediate relationship predicates.
- Specify pedigree collapse determination using the Coefficient of Inbreeding (Wright, 1922) (see SOURCES [4]) by using helper predicates and bundling them into advanced logic.
- Define helper functions for the COI calculation.
- Sources.
This program aims to determine the degree of pedigree collapse (incest) in families. The Coefficient of Inbreeding (COI) is measured with Wright's 1922 formula (see SOURCES [4]).
Note: The pedigree collapse coefficient is usually not used in science due to misleading approximations. For scientific purposes, COI is normally used.
?- coi(<COI>, <Person>, <BaseRiskRate>).<COI>should not be set with a value.<Person>can be any person in the knowledge base (e.g.,charles_II_kingOfSpain) or a variable.<BaseRiskRate>is a float in[0, 1].- Recommended base risk rates:
0,0.03,0.05.
Example:
coi(COI, charles_II_kingOfSpain, 0.03).?- cois_to_json(<BaseRiskRate>, <JSON>), write_jsoned_cois(<JSON>).- Set
<BaseRiskRate>to a value like0.03. - Use
JSONas the variable for<JSON>. - This writes JSON-formatted COIs to the console.
FP = SUM[ 0.5 ^ (N1 + N2 + 1) * (1 + FCA) ]
- FP: Coefficient of Inbreeding of person
P. - SUM: Sum of all results for each common ancestor of
P. - N1: Number of generations between
Pand a found common ancestor ofP's father (Parent1). - N2: Same as
N1, for the mother (Parent2). - FCA: Coefficient of Inbreeding for the found common ancestor.
Example: see the simple animal relationship example (see SOURCES [3], page 150):
animal_Phas the same grandfatheranimal_c.- The equation is:
FP = 0.5 ^ (1 + 1 + 1) * (1 + 0) = 0.125
N1is1, as one generation difference between grandfather and father.N2is1, as one generation difference between grandfather and mother.FCAis0, as no information about the grandfather's ancestors was given.- Result:
0.125→12.5%of the genes are duplicates.
- Plot the solution for a given person, or the average of many people, with different base rates.
- Ask teammates if anyone does Graphviz in Prolog (visualization).
- One person as a function of base rate
[0, 10]. - All people in a population, averaged, with base rates
[0, 10].
- Check other methods of evaluating pedigree collapse.