Skip to content

s-voelkl/Pedigree-Collapse-in-Prolog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

Structure

  • 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.

Goal of This Program

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.

Usage: coi

?- 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).

Usage: cois_to_json

?- cois_to_json(<BaseRiskRate>, <JSON>), write_jsoned_cois(<JSON>).
  • Set <BaseRiskRate> to a value like 0.03.
  • Use JSON as the variable for <JSON>.
  • This writes JSON-formatted COIs to the console.

Formula

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 P and a found common ancestor of P's father (Parent1).
  • N2: Same as N1, for the mother (Parent2).
  • FCA: Coefficient of Inbreeding for the found common ancestor.

Example Equation

Example: see the simple animal relationship example (see SOURCES [3], page 150):

  • animal_P has the same grandfather animal_c.
  • The equation is:
FP = 0.5 ^ (1 + 1 + 1) * (1 + 0) = 0.125
  • N1 is 1, as one generation difference between grandfather and father.
  • N2 is 1, as one generation difference between grandfather and mother.
  • FCA is 0, as no information about the grandfather's ancestors was given.
  • Result: 0.12512.5% of the genes are duplicates.

Possible Further Steps

  • 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.

About

Pedigree collapse (incest) evaluation using the coefficient of imbreeding (COI) in Prolog

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages