mmoskon / cosinorpy Goto Github PK
View Code? Open in Web Editor NEWCosinor based rhythmometry in Python.
License: MIT License
Cosinor based rhythmometry in Python.
License: MIT License
Maybe consider using os.path.join() instead of using '\' to specify save folder path so that it works in different operating systems.
My understanding is that rhythm parameters are estimated from the beta parameters of a fitted model (by linear regression). It seems you are not doing that evaluate_rhythm_parameters() which is used by fit_me(). Can you please explain?
Dear developer,
thank you for sharing this nice package. I did not quite understand the results of pair comparison, I would appreciate if you could give me some explanation.
test | period | p | q | amplitude1 | p(amplitude1) | q(amplitude1) | amplitude2 | p(amplitude2) | q(amplitude2) | d_amplitude | p(d_amplitude) | q(d_amplitude) | CI(d_amplitde) | acrophase1 | p(acrophase1) | q(acrophase1) | acrophase2 | p(acrophase2) | q(acrophase2) | d_acrophase | p(d_acrophase) | q(d_acrophase) | CI(d_acrophase) | CI(d_amplitude)
test1 vs. test2 | 24 | 0.12367885 | 0.12367885 | 662.745923 | 0.02351554 | 0.03527331 | 549.744331 | 0.06027629 | 0.06027629 | -113.00159 | 0.78479564 | 0.78479564 | | 1.85509574 | 2.65E-05 | 2.65E-05 | 3.1400276 | 3.65E-09 | 3.65E-09 | 1.28493186 | 0.06316099 | 0.12632199 | [-0.07049865 2.64036237] | [-924.0725584 698.06937272
I would like to know what are p and q? Is that the significance of the model or the comparison? If q is larger than 0.05 but p is smaller than 0.05, can I still conclude the difference is significant?
I would like to know what are p and q here? Are there also p(d_acrophase) and p(d_amplitude) from this function?
Thank you very much,
Fan
Thanks for working on this package. I am slightly confused on the usage of the package, as it seems that the test
column is required, but I could not find a documentation of its purpose. It looks like it is just for grouping of multiple datasets (but again, I am not sure if I got it correctly). If this is indeed the case, would it be better to make it optional? Thank you for your time.
Hi,
Really useful package, amazing work, always glad to see others (also) filling research gaps with open-acess code! 💪🏼
As some parts of the documentations were rather ambiguous (I am not that acquainted with cosinor based analysis), I delved in to the code, because after all, the truth lies in the code.
There I remarked that you would often (in over 20 locations) use the df.test.str.startswith
mask
CosinorPy/CosinorPy/cosinor.py
Line 943 in 70dcdfd
However, I think this might possibly introduce unwanted behavior:
e.g.:
Suppose I have two test
variables; gene_a
& gene_a_CRISPR
. The second variable has the same start as the first one, so the startswith
mask ; applied on the first variable will also yield true for gene_a_CRISPR
.
Please do correct me if I'm wrong,
Kind regards,
Jonas
How can we add covariates while doing a population fit?
I can see cosinor.fit_group() calls cosinor.fit_me() that allows to specify different model types such as possion and NB. If I want to use cosinor.compare_pairs() how can I specify a specific model type?
Sharing one example use case to give more context. For example, there is a measurement y of a subject that is count by nature and is assumed to follow Poisson distribution thereby requiring to use a model with log link and Possion distribution. If I want to test if there is difference in cosinor parameters in weekday vs weekend, how can I achieve this?
It seems that many wrapper functions are blind to the arguments of the functions they call. So, please consider using *args and **kwargs.
https://realpython.com/python-kwargs-and-args/
For example, cosinor.fit_group() calls cosinor.fit_me() but is yet blind to multiple useful arguments of cosigner.fit_me() such as model_type.
I am using cosinor1.fit_group and cosinor1.fit_cosinor to model timeseries relative abundance data. From my experience the amplitude and intercept values returned fit the data very well but the acrophase and phase of the graph does not align with what is expected from the data. I have attached an image of my code and data with the cosinor modeled function overlaid upon it as an example. The function takes the form y = acos(pi/12x-b)+c where b = (Acrophase value)*pi/12. What could be the reason for the discrepancy?
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.