Calculate Fis And Hwe For One Population
2
1
Entering edit mode
11.2 years ago
714 ▴ 110

Hi guys,

I am using the R software package pegas to calculate Fis and significant departures from HWE. I've noticed that when I upload data for only one population, I am unable to perform the calculations.

I was wondering if I was missing something obvious? I would have thought that it is possible to do the calculation for one population? I am positive that there is no problem with my data set as I am able to perform other analysis with it and by simply appending more individuals of a different population to my dataset, I am able to get values for HWE and Fis.

I would really appreciate if someone can shed some light into this. Here is a sample of my dataset:

                       L1                 L2                 L3                 L4                 L5              Pop
      AG0001-C        G/G                G/G                C/C                C/C                G/G               1                           
      AG0002-C        G/G                G/G                C/C                C/C                G/G               1                         
      AG0003-C        G/G                G/G                C/C                C/C                G/G               1                       
      AG0004-C        G/G                G/G                C/C                C/C                G/G               1

Thanks.

r • 7.1k views
ADD COMMENT
1
Entering edit mode
11.2 years ago

You might need to specify a population. Take a look at "my.dat" below. Try matching my data.frame, but instead of 1&2 just specify 1....

There is no reason that you cannot calculate these values using Weir and Cockerham 1984 Fst, Fit, Fis.

If not I have some code you could use. It gives the exact same answers as Pegas.

#library(pegas)
#my.dat<-as.data.frame(cbind(c(rep("T/T", 8), rep("T/C",2), rep("C/C", 23)),c(rep(1, 8), rep(2,2), rep(2, 23))))
#colnames(my.dat)<-c("genotypes", "population")
#my.loci<-as.loci(my.dat)
ADD COMMENT
0
Entering edit mode

Hi Zev, I've tried it and as with my own data set I got "Nan" values for all three F-statistics. Do you think you could provide me with the code?

ADD REPLY
0
Entering edit mode

can you post an example locus? You can make one up that recapitulates the data you are working with.

ADD REPLY
1
Entering edit mode
11.2 years ago
David W 4.9k

My reading of Weir and Cockerham (1984) is that to calculate their statistics you need multiple population samples. The formulae all require you to calculate the variance in allele frequency across populations, s^2, which is given by an equation that has (number of populations -1 ) as the denominator in a fraction.

If you are getting a lot of NaNs then Pegas is dutifully carrying out that equation and telling you the result is undefined . Other people calculate F_is for sinhle populations, but I don't know how, one (kind of hacky) option would be to just set the across-population variance to zero

ADD COMMENT
0
Entering edit mode

Hi David, what you said makes a lot of sense, I figured that was the case...sorry to sound stupid but do you mean that I should edit the function so that across-population variance is zero?..I'm a novice in R and don't really have an idea of how to go about that.

ADD REPLY
0
Entering edit mode

page 1359 n = the number of populations from n = 1 .. r. The sub equations A, B and C appear to sum across populations so I don't see why you couldn't run it for just one. This being said I am always looking at 2 populations so I could be wrong.

ADD REPLY

Login before adding your answer.

Traffic: 1968 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6