This is an R Markdown Notebook. When you execute code within the notebook, the results appear beneath the code.

Execute the chunk of codes by clicking the Run button (>) within the chunk or by placing your cursor inside it and pressing Ctrl+Shift+Enter.

Note: if you get error during knitting, delete the code that produced the error and run Knit again.

Set CRAN repository: Go to Tools –> Global Options –> Packages –> Package Management –> Primary CRAN repository –> USA (IA) –> OK. You can also use this code:

options(repos=c(CRAN="https://mirror.las.iastate.edu/CRAN/"))

C. Analysis of differential protein expression in RStudio.

24. Set the working directory

knitr::opts_knit$set(root.dir = "R:/Biology/BIOL-4129-5129/hickljaa/Lab13_LC-MS")
getwd()
## [1] "R:/Biology/BIOL-4129-5129/hickljaa/Lab13_LC-MS"

Load the packages needed to prepare and generate the markdown report using the library() function.

#### By default, R displays all possible output from a code chunk, including messages, warnings, and plots. The code message=FALSE prevents printing package loading messages to the output below the code chunk instead prints them to the console.

library(rmarkdown)
library(knitr)
library(yaml)

25. Check the packages BiocManager, limma, edgeR, vsn, pCaMethods, psych, gplots, and missMethods are installed. If not install them.

if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

library(BiocManager)

BiocManager::install(c("limma", "edgeR", "vsn", "pcaMethods"))
## 'getOption("repos")' replaces Bioconductor standard repositories, see
## 'help("repositories", package = "BiocManager")' for details.
## Replacement repositories:
##     CRAN: https://mirror.las.iastate.edu/CRAN/
## Bioconductor version 3.20 (BiocManager 1.30.25), R 4.4.2 (2024-10-31 ucrt)
## Warning: package(s) not installed when version(s) same as or greater than current; use
##   `force = TRUE` to re-install: 'limma' 'edgeR' 'vsn' 'pcaMethods'
## Installation paths not writeable, unable to update packages
##   path: C:/Program Files/R/R-4.4.2/library
##   packages:
##     cluster

26. Install CRAN packages psych, gplots, and missMethods.

install.packages(c("psych", "gplots", "missMethods"))
## Installing packages into 'C:/Users/hickljaa/AppData/Local/R/win-library/4.4'
## (as 'lib' is unspecified)
## package 'psych' successfully unpacked and MD5 sums checked
## package 'gplots' successfully unpacked and MD5 sums checked
## package 'missMethods' successfully unpacked and MD5 sums checked
## 
## The downloaded binary packages are in
##  C:\Users\hickljaa\AppData\Local\Temp\5\RtmpSQ4S9e\downloaded_packages

27. Load the packages using the “library” function. You can also install them from Packages list.

library("limma")
library("edgeR")
library("vsn")
## Loading required package: Biobase
## Loading required package: BiocGenerics
## 
## Attaching package: 'BiocGenerics'
## The following object is masked from 'package:limma':
## 
##     plotMA
## The following objects are masked from 'package:stats':
## 
##     IQR, mad, sd, var, xtabs
## The following objects are masked from 'package:base':
## 
##     anyDuplicated, aperm, append, as.data.frame, basename, cbind,
##     colnames, dirname, do.call, duplicated, eval, evalq, Filter, Find,
##     get, grep, grepl, intersect, is.unsorted, lapply, Map, mapply,
##     match, mget, order, paste, pmax, pmax.int, pmin, pmin.int,
##     Position, rank, rbind, Reduce, rownames, sapply, saveRDS, setdiff,
##     table, tapply, union, unique, unsplit, which.max, which.min
## Welcome to Bioconductor
## 
##     Vignettes contain introductory material; view with
##     'browseVignettes()'. To cite Bioconductor, see
##     'citation("Biobase")', and for packages 'citation("pkgname")'.
library("pcaMethods")
## 
## Attaching package: 'pcaMethods'
## The following object is masked from 'package:stats':
## 
##     loadings
library("psych")
## 
## Attaching package: 'psych'
## The following object is masked from 'package:pcaMethods':
## 
##     pca
library(gplots)
## 
## Attaching package: 'gplots'
## The following object is masked from 'package:stats':
## 
##     lowess
library(missMethods) 

Load the mass spectrometer data

28. Load the proteinGroups_filtered.txt data

proteinGroups <-read.table(file = "proteinGroups_Lab13.tabular", header = TRUE, row.names = 1, sep="\t")

29. Open the proteinGroups file and explore the data. The Majority protein IDs (second) column contains multiple proteins in most row. This is because the same peptide matches multiple proteins in the database, primarily because these proteins are isoforms.

View(proteinGroups)

– How many proteins/protein groups did you identify in this study? This number is displayed below the table.

30. Remove contaminating sequences (reversed sequences, potential contaminants, and proteins identified only by sites). These are indicated with a “+” in columns 70 - 72.

filtered_data = proteinGroups[!proteinGroups$Only.identified.by.site=="+",]  # the $ operator is used to subset (extract) a specific part of the data. Here we are pulling elements (rows) from the data when the  Only.identified.by.site column contains a +.
filtered_data = filtered_data[!filtered_data$Reverse=="+",] # Here we are pulling elements from the data when Reverse is +.Note that, ! is logical NOT operator in R.
filtered_data = filtered_data[!filtered_data$Potential.contaminant=="+",] # And here we are pulling elements from the data when the values for the Potential.contaminant column is +.

– How many proteins/protein groups does the filtered data contain?

31. Extract LFQ values

LFQ = filtered_data[,57:62]

32. Zeros cannot be log-transformed. We need to replace them with NA and save the file with the same name.

LFQ[LFQ==0] <- NA

33. Make barplots of the dataframe.

total<-(colSums(LFQ[,1:6],na.rm=TRUE)) # to find column totals using the colSums() function and na.rm to ignor missing values
barplot(t(as.matrix(total)),mar=c(5.1, 4.1, 4.1, 2.1)) # vertical barplot of column totals

34. Barplot of percent missing values

col_nas= colSums(is.na(LFQ)) # Total number of NAs per column in a data frame
col_total=colSums (LFQ, na.rm = T, dims = 1) # Column totals
col_percent = (col_nas * 100 )/(nrow(LFQ))# Percentage of missing values per column
barplot(t(as.matrix(col_percent)))

35. Return rows that have at least two non-NA values across all samples.

Filtered_LFQ=LFQ[rowSums(is.na(LFQ))<(length(LFQ)-1),]

37. Normalize the raw data using variance stabilization normalization (VSN) method.

Normalized <- justvsn(as.matrix(Filtered_LFQ))

38. Use the function meanSdPlot to verify variance stabilization as a plot of empirical standard deviation on the y-axis versus the rank of the average on the x-axis.

meanSdPlot(Normalized, ranks = TRUE)

- Describe the quality of the normalized data based on the meanSdPlot.

39. Distribution of the normalized data.

39a. Plot multiple histograms with density and normal fits on one page using the psyc package.

multi.hist(Normalized, dcol= c("blue","red"),dlty=c("dotted", "solid"), main="histograms with density plots of normalized data_Lab13_38a")

39b. Boxplot is another tool to visualize the distribution of normalized data.

boxplot(Normalized, main="Boxplot of normalized data_Lab13_38b", col=" light blue")

39c. Make MDS plot to visualize data clustering.

plotMDS(Normalized, main="MDS plot of normalized data_Lab13_38c")

- What is your assessment of the normalized data.

Impute missing values

40a. Use the lsaImpute function of the MissMethods package.

imputed<-impute_LS_adaptive(Normalized)

40b. Check the imputed samples are ordered correctly.

View(imputed)

40c. Visualize the distribution of each sample after imputation using histograms, boxplots, density plots (like a distribution histogram), and plotMDS.

multi.hist(imputed, dcol= c("blue","red"),dlty=c("dotted", "solid"), main="histograms with density plots of normalized and imputed data_Lab13_39b")

boxplot(imputed, main="Boxplot of normalized and imputed data_Lab13_39b", cex.main = 1, col="light blue") 

plotDensities(imputed,legend="topright",inset=c(-3, 0),names(samples), main="Density plots of normalized and imputed data_Lab13_39b") # The inset(x, y) argument can be used to control the location of the legend to the right of the plot. For example, we can make the x argument more negative to push the legend even further to the right and make y more positive to push it lower.
## Warning: In density.default(E[, a], n = npoint, na.rm = TRUE, ...) :
##  extra argument 'inset' will be disregarded
## Warning: In density.default(E[, a], n = npoint, na.rm = TRUE, ...) :
##  extra argument 'inset' will be disregarded
## Warning: In density.default(E[, a], n = npoint, na.rm = TRUE, ...) :
##  extra argument 'inset' will be disregarded
## Warning: In density.default(E[, a], n = npoint, na.rm = TRUE, ...) :
##  extra argument 'inset' will be disregarded
## Warning: In density.default(E[, a], n = npoint, na.rm = TRUE, ...) :
##  extra argument 'inset' will be disregarded
## Warning: In density.default(E[, a], n = npoint, na.rm = TRUE, ...) :
##  extra argument 'inset' will be disregarded

plotMDS(imputed, main="MDS plot of normalized and imputed data_Lab13_39b", cex.main = 1)

40d. Draw a heatmap of log values using the Coolmap function. The function calls heatmap.2 in the gplots package

coolmap(imputed, "Heatmap of normalized and imputed data_Lab13_39b", cluster.by="de pattern", col=NULL, linkage.row="complete", linkage.col="complete", show.dendrogram="both")

43. Define treatment groups and biological replicates.

If we do not tell R, it will use one of the factors as an intercept (baseline) for comparison based on their alphabetical order. We need to tell R to use the “healthy” tissue as the reference. One way to explicitly set the intercept is to customize the order of the factor levels using the “levels” argument with the factor() function and provide level names in the desired sequence.

Group <-factor(rep(c("healthy","psoriasis"), each=3)) # factor() converts the vector into a factor. rep(c("healthy","psoriasis"), each = 3) creates a vector by repeating the sequence ("healthy", "psoriasis") three times. The sequence is not dynamic — it's defined by you.

Group
## [1] healthy   healthy   healthy   psoriasis psoriasis psoriasis
## Levels: healthy psoriasis

44. By default, R will use the first factor in alphabetical order as the intercept (reference or baseline) for comparison. In our case, the “healthy” tissue will be used as the reference automatically and we donot need to remind R. If we want to use factor “B” to be the intercept and not factor “A”, we can use the function “factor” to do so. group<-factor(group, levels = c(“Normal”, “Tumor”)).

45. Create the design matrix.

Design <- model.matrix(~Group)  # Here we only have two groups and one possible comparison for differential expression of proteins. We can remove the intercept in the model.matrix by adding 0, i.e., (~0+group). This will allow specific pairwise comparisons without sacrificing one level as a reference. However, since we only have two levels, the result will be the same.

head(Design)        # shows the design matrix
##   (Intercept) Grouppsoriasis
## 1           1              0
## 2           1              0
## 3           1              0
## 4           1              1
## 5           1              1
## 6           1              1
colnames(Design)    # shows how the coefficients are defined
## [1] "(Intercept)"    "Grouppsoriasis"
Design      # lists the columns with their contrast coefficients.
##   (Intercept) Grouppsoriasis
## 1           1              0
## 2           1              0
## 3           1              0
## 4           1              1
## 5           1              1
## 6           1              1
## attr(,"assign")
## [1] 0 1
## attr(,"contrasts")
## attr(,"contrasts")$Group
## [1] "contr.treatment"

46. Fit a linear model followed by empirical Bayes statistics to measure differences in expression

fit <- lmFit(imputed,Design) 
efit <- eBayes(fit) 

47. List the top differentially expressed genes

topTable(efit) # Default is 20 genes/proteins.
## Removing intercept from test coefficients
##                                                                                                                                                                                                                                                                                   logFC
## P31151                                                                                                                                                                                                                                                                         5.739511
## P48594;H0Y5H9;C9JZ65                                                                                                                                                                                                                                                          10.473871
## A0A7I2V2P6;A0A3B3ISG5;P14735;A0A7I2V3E3;A0A7I2YQV5;A0A7I2V610;A0A7I2V4Q3;A0A7I2V2S1;A0A7I2V3K9;B3KSB8;P14735-2;A0A7I2YQS6;A0A7I2V612;A0A7I2V373;A0A7I2V4A4;A0A7I2V634                                                                                                          4.519826
## P15502-2;E7ENM0;E7EN65;P15502-4;P15502-1;P15502-9;E7ETP7;P15502;P15502-10;P15502-5;P15502-13;P15502-6;P15502-7;P15502-12;P15502-8;G3V0G6;G5E950;B3KRT8;E7EWS8;P15502-11;E7ENW7;E7EP82;E7EQH8                                                                                  -2.393218
## P12236                                                                                                                                                                                                                                                                         1.293670
## Q01469;I6L8B7;A8MUU1;REV__Q5QNW6-2;REV__Q16778;REV__Q99879;REV__Q99877;REV__Q93079;REV__Q8N257;REV__Q5QNW6;REV__U3KQK0;REV__P58876;REV__P57053;REV__P33778;REV__P23527;REV__P06899;REV__O60814;REV__Q99880;REV__P62807                                                         4.307138
## P43490;A0A7P0T9I9;A0A7P0T973;A0A7P0T931;A0A7P0T895;A0A7P0T8L3;A0A7P0TAS5;A0A7P0T862;A0A7P0T8D2;A0A0C4DFS8;A0A7P0TA73;A0A7P0TBB7;A0A7P0T941;A0A7P0Z466;B7Z8W6;A0A7P0Z4N0;A0A7P0T9F0;A0A7P0TB17;A0A7P0T8Z3;A0A7P0T8R4;A0A7P0TAI8;A0A7P0Z437;A0A7P0Z4L4;C9JG65;C9JF35;A0A7P0TAZ2  3.611664
## P42224;P42224-2;A0A669KB53;A0A669KBA4;A0A669KB56;A0A669KB68;A0A669KBI6;J3KPM9;A0A669KB52;A0A669KB75;E7EPD2;A0A669KB17;D2KFR9;E7ENM1;Q67C41;E9PH66;A0A669KBK4                                                                                                                   2.157990
## Q59GN2;P62891                                                                                                                                                                                                                                                                  1.498487
## A0A087WW43;Q06033-2;Q06033;E7ET33                                                                                                                                                                                                                                             -1.474476
##                                                                                                                                                                                                                                                                                AveExpr
## P31151                                                                                                                                                                                                                                                                        28.66029
## P48594;H0Y5H9;C9JZ65                                                                                                                                                                                                                                                          24.78164
## A0A7I2V2P6;A0A3B3ISG5;P14735;A0A7I2V3E3;A0A7I2YQV5;A0A7I2V610;A0A7I2V4Q3;A0A7I2V2S1;A0A7I2V3K9;B3KSB8;P14735-2;A0A7I2YQS6;A0A7I2V612;A0A7I2V373;A0A7I2V4A4;A0A7I2V634                                                                                                         25.75188
## P15502-2;E7ENM0;E7EN65;P15502-4;P15502-1;P15502-9;E7ETP7;P15502;P15502-10;P15502-5;P15502-13;P15502-6;P15502-7;P15502-12;P15502-8;G3V0G6;G5E950;B3KRT8;E7EWS8;P15502-11;E7ENW7;E7EP82;E7EQH8                                                                                  26.30979
## P12236                                                                                                                                                                                                                                                                        26.17132
## Q01469;I6L8B7;A8MUU1;REV__Q5QNW6-2;REV__Q16778;REV__Q99879;REV__Q99877;REV__Q93079;REV__Q8N257;REV__Q5QNW6;REV__U3KQK0;REV__P58876;REV__P57053;REV__P33778;REV__P23527;REV__P06899;REV__O60814;REV__Q99880;REV__P62807                                                        28.91527
## P43490;A0A7P0T9I9;A0A7P0T973;A0A7P0T931;A0A7P0T895;A0A7P0T8L3;A0A7P0TAS5;A0A7P0T862;A0A7P0T8D2;A0A0C4DFS8;A0A7P0TA73;A0A7P0TBB7;A0A7P0T941;A0A7P0Z466;B7Z8W6;A0A7P0Z4N0;A0A7P0T9F0;A0A7P0TB17;A0A7P0T8Z3;A0A7P0T8R4;A0A7P0TAI8;A0A7P0Z437;A0A7P0Z4L4;C9JG65;C9JF35;A0A7P0TAZ2 25.93944
## P42224;P42224-2;A0A669KB53;A0A669KBA4;A0A669KB56;A0A669KB68;A0A669KBI6;J3KPM9;A0A669KB52;A0A669KB75;E7EPD2;A0A669KB17;D2KFR9;E7ENM1;Q67C41;E9PH66;A0A669KBK4                                                                                                                  25.61798
## Q59GN2;P62891                                                                                                                                                                                                                                                                 27.50380
## A0A087WW43;Q06033-2;Q06033;E7ET33                                                                                                                                                                                                                                             24.98124
##                                                                                                                                                                                                                                                                                       t
## P31151                                                                                                                                                                                                                                                                        13.162589
## P48594;H0Y5H9;C9JZ65                                                                                                                                                                                                                                                          13.096477
## A0A7I2V2P6;A0A3B3ISG5;P14735;A0A7I2V3E3;A0A7I2YQV5;A0A7I2V610;A0A7I2V4Q3;A0A7I2V2S1;A0A7I2V3K9;B3KSB8;P14735-2;A0A7I2YQS6;A0A7I2V612;A0A7I2V373;A0A7I2V4A4;A0A7I2V634                                                                                                         11.001931
## P15502-2;E7ENM0;E7EN65;P15502-4;P15502-1;P15502-9;E7ETP7;P15502;P15502-10;P15502-5;P15502-13;P15502-6;P15502-7;P15502-12;P15502-8;G3V0G6;G5E950;B3KRT8;E7EWS8;P15502-11;E7ENW7;E7EP82;E7EQH8                                                                                  -9.635134
## P12236                                                                                                                                                                                                                                                                         9.487154
## Q01469;I6L8B7;A8MUU1;REV__Q5QNW6-2;REV__Q16778;REV__Q99879;REV__Q99877;REV__Q93079;REV__Q8N257;REV__Q5QNW6;REV__U3KQK0;REV__P58876;REV__P57053;REV__P33778;REV__P23527;REV__P06899;REV__O60814;REV__Q99880;REV__P62807                                                         9.413344
## P43490;A0A7P0T9I9;A0A7P0T973;A0A7P0T931;A0A7P0T895;A0A7P0T8L3;A0A7P0TAS5;A0A7P0T862;A0A7P0T8D2;A0A0C4DFS8;A0A7P0TA73;A0A7P0TBB7;A0A7P0T941;A0A7P0Z466;B7Z8W6;A0A7P0Z4N0;A0A7P0T9F0;A0A7P0TB17;A0A7P0T8Z3;A0A7P0T8R4;A0A7P0TAI8;A0A7P0Z437;A0A7P0Z4L4;C9JG65;C9JF35;A0A7P0TAZ2  8.889131
## P42224;P42224-2;A0A669KB53;A0A669KBA4;A0A669KB56;A0A669KB68;A0A669KBI6;J3KPM9;A0A669KB52;A0A669KB75;E7EPD2;A0A669KB17;D2KFR9;E7ENM1;Q67C41;E9PH66;A0A669KBK4                                                                                                                   8.593248
## Q59GN2;P62891                                                                                                                                                                                                                                                                  8.564618
## A0A087WW43;Q06033-2;Q06033;E7ET33                                                                                                                                                                                                                                             -8.381633
##                                                                                                                                                                                                                                                                                    P.Value
## P31151                                                                                                                                                                                                                                                                        7.223586e-06
## P48594;H0Y5H9;C9JZ65                                                                                                                                                                                                                                                          7.452247e-06
## A0A7I2V2P6;A0A3B3ISG5;P14735;A0A7I2V3E3;A0A7I2YQV5;A0A7I2V610;A0A7I2V4Q3;A0A7I2V2S1;A0A7I2V3K9;B3KSB8;P14735-2;A0A7I2YQS6;A0A7I2V612;A0A7I2V373;A0A7I2V4A4;A0A7I2V634                                                                                                         2.176491e-05
## P15502-2;E7ENM0;E7EN65;P15502-4;P15502-1;P15502-9;E7ETP7;P15502;P15502-10;P15502-5;P15502-13;P15502-6;P15502-7;P15502-12;P15502-8;G3V0G6;G5E950;B3KRT8;E7EWS8;P15502-11;E7ENW7;E7EP82;E7EQH8                                                                                  4.868633e-05
## P12236                                                                                                                                                                                                                                                                        5.344239e-05
## Q01469;I6L8B7;A8MUU1;REV__Q5QNW6-2;REV__Q16778;REV__Q99879;REV__Q99877;REV__Q93079;REV__Q8N257;REV__Q5QNW6;REV__U3KQK0;REV__P58876;REV__P57053;REV__P33778;REV__P23527;REV__P06899;REV__O60814;REV__Q99880;REV__P62807                                                        5.601252e-05
## P43490;A0A7P0T9I9;A0A7P0T973;A0A7P0T931;A0A7P0T895;A0A7P0T8L3;A0A7P0TAS5;A0A7P0T862;A0A7P0T8D2;A0A0C4DFS8;A0A7P0TA73;A0A7P0TBB7;A0A7P0T941;A0A7P0Z466;B7Z8W6;A0A7P0Z4N0;A0A7P0T9F0;A0A7P0TB17;A0A7P0T8Z3;A0A7P0T8R4;A0A7P0TAI8;A0A7P0Z437;A0A7P0Z4L4;C9JG65;C9JF35;A0A7P0TAZ2 7.894926e-05
## P42224;P42224-2;A0A669KB53;A0A669KBA4;A0A669KB56;A0A669KB68;A0A669KBI6;J3KPM9;A0A669KB52;A0A669KB75;E7EPD2;A0A669KB17;D2KFR9;E7ENM1;Q67C41;E9PH66;A0A669KBK4                                                                                                                  9.658239e-05
## Q59GN2;P62891                                                                                                                                                                                                                                                                 9.851602e-05
## A0A087WW43;Q06033-2;Q06033;E7ET33                                                                                                                                                                                                                                             1.119747e-04
##                                                                                                                                                                                                                                                                                 adj.P.Val
## P31151                                                                                                                                                                                                                                                                        0.006207722
## P48594;H0Y5H9;C9JZ65                                                                                                                                                                                                                                                          0.006207722
## A0A7I2V2P6;A0A3B3ISG5;P14735;A0A7I2V3E3;A0A7I2YQV5;A0A7I2V610;A0A7I2V4Q3;A0A7I2V2S1;A0A7I2V3K9;B3KSB8;P14735-2;A0A7I2YQS6;A0A7I2V612;A0A7I2V373;A0A7I2V4A4;A0A7I2V634                                                                                                         0.012086778
## P15502-2;E7ENM0;E7EN65;P15502-4;P15502-1;P15502-9;E7ETP7;P15502;P15502-10;P15502-5;P15502-13;P15502-6;P15502-7;P15502-12;P15502-8;G3V0G6;G5E950;B3KRT8;E7EWS8;P15502-11;E7ENW7;E7EP82;E7EQH8                                                                                  0.015552811
## P12236                                                                                                                                                                                                                                                                        0.015552811
## Q01469;I6L8B7;A8MUU1;REV__Q5QNW6-2;REV__Q16778;REV__Q99879;REV__Q99877;REV__Q93079;REV__Q8N257;REV__Q5QNW6;REV__U3KQK0;REV__P58876;REV__P57053;REV__P33778;REV__P23527;REV__P06899;REV__O60814;REV__Q99880;REV__P62807                                                        0.015552811
## P43490;A0A7P0T9I9;A0A7P0T973;A0A7P0T931;A0A7P0T895;A0A7P0T8L3;A0A7P0TAS5;A0A7P0T862;A0A7P0T8D2;A0A0C4DFS8;A0A7P0TA73;A0A7P0TBB7;A0A7P0T941;A0A7P0Z466;B7Z8W6;A0A7P0Z4N0;A0A7P0T9F0;A0A7P0TB17;A0A7P0T8Z3;A0A7P0T8R4;A0A7P0TAI8;A0A7P0Z437;A0A7P0Z4L4;C9JG65;C9JF35;A0A7P0TAZ2 0.017637780
## P42224;P42224-2;A0A669KB53;A0A669KBA4;A0A669KB56;A0A669KB68;A0A669KBI6;J3KPM9;A0A669KB52;A0A669KB75;E7EPD2;A0A669KB17;D2KFR9;E7ENM1;Q67C41;E9PH66;A0A669KBK4                                                                                                                  0.017637780
## Q59GN2;P62891                                                                                                                                                                                                                                                                 0.017637780
## A0A087WW43;Q06033-2;Q06033;E7ET33                                                                                                                                                                                                                                             0.017637780
##                                                                                                                                                                                                                                                                                      B
## P31151                                                                                                                                                                                                                                                                        4.404941
## P48594;H0Y5H9;C9JZ65                                                                                                                                                                                                                                                          4.379322
## A0A7I2V2P6;A0A3B3ISG5;P14735;A0A7I2V3E3;A0A7I2YQV5;A0A7I2V610;A0A7I2V4Q3;A0A7I2V2S1;A0A7I2V3K9;B3KSB8;P14735-2;A0A7I2YQS6;A0A7I2V612;A0A7I2V373;A0A7I2V4A4;A0A7I2V634                                                                                                         3.457962
## P15502-2;E7ENM0;E7EN65;P15502-4;P15502-1;P15502-9;E7ETP7;P15502;P15502-10;P15502-5;P15502-13;P15502-6;P15502-7;P15502-12;P15502-8;G3V0G6;G5E950;B3KRT8;E7EWS8;P15502-11;E7ENW7;E7EP82;E7EQH8                                                                                  2.719796
## P12236                                                                                                                                                                                                                                                                        2.632107
## Q01469;I6L8B7;A8MUU1;REV__Q5QNW6-2;REV__Q16778;REV__Q99879;REV__Q99877;REV__Q93079;REV__Q8N257;REV__Q5QNW6;REV__U3KQK0;REV__P58876;REV__P57053;REV__P33778;REV__P23527;REV__P06899;REV__O60814;REV__Q99880;REV__P62807                                                        2.587752
## P43490;A0A7P0T9I9;A0A7P0T973;A0A7P0T931;A0A7P0T895;A0A7P0T8L3;A0A7P0TAS5;A0A7P0T862;A0A7P0T8D2;A0A0C4DFS8;A0A7P0TA73;A0A7P0TBB7;A0A7P0T941;A0A7P0Z466;B7Z8W6;A0A7P0Z4N0;A0A7P0T9F0;A0A7P0TB17;A0A7P0T8Z3;A0A7P0T8R4;A0A7P0TAI8;A0A7P0Z437;A0A7P0Z4L4;C9JG65;C9JF35;A0A7P0TAZ2 2.260448
## P42224;P42224-2;A0A669KB53;A0A669KBA4;A0A669KB56;A0A669KB68;A0A669KBI6;J3KPM9;A0A669KB52;A0A669KB75;E7EPD2;A0A669KB17;D2KFR9;E7ENM1;Q67C41;E9PH66;A0A669KBK4                                                                                                                  2.065715
## Q59GN2;P62891                                                                                                                                                                                                                                                                 2.046471
## A0A087WW43;Q06033-2;Q06033;E7ET33                                                                                                                                                                                                                                             1.921763

48. Look at the outcome of each hypothesis test in the fit object as +1 (up-regulated), 0 (no change), or -1 (down-regulated) using the decideTests function.

DE_proteins <- decideTests(efit, n=Inf) # method="separate" and adjust.method = "BH"' are default

49. Summarize the number of up/down DE proteins.

summary(DE_proteins)    # lists the number of up-/down-regulated proteins in psoriasis compared to healthy skin.
##        (Intercept) Grouppsoriasis
## Down             0             96
## NotSig           0           1491
## Up            1666             79

- Number of proteins up-regulated in psoriasis skin.

- Number of proteins down-regulated in psoriasis skin.

50. Open DE_proteins.

View (DE_proteins)

- List the top 5 up-regulated proteins in the tumor sample (FDR 0.05 and 1.5-fold change).

- Describe the functions of these up-regulated genes. Use the NCBI nucleotide database (https://www.ncbi.nlm.nih.gov/) to get this information. Select Nucleotide from the pulldown menu next to the search box.

51. Challenge questions: perform functional analysis of up-regulated proteins.

51a. Perform functional analysis of proteins up-regulated in psoriatic skin using g:Profiler and STRING (refer to Lab 11).

51b. Save the g:Profiler and STRING outputs as Lab13_50b_gprofiler.png and Lab13_50b_string.png.

51c. create the following R code chunks to add the gProfiler and STRING images to the R markdown document.

51d. What are the major GO categories you identified?

51e. How many network clusters did you identify from STRING analysis?

51f. Describe the function of the top five proteins up-regulated in psoriatic skin.

52. Compile a report using Knit. Click Knit above the Editor window. The knit function takes an input file, extracts the R code, evaluates the code, writes the compiled document into an output file depending on the format you requested earlier, and returns the path of the output file.

- You can achieve the same thing by rendering the R Markdown document (.Rmd) to the specified output format using the function package.render(“file_name”).

- If for some reason you get error during knitting, delete the code that produces the error and run Knit.

53. When you are done, click on the wheel next to Knit –> Clear all output.

54. Close the .Rmd document in the Editor window. Clear objects in the Console and Environment (use the brush icon). Then, type quit() at the Console to close R.

55. Upload the report to the Labs folder in Blackboard for grading.