Posts

Showing posts with the label R

How to draw a growth curve in R

Image
In a growth curve of a bacteria, we will have the optical density measurements against time. For each time point, we will have a few technical replicates. Let’s take the following data which has time, and replicates A, B, and C. We have saved this table in a excel file. The file is named as growth_curve.xlsx and is stored in a folder/directory called datasets , relative to my current working directory. First thing we would do is load the tidyverse library, which will have the ggplot2 library we will use for plotting the growth curve. library(tidyverse) We will first read the data from excel into tibble and see how it looks like. data <- readxl::read_excel('datasets/growth_curve.xlsx') data Then, we will see the whole code to process and plot the data and later explain it step by step. # calculate mean and standard deviations data <- data %>% rowwise() %>% mutate( means = mean(c(A, B, C)), stdev = sd(c(A, B, C)) ) # plot the means and standar...

Principal Coordinate Analysis (PCoA) in R

Image
Here we will see how we can perform a principal coordinate analysis (PCoA) in R. I have used a microbiome data from a gut microbiome study. This is just to demonstrate the workflow of how to perform the PCoA. This is not an attempt to do any meaningful scientific analysis as it requires sufficient expertise in the field of microbiome research.

Principal Coordinate analysis in R and python

Image
 Principal Coordinate Analysis (PCoA) is used in microbiome research for summarizing the compositional differences in the microbial community between samples. In the few papers I read, the analysis was done in R. I found one paper which had used python for doing PCoA. Here I tried to compare, how PCoA works on both platforms. I wanted to test if I can keep on working in Python which I am comfortable with or will I need to get comfortable with R for microbiome analysis.