-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maybe useful functions from syncomR #7
Comments
Whoever is the fastest, could try and make a PR out of the relevant ones. @microsud you are the best expert with these, if it is possible to make for instance one issue (and subsequent PR) per relevant functionality, including the details, that might help to keep things organized. |
@microsud Thank you so much! I have found some functionalities that can be used for |
@microsud could you propose one or two functions to start with (but no visualization functions at this stage)? We could have a closer look on how to add those to miaTime. |
Yes. we can start with https://github.com/microsud/syncomR/blob/master/R/short_term_change.R without the plotting step. This function essentially calculates the change in abundance over time for a microbe by |
You can try installing these before installing syncomR
I think converting the test data in |
Very good for the demo data. Perhaps a separate issue could be opened about that one? The abundance2/abundance1 thing: how about calculating this for all taxa at once? Implementation-wise it might be almost easier than doing it for a single taxa. |
The function returns it for all taxa at once. Improvements to speed and code can be made for speed and efficiency. |
TSE data added to |
The functions still to be added, if I collect correctly from the thread above. @YagmurSimsekk do you have any additional comments regarding the new functions if you had a look already? |
Yup the function is not added. Once I have the codes ready, will create a new PR. |
Great, there seemed to be potentially multiple relevant functions. Let us keep in mind! We can keep this open until that new PR. |
SyncomR has three options. Compared to starting Composition i.e. divergence, compared to each consecutive time point i.e. succession and compared to last sample i.e. convergence. |
@Daenarys8 you could see if some of the syncomR functions could be translated to miaTime or miaViz |
@Daenarys8 if you work on short_term_change, I have the following suggestions: We would probably like to have both x-y and x/y differences available for time series. Both might be needed. These are also sufficient. The logarithmic versions could be derived from them and in normally expected use cases one will not do log(x)/log(y), we only need x-y, x/y ,log(x)-log(y). However, x/y = exp(log(x/y)) = exp(log(x) - log(y)). This can be calculated for logarithmized data with the "-" operation: shortTermChange(tse, assay.type="counts") -> x-y So perhaps we could start by just having this function with the "-" operation because everything else that is usually needed can be derived from it? First, try to check if such functionality is already available in some R package, there are really many R packages for time series and we would like to avoid overlapping work. I think there are R functions for calculating step-wise differences for univariate time series. Those could be used. The planned functionality is univariate, but very closely related to the multivariate functions getStepwiseDivergence() and getBaselineDivergence() in miaTime. In what data element you were planning to store the output from this function? colData, altExp, assay..? |
I created some functions to analyse in-vitro synthetic communities.
https://github.com/microsud/syncomR.
These include some functions for longitudinal data analysis and visualization.
Codes (not the best skills here) and data are tailored and bundled as R pkg for my manuscript (under review).
Some of these functions may be expanded to
miaTime
.The text was updated successfully, but these errors were encountered: