This analysis examines microarray samples from two different breast cancer studies, and then compares the expression of differentiation between normal and malignant cells. All the samples used in this analysis were obtained from NCBI GO.
Out of the 10 microarray sample data, six (6) were obtained from the accession code “GSE19697” and the remaining four (4) which included the two samples used as control in this analysis from “GSE1045192”. A GSE19697_family.soft file was also obtained to collate probe and gene information from the study. ComBat, a function from the sva bioconductor package was used in the analysis of the two different study samples to eliminate experimental “noise” whilst still retaining all biologically relevant information.
After obtaining samples and and saving the .CEL files along with the .soft file into a working folder, analysis commenced.
For any more information, contact me on linked-in linkedin profile
setwd("C:/Users/ALFRED/Documents/Bioinformatics_with_R")
library(affy)
library(oligo)
library(limma)
library(tidyverse)
library(sva)
filename<- c("GSM1045191_Normal.CEL", "GSM1045192_Normal.CEL", "GSM1045274_Cancer.CEL", "GSM1045267_Cancer.CEL", "GSM1045234_Cancer.CEL",
"GSM491610.CEL", "GSM491611.CEL", "GSM491612.CEL", "GSM491613.CEL", "GSM491614.CEL")
sample<- c("GSE1045192", "GSE1045192","GSE1045192", "GSE1045192", "GSE1045192",
"GSE19697", "GSE19697", "GSE19697", "GSE19697", "GSE19697")
type<- c("CNT", "CNT", "cas", "cas", "cas", "cas", "cas", "cas", "cas", "cas")
metdata<- data.frame(filename, sample, type)
write.csv(metdata, file = "metdata.csv")
target<- readTargets("metdata.csv", sep = ",", row.names = "sample")
affyc<- ReadAffy()
hist(affyc)
eset<- affy::rma(affyc)
expres_eset<- exprs(eset)
write.exprs(eset, file = "Expressed_eset.txt")
hist(eset)
batch<- as.factor(target$sample)
condition<- as.factor(target$type)
mod<- model.matrix(~factor(condition))
corr_data<- ComBat(dat = expres_eset, batch = batch, mod = mod, par.prior = TRUE)
All description information in the .soft file was removed leaving behind the table with its relevant information.
reference<- read.delim("GSE19697_family.soft", check.names = FALSE)
ref<- data.frame(reference)
write.csv(expres_eset, "Expressed_eset.csv")
probe_info<- read.delim("Expressed_eset.csv", sep = ",", check.names = FALSE)
refer<- ref %>%
separate(Gene.Symbol,into = c("Gene.Symbol", "Gene_alt"), sep = "/") %>%
separate(ENTREZ_GENE_ID,into = c("ENTREZ_GENE_ID", "ENTREZ_alt"), sep = "/") %>%
select(ID, GB_ACC, Gene.Symbol, ENTREZ_GENE_ID)
annot<- left_join(probe_info, refer, by= 'ID', copy = TRUE)
write.csv(annot, "annotation.csv")
condition<- as.factor(target$type)
design<- model.matrix(~0+condition)
colnames(design)= levels(case)
Using “corr_data” instead of “eset” in running the analysis because a re-correction and normalization was done to properly combine the two datasets (“GSE1045192” & “GSE19697”).
fdr (false discovery rate) tightens the p-value %, allowing for lower false positives.
fit<- lmFit(corr_data, design = design)
fit<- eBayes(fit) # eBayes generates the statistical values of importance
options(digits = 2)
top<- topTable(fit, coef = 2, n= Inf, adjust='fdr')
data<- merge(top, annot, by.x= 0, by.y = "ID", all= TRUE)
# Going to select the order in-which I want the variable to appear
data<- data %>%
mutate(Gene_ID= data$Row.names) %>%
select(Gene_ID, Gene.Symbol, GB_ACC, ENTREZ_GENE_ID, logFC, AveExpr, t, P.Value, adj.P.Val, B, everything() )
write.table(data, file = "DGE_Cancer_Final.csv", row.names = TRUE, col.names = TRUE, sep = ",")