Giter Site home page Giter Site logo

Support for non-binary traits about scoary HOT 9 OPEN

MrTomRod avatar MrTomRod commented on July 28, 2024
Support for non-binary traits

from scoary.

Comments (9)

MrTomRod avatar MrTomRod commented on July 28, 2024 2

You want to run Scoary on continuous traits?

I'm working on an update for Scoary, but it's not ready yet. Approximately another month until testing makes sense.

I will use GaussianMixture for splitting.

You could simply pre-process your continuous traits with GaussianMixture yourself and then feed them into Scoary.

from scoary.

AdmiralenOla avatar AdmiralenOla commented on July 28, 2024

Dear @MrTomRod

Yes, I've been wanting to add that feature for five years now. I'm not sure about the best way to implement it though, since much of the Scoary functionality is so intimately tied to having binary categories. Some of the approaches I've given some thought:

  • Breaking continous traits up into quantiles and treating these as binary, then using permutations to get "null distribution" test estimators.
  • Phylogenetic GLS. (A bit hard to harmonize with the Scoary approach since it would likely involve some kind of dimensionality reduction algorithm for the tree structure and an explicit evolutionary model.)
  • Replicated simulations of the continous phenotype on the input tree with no respect to the genotype, again to create a null distribution to compare towards. Maybe this would also require an explicit evolutionary model. My impression is that an Ornstein-Uhlenbeck process would be the best alternative, although there might be better alternatives I'm not up to speed with.

As you've noticed Scoary is not exactly in very active development at the moment due to other pressing obligations, but I maintain the ambition to continue development on it. I will happily accept PRs or spin-offs as long as you credit the original work. Thanks for offering!

All the best,
Ola

from scoary.

MrTomRod avatar MrTomRod commented on July 28, 2024

I have been using GaussionMixture to split by a continuous trait. This is a histogram of an example trait:

image

  • Blue is group 1
  • Green is group 2
  • Grey are those where the classifier was less than 85 % confident about which group the strain belongs to.

(has / has_not indicate whether a strain has the highest-scoring orthogene. Sorry for not plotting the estimated Gaussian distributions.)

My approach is simple and straightforward, but maybe not too powerful. I need something to quickly work on thousands of continuous traits.

I'm not sure if I fully understand your suggestions, will have to think about that some more. Would you be willing to discuss this sometimes or perhaps even support me a little if I decided to do this?

Btw, I've been using Boschloo's test instead of Fisher's, since it is perfectly matches the problem and is more powerful. It is slower, though. Not sure if it's worth it.

from scoary.

AdmiralenOla avatar AdmiralenOla commented on July 28, 2024

That looks promising! And thanks for teaching me about Boschloo's test.

Absolutely willing to work with you on this in the time I can contribute. You can get in contact with me at any time through my e-mail: [email protected].

from scoary.

MrTomRod avatar MrTomRod commented on July 28, 2024

I wanted to compare Fisher's vs Boschloo's test. To do this, I simulated 10 pangenomes for each combination of sample size: [25, 50, 75, 100, 150, 200] and penetrance: [90, 75]. (As in the paper.) While the p-values from Boschloo's test are uniformly higher, the sensitivity decreased! These are the results:

fisher-boschloo-fig1

Each dot represents the results from one simulated pangenome. The x-axis is the rank of the 'causal' gene in the final table computed using Fisher's minus the rank computed using Boschloo's. In other words, if the resulting value is negative, Fisher's performed better, and if it is positive, Boschloo's performed better.

I performed a Wilcoxon signed-rank test to see if Fisher and Boschloo perform differently: pvalue=0.057.

While Boschloo's test (imo justifiedly) gives a lower p-value, Fisher's seems to perform better at ranking genes with the simulated data. I have no clue why that is, though.

from scoary.

MrTomRod avatar MrTomRod commented on July 28, 2024

Updated plot with improved ranking, based on pvalue instead of position in table. Didn't change the result.

fisher-boschloo-fig1

pvalue=0.0024

from scoary.

MrTomRod avatar MrTomRod commented on July 28, 2024

I performed the same analysis with my fast-fisher library. It is now incredibly fast.

The causal gene always got the same rank as with scipy's implementation, except for two simulated datasets: in one, the rank was one higher, in the other, it was one lower.

image

from scoary.

TseWue avatar TseWue commented on July 28, 2024

Heya,
Any chance this feature will come soon? I'ts exactly what I have been looking for and would perfectly fit into my workflow. I'm also happy to test.

Best wishes,
Tse

from scoary.

bloomarun avatar bloomarun commented on July 28, 2024

I think @MrTomRod did the necessary updates and put it as Scoary-2. Kindly check his GitHub repo

from scoary.

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.