GithubHelp home page GithubHelp logo

Comments (4)

thierrygosselin avatar thierrygosselin commented on June 2, 2024

Ok that's good timing because I need to run some test with Laura Benestan data!
Will give you an update on functions tested tomorrow
Cheers
Thierry

On Nov 25, 2015, at 09:29, Jerome Goudet [email protected] wrote:

hierfstat should not be able to read genindobjects, and several functions in hierfstat can take as argument a genindobject (basic.stats, wc, genet.dist, ...). In addition, genind2hierfstatdoes the conversion, and can take haploid or diploid data, as well as alleles encoded with letters (e.g. adegenet::H3N2. Would love to have feedbacks to make sure that it works. @thibautjombart @thierrygosselin @smanel @zkamvar


Reply to this email directly or view it on GitHub.

from hierfstat.

zkamvar avatar zkamvar commented on June 2, 2024

We're on holiday stateside, but I will take a look at it within a few days. 👍

from hierfstat.

zkamvar avatar zkamvar commented on June 2, 2024

It looks good! I found a bug in genind2hierfstat, but I think I fixed that in #10.
I tried the functions on the microbov data set, which has three levels of hierarchy.

library(hierfstat)
library(adegenet)

# Data setup phase
data(microbov)
strata(microbov) <- data.frame(other(microbov))
nameStrata(microbov) <- ~Country/Breed/Species
# Pre-define the hierarchy
hier(microbov) <- ~Country/Species/Breed
microbov
## /// GENIND OBJECT /////////
## 
##  // 704 individuals; 30 loci; 373 alleles; size: 1.1 Mb
## 
##  // Basic content
##    @tab:  704 x 373 matrix of allele counts
##    @loc.n.all: number of alleles per locus (range: 5-22)
##    @loc.fac: locus factor for the 373 columns of @tab
##    @all.names: list of allele names for each locus
##    @ploidy: ploidy of each individual  (range: 2-2)
##    @type:  codom
##    @call: genind(tab = truenames(microbov)$tab, pop = truenames(microbov)$pop)
## 
##  // Optional content
##    @pop: population of each individual (group size range: 30-61)
##    @strata: a data frame with 3 columns ( Country, Breed, Species )
##    @hierarchy: ~Country/Species/Breed
##    @other: a list containing: coun  breed  spe 

varcomp.glob(hier(microbov), genind2hierfstat(microbov)[-1])
## $loc
##                  [,1]          [,2]       [,3]         [,4]      [,5]
## INRA63   0.1173000960  0.0647794947 0.06361455  0.011578832 0.5530086
## INRA5    0.0121845683  0.0129382874 0.01430052  0.035836874 0.5399129
## ETH225  -0.0124319038  0.0487034259 0.04915075  0.026408664 0.6905444
## ILSTS5   0.0135110583  0.0517138841 0.04905979  0.010274610 0.4508076
## HEL5     0.0483275536  0.0303297523 0.06652854  0.050456662 0.6415094
## HEL1     0.1078680667  0.1253425099 0.03559172  0.021497255 0.5974212
## INRA35  -0.0107774636  0.0084973992 0.03558309  0.171926340 0.2904624
## ETH152  -0.0605934179  0.1338601503 0.03685872  0.025607431 0.5860534
## INRA23   0.0868319088  0.0371286049 0.04130543  0.053629048 0.6848306
## ETH10    0.0811586568  0.0799362964 0.09105508  0.030915671 0.5771429
## HEL9     0.0516898466  0.0761886429 0.03582657  0.020243629 0.6603221
## CSSM66  -0.0043924213  0.0152441827 0.07744402  0.039109865 0.7054598
## INRA32   0.0186643213  0.1600901977 0.04441658  0.022135523 0.5953079
## ETH3     0.0549178630 -0.0013820157 0.04428838 -0.009695299 0.7052023
## BM2113   0.0278982606  0.0521433738 0.06104839 -0.000034360 0.7979943
## BM1824   0.0438056290  0.0754409120 0.05561409  0.007952213 0.6384505
## HEL13    0.1090026640  0.1559971309 0.04365766  0.013740498 0.4534884
## INRA37   0.0992965084  0.0450839942 0.05822925  0.014709458 0.6396527
## BM1818   0.0720595020  0.0306564336 0.03409718  0.022358255 0.6474074
## ILSTS6   0.1201655247  0.0003883814 0.05854446  0.043729015 0.6285714
## MM12    -0.0585414257  0.1401026439 0.03442348  0.032276208 0.6603499
## CSRM60  -0.0134639321  0.1179904177 0.05900233  0.007710427 0.6569343
## ETH185   0.1083381232  0.0034178206 0.06052818  0.068641233 0.5941807
## HAUT24   0.0495419679  0.0245594116 0.04369654  0.024183879 0.7381295
## HAUT27   0.0228908786  0.0083714775 0.03555060  0.018656962 0.6762178
## TGLA227 -0.0025323999  0.1066869908 0.04828694  0.023681402 0.7722063
## TGLA126  0.0072856375  0.0330671939 0.03467997  0.018801416 0.6174785
## TGLA122 -0.0002594815  0.0507386030 0.05187441  0.009971784 0.6891117
## TGLA53   0.0167521176  0.0257066907 0.05028980  0.140398489 0.6810730
## SPS115   0.0494256183 -0.0146722427 0.04373537  0.070696634 0.4392387
## 
## $overall
##   Country   Species     Breed       Ind     Error 
##  1.155924  1.699050  1.458282  1.027399 18.608471 
## 
## $F
##            Country    Species      Breed        Ind
## Total   0.04826581 0.11920995 0.18010079 0.22300000
## Country 0.00000000 0.07454197 0.13852080 0.18359558
## Species 0.00000000 0.00000000 0.06913207 0.11783745
## Breed   0.00000000 0.00000000 0.00000000 0.05232254

from hierfstat.

jgx65 avatar jgx65 commented on June 2, 2024

Great! Many thanks @zkamvar, looks cool!

from hierfstat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.