Question: PROVIDE R CODE: data file ( assess _ data _ resit - 0 8 2 4 . Rdata ) , contains the following objects: -

PROVIDE R CODE:
data file (assess_data_resit-0824.Rdata),contains the following objects:
-Y: gene expression matrix with4,568genes (along the rows)and30samples (along the columns)from 15tumour-normal tissue pairs.
-patient_data: Matrix with metadata for each patient.
Perform the following steps R Code:
-Transform the gene expression data using the formulaLog2(Y+1)and take the transpose.
-Check if there are any problematic samples by calculating simple statistics on the data or/and performing principal component analysis. Provide a plot to support your answer and explain why they are problematics.
-Using the remaining sample pairs, we will perform a regression-based differential expression analysis. We will use theglmfunction from theMASSpackage to perform the regression
-perform a negative bionomial regression analysis to identify genes differentially expressed between normal and tumour samples including the tissue variable indicating if it is tumour or normal sample. Plot theappropriate log10p-value from your analysis
-Compare the p-values with and without inclusion of the tissue type and library size as a covariate, what do you observe? Which of the covariate has the biggest effect? Explain your answer with supporting plots, tables and further analysis if required. Plot the gene expression of the gene with the smallest p-value across all samples. Is the gene-expression higher in the tumour or normal samples for this gene
incorporate the following code into it or Edit:
library(tidyverse)library(MASS)
load("./data/assess_data_0824-resit.Rdata")
idx <-20
c_cl <-10:30
boxplot(log2(Y[,c_cl]+1))
x <-patient_data$tissue[c_cl]
z <-patient_data$patient[c_cl]
tmp <-data.frame(y =Y[idx,c_cl],x =x,z =z,lib_size =colSums(Y[,c_cl]))
out <-glm(y ~ x +z +lib_size, data =tmp,family ="poisson")
p_val <-summary(out)$coefficients[2,4]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!