emmanuelparadis / pegas

Population and Evolutionary Genetics Analysis System
GNU General Public License v2.0
27 stars 10 forks source link

Fst() does not run in case of a single population #51

Closed courtiol closed 3 years ago

courtiol commented 3 years ago

Since the function Fst() computes the Fis, it would be good if it could work with a single population.

library(pegas)
data(jaguar)
jaguar_corridor <- jaguar[jaguar$population == "Green Corridor", ]
Fst(jaguar_corridor) 
       Fit Fst Fis
FCA742 NaN NaN NaN
FCA723 NaN NaN NaN
FCA740 NaN NaN NaN
FCA441 NaN NaN NaN
FCA391 NaN NaN NaN
F98    NaN NaN NaN
F53    NaN NaN NaN
F124   NaN NaN NaN
F146   NaN NaN NaN
F85    NaN NaN NaN
F42    NaN NaN NaN
FCA453 NaN NaN NaN
FCA741 NaN NaN NaN

I will attempt a patch in a PR.