Question: R Code only 2 variety plants ( VarX & VarY ) , each with 2 conditions ( stress and control ) var _ x _
R Code only
variety plants VarX & VarY each with conditions stress and control
varxall readcsvallVarXTwoTimePoints.csv
Header: genename,VarXCRepVarXRepVarXRep VarXCRepVarXRep VarXRep VarXRepVarXCRepVarXRepVarXRepVarXRep
varyall readcsvallVarYTwoTimePoints.csv
Each variety has differentially expressed genes DEGs
varxdegs readcsvLeafDEGsVarX.csv
Header: genename, logFoldChange, padj, AthalianagenenameID, GeneFunction, VarXCRep VarXCRep VarXCRep VarXRep VarXRep VarXRep
varydegs readcsvLeafDEGsVarY.csv
#INVESTIGATE THE DISTRIBUTION OF EXPRESSION VALUES FOR ALL GENES IN EACH SAMPLE Variety X
varxall.long pivotlongervarxall, colsVarXCRep:VarXRepnamesto "sample", valuesto "expression"
varxplot ggplotvarxall.long, aesx sample, y expression geomboxplot
DO SAME for VarY
#INVESTIGATE THE DISTRIBUTION OF EXPRESSION VALUES FOR THE DEGs IN EACH SAMPLE Variety X
varxdegs.long pivotlongervarxdegs,colsVarXCRep:VarXRepnamesto "sample", valuesto "expression"
varxdegsplot ggplotvarxdegs.long, aesx sample, y expression
geomboxplot
DO SAME for VarY
#HOW MANY DIFFERENTIALLY EXPRESSED GENES ARE THERE IN EACH VARIETY?
varxdup CODE HERE
varydup CODE HERE
#INVESTIGATE IF THE SAME OR DIFFERENT GENES ARE DIFFERENTIALLY EXPRESSED IN THE TWO VARIETIES. Create a suitable plot to look at the overlap in the DEGs between the two Varieties. CODE HERE
#SEPARATE OUT THE UP AND DOWN REGULATED DEGs BETWEEN STRESS AND CONTROL CONDITION
By looking at varxdegs and varydegs data frames, you can see that some genes have a positive log fold change and others have a negative log fold change. Create a data frame called varxdegs.up containing only genes that are upregulated in Stress Treatment compared to control in Variety X CODE HERE
Create a data frame called varxdegs.down containing only genes that are downregulated in Stress Treatment compared to control in Variety X
Same for VarY. CODE HERE
#INVESTIGATE THE FOLD CHANGE IN GENE EXPRESSION FOR THE DEGs, BETWEEN STRESS AND CONTROL CONDITION. Create a box plot to show the distribution of log fold change for all DEGs by variety. Hint: the base R boxplot command and the abs function could be helpful here.
Create a box plot to show the distribution of log fold change for upregulated DEGs by variety. Hint: the base R boxplot command could be helpful here.
Create a box plot to show the distribution of log fold change for downregulated DEGs by variety. Hint: the base R boxplot command could be helpful here.
#INVESTIGATE THE FUNCTIONS OF THE DIFFERENTIALLY EXPRESSED UPREGULATED GENES WITH THE LOWEST FOLD CHANGE Find out the function of the bottom most upregulated gene in Variety X lowest fold change and assign the result to variable called bottomgene.x
Find out the function of the bottom most upregulated gene in Variety Y lowest fold change and assign the result to variable called bottomgene.y
#INVESTIGATE THE BEHAVIOUR OF THE BIOLOGICAL REPLICATES FOR THE DEGs in Variety X IN THE TREATMENT TIME POINT. Create a set of scatterplots to visually inspect how well the different replicates agreecorrelate for the DEGs in Variety X in the treatment time point.
#INVESTIGATE THE BEHAVIOUR OF THE BIOLOGICAL REPLICATES FOR THE DEGs in Variety X IN THE CONTROL TIME POINT. Create a set of scatterplots to visually inspect how well the different replicates agreecorrelate for the DEGs in Variety X in the control time point.
#COMPARE THE MEAN EXPRESSION IN TREATMENT VERSUS CONTROL REPLICATES FOR EACH DEG. Modify your data frame varxdegs to include two new additional columns as follows: The first new column should be named controlmean and contain the mean expression value for the three control replicates.
The second new column should be named stressmean and contain the mean expression value for the three stress treatment replicates.
#PRIORITISE GENES OF INTEREST FOR FURTHER INVESTIGATION. Create a data frame called varydegs.upbig containing only genes in Variety y that are upregulated in Stress Treatment compared to control, have at least an fold absolute change in expression and have a p value less than eHint: remember you are dealing with log fold change.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
