question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fst is one of the fundamental building blocks of population structure analysis. We will want to compute Fst between pairs of populations, with the “population” labels designated by some properties of the input dataset (see #224).

There are a number of different estimators for Fst (scikit-allel implements 3), so we should provide a method to specify the estimator for the statistic as a parameter. I suggest something like the following:

def Fst(ds, *, estimator=None, **kwargs):
    if estimator = None:
        estimator = "hudson"
    estimator_map = {
        "hudson": hudson_Fst,
        "weir_cockerham": wc_Fst,
        "patterson": patterson_Fst
    } 
    return estimator_map[estimator](ds, **kwargs)

These correspond to the three definitions in scikit-allele. We may not want all three initially, and just implementing the Hudson estimator may be sufficient. We can test our implementations by comparing with scikit-allele and tskit

(ps. I prefer to use None as the default value for estimator, as there may be situations in the future where we might prefer to have a different default depending on properties of the dataset. If we leave estimator="hudson" in the signature, then there’s no way to tell if the user just wants the default or has specifically asked for “hudson”. In general, unless we’re totally sure that the default is never going to change, I think it’s better to use None as the default value in the signature.)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
timothymillarcommented, Sep 3, 2020

I’d like to add the estimator described by Harris and DeGiorgio (2016) to the list at some point. Their estimator is based on Hudson’s but attempts to correct for related and inbred individuals using kinship.

0reactions
tomwhitecommented, Oct 15, 2020

Closing this, since we have Fst now, from #100 and #292

Read more comments on GitHub >

github_iconTop Results From Across the Web

Haskell : fst - ZVON.org
Function: fst. Type: (a,b) -> a. Description: returns the first item in a tuple. Related: snd. Example 1. Input: fst(1,2). Output: 1.
Read more >
Fst function - RDocumentation
a vector or factor giving the population assignment of each row of x , or a single numeric value specifying which column of...
Read more >
Function reference • fst - The fst package
Decompress a raw vector with compressed data. fst-package. Lightning Fast Serialization of Data Frames for R. fst().
Read more >
fst - Hoogle
Helper function for accessing the first field of a Pair. fst :: Consumable b => (a, b) % 1 -> a · linear-base...
Read more >
FST - Follistatin - Homo sapiens (Human) | UniProtKB | UniProt
Binds directly to activin and functions as an activin antagonist. Specific inhibitor of the biosynthesis and secretion of pituitary follicle stimulating ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found