Gel electrophoresis is commonly used to quantify the size or quantity of DNA in
ID: 3678196 • Letter: G
Question
Gel electrophoresis is commonly used to quantify the size or quantity of DNA in a sample. The DNA is "run" alongside a "ladder" through a porous gel that separates it by size. A voltage is applied across the gel, and DNA (which is negatively charged) travels from the negative toward the positive end of the gel. More information is available here: Write an R script to do the following: Read in the image, and then plot the image in color Convert the image, img, into a gray scale matrix (1 channel) This can be done by averaging the channels or selecting only the red Plot the single-channel image in pseudo-colors using terrain colors Locate the 2 edges (left and right side) of each sample by clicking on the plot Background subtract the mean row brightness from each row of img Base the background on the region between the ladder and lane #1 Add vertical lines to the plot at the edge of all 4 sample lanes and the ladder Subset the part of img containing the ladder and calculate an average profile Find the vertical-position of all 11 bands in the ladder (manually is fine here) Compare the max intensity of the band at 500 to the band at 400 According to the ladder manufacturer, the 500 band is 3 times as much DNA (bright) as the band at 400 Estimate the size of the top (longest DNA) band in lane #3, based on its peak position relative to the ladderExplanation / Answer
STEPS THROUGH WHICH YOU CAN START
1)setwd("E:/")
img <- readJPEG("abc.jpg", native = TRUE)
if(exists("rasterImage")){
plot(1:2, type='n')
rasterImage(img,1,1,2,2)
}
2)
bar<- img[,1]+img[,2]+img[,3]
bar <- bar/max(bar)
plot(c(0,1),c(0,1),t='n')
rasterImage(bar, 0,0,1,1)
//Can also be done in following manner
OR
3)
grayimg <- readJPEG("gi.jpg", native = TRUE)
x <- 10*(1:nrow(grayimg))
y <- 10*(1:ncol(grayimg))
image(x, y, grayimg, col = terrain.colors(100), axes = FALSE)
contour(x, y, grayimg, levels = seq(90, 200, by = 5),
add = TRUE, col = "peru")
axis(1, at = seq(100, 800, by = 100))
axis(2, at = seq(100, 600, by = 100))
box()
title(main = "Gel electrophoresis", font.main = 4)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.