A small biological program (HardyWeinberg equation)

11112019, 03:43 AM
(This post was last modified: 11112019 03:51 AM by Trond.)
Post: #1




A small biological program (HardyWeinberg equation)
This program was written on my HP 34C and calculates allele frequencies and genotype frequencies, based on the assumptions of two alleles and HardyWeinberg equilibrium. It could be of interest to e.g. biology teachers.
LBL A X><Y ÷ STO 5 √ STO 2 1  CHS STO 1 X^2 STO 3 RCL 1 RCL 2 * 2 * STO 4 RCL 2 RCL 1 RTN Start off with entering the sample size (i.e. number of individuals studied) in the Y register and number of homozygous recessive individuals (e.g. individuals showing expression of a rare recessive genetic variant) in the X register. E.g. if 100 individuals were investigated for a recessive genetic variant (allele), such as the inability to taste bitter substances, and this recessive trait was found in 15 individuals, you would key in 100 ENTER 15, and then run the program. The program places the dominant allele frequency (p) in the X register and in R1, and recessive allele frequency (q) in Y and in R2, homozygous dominant genotype frequency in R3, heterozygous in R4, and homozygous recessive genotype in R5. In the example above p=0.61 and q=0.39, heterozygous individuals carrying both alleles but not showing the recessive trait has frequency 0.47, or almost half the population. Frequency of individuals with dominant alleles only is in this case 0.38. 

12142019, 06:21 PM
(This post was last modified: 12142019 06:22 PM by PedroLeiva.)
Post: #2




RE: A small biological program (HardyWeinberg equation)
Thanks for your nice program. I loaded with HP67 code and is working perfect. Any more genetic or BIO programming to share?
Pedro 

« Next Oldest  Next Newest »

User(s) browsing this thread: 1 Guest(s)