GithubHelp home page GithubHelp logo

briandconnelly / growthcurve Goto Github PK

View Code? Open in Web Editor NEW
5.0 6.0 4.0 1.19 MB

๐Ÿ“ˆR package for analyzing biological growth

License: Other

R 100.00%
biology r curve-fitting tidy-data broom

growthcurve's Introduction

GitHub User's stars :name status badge PyPI brianc LinkedIn badge

๐Ÿš€ Currently Doing

  • Programming: R, Python
  • Data: Athena/Iceberg, Redshift, DuckDB, Clickhouse, Spark, Polars, Quarto, AWS
  • Tools: Git, Docker, Airflow, CI/CD (GitHub Actions, Jenkins, Codecov)

๐Ÿชฆ Been There

  • Programming: Java, C, C++, PHP, Perl, Matlab, Maple, Pascal, BASIC, ...
  • Data: MySQL, Oracle, InfluxDB, PostgreSQL, GCP
  • Tools: CVS, Subversion

growthcurve's People

Contributors

briandconnelly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

growthcurve's Issues

Error in eval(expr, envir, enclos) : object 'datafile' not found

function

fit_curve <- function(d) {
fit <- fit_growth_logistic(d, time, OD600)
if (is.na(fit$integral)) {
data.frame(MaxGrowth = NA,
MaxRate = NA,
LagLength = NA)
}
else{
data.frame(MaxGrowth = fit$max_growth[["Estimate"]],
MaxRate = fit$max_rate[["Estimate"]],
LagLength = fit$lag_length[["Estimate"]])
}
}

growth curve

growthfit <- Bcc1_12_names %>%
filter(!grepl("blank", annotation)) %>% #filter out the blank wells
arrange(annotation, well_alias) %>%
group_by(annotation, well_alias) %>% # Group the data by well and strain annotation
do(fit_curve(.)) # For each well, fit a growth curve

growthcurve_test.xlsx

Unable to fit and how to get growth parameters from fitting

Hi,

I have been testing your package recently and seems more handy that grofit it self. It seems I cannot find out how to get growth parameters such as mu and lambda when fit_growth function is called. Could you explain briefly how to extract growth parameters from fitting?

On the other hand, the data im fitting are OD's determined each 2h. I use corrected OD's where the blank has been subtracted so initial values are close to 0 like (0.001 or 0.01). The fitting fails when the corrected values are used. However, fit success when raw data is used (blank not subtracted) so initial values in first 4-6h are like 0.100. Same happens in grofit package. Could you explain why this is happening and if there's a way to mitigate this rather than using raw data which would be my last choice.

Thank you :)

Fix NSE

For example, if time is given as a column name, the time() function is called.

autoplot wont work on grofit_gompertz

Here an example: Method grofit_gompertz wont work with autofit.
Also: If colname of time column is not "time_data" the function wont run.

`library(ggplot2)
library(growthcurve)

testdat <- data.frame(c(24.00000,25.45455,26.90909,28.36364,29.81818,31.27273,32.72727
,34.18182,35.63636,37.09091,38.54545,40.00000,41.45455,42.90909
,44.36364,45.81818,47.27273,48.72727,50.18182,51.63636,53.09091
,54.54545,56.00000,57.45455,58.90909,60.36364,61.81818,63.27273
,64.72727,66.18182,67.63636,69.09091,70.54545,72.00000,73.45455
,74.90909,76.36364,77.81818,79.27273,80.72727,82.18182,83.63636
,85.09091,86.54545,88.00000,89.45455,90.90909,92.36364,93.81818
,95.27273,96.72727,98.18182,99.63636,101.09091,102.54545,104.00000
,105.45455,106.90909,108.36364,109.81818,111.27273,112.72727,114.18182
,115.63636,117.09091,118.54545,120.00000,121.45455,122.90909,124.36364
,125.81818,127.27273,128.72727,130.18182,131.63636,133.09091,134.54545
,136.00000,137.45455,138.90909,140.36364,141.81818,143.27273,144.72727
,146.18182,147.63636,149.09091,150.54545,152.00000,153.45455,154.90909
,156.36364,157.81818,159.27273,160.72727,162.18182,163.63636,165.09091
,166.54545,168.00000),

c(0.000000000,0.050269700,0.090107812,0.120330579,0.141754243
,0.155195048,0.161469238,0.161393055,0.155782743,0.145454545
,0.131224705,0.113909465,0.094325069,0.073287760,0.051613781
,0.030119376,0.009620787,-0.009082561,-0.025578095,-0.039840091
,-0.051859643,-0.061627849,-0.069135802,-0.074374600,-0.077335337
,-0.078009109,-0.076387011,-0.072460139,-0.066219588,-0.057656454
,-0.046761833,-0.033526820,-0.017942511,0.000000000,0.020662827
,0.045820927,0.077602471,0.118135626,0.169548562,0.233969447
,0.313526449,0.410347738,0.526561483,0.664295851,0.825679012
,1.012839135,1.227904388,1.473002940,1.750262960,2.061812617
,2.409780078,2.796293514,3.223481092,3.693470982,4.208391352
,4.770370370,5.381536207,6.044017030,6.759941008,7.531436310
,8.360631104,9.249653560,10.200631846,11.215694131,12.296968584
,13.446583373,14.666666667,15.959317200,17.326515971,18.770214542
,20.292364477,21.894917340,23.579824693,25.349038101,27.204509126
,29.148189331,31.182030281,33.307983539,35.528000668,37.844033231
,40.258032792,42.771950914,45.387739161,48.107349095,50.932732281
,53.865840282,56.908624661,60.063036981,63.331028807,66.714551700
,70.215557225,73.835996945,77.577822424,81.442985224,85.433436910
,89.551129044,93.798013190,98.176040911,102.687163771,107.333333333)
)

colnames(testdat) <- c("time_data", "value") # required to be named "time_data" else: error
myfit <- fit_growth(testdat, time=time_data, data=value, model = "grofit_gompertz")

autoplot(myfit, title = "test")

`

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.