load library

setwd("D:\\R.data\\Ascites")
library(data.table)
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:data.table':
## 
##     between, first, last
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(GEOquery)
## Loading required package: Biobase
## Loading required package: BiocGenerics
## 
## Attaching package: 'BiocGenerics'
## The following objects are masked from 'package:dplyr':
## 
##     combine, intersect, setdiff, union
## 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, setdiff, sort,
##     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")'.
## Setting options('download.file.method.GEOquery'='auto')
## Setting options('GEOquery.inmemory.gpl'=FALSE)
library(ggplot2)
library(ggrepel)
library(limma)
## 
## Attaching package: 'limma'
## The following object is masked from 'package:BiocGenerics':
## 
##     plotMA
library(pheatmap)

input and modify data

gse<-getGEO("GSE209964")
## Found 1 file(s)
## GSE209964_series_matrix.txt.gz
gse<-gse[[1]]
sampleInfo<-pData(gse)
sampleInfo<-select(sampleInfo,characteristics_ch1.2)
colnames(sampleInfo)<-"group"

input gene list data

data<-fread("genelist_analysi.txt")
my_genes<-fread("genelist.txt")
features<-select(data,"Symbol")
colnames(features)<-"Gene_symbol"
symbol<-select(data,Symbol)
data<-data[,-"Symbol"]
data2<-t(data)
colnames(data2)<-symbol$Symbol

normalize

data2_normalize<-normalizeQuantiles(data2)

Correlation Matrix

corMatrix<-cor(data,use="c")
pheatmap(corMatrix,annotation_col = sampleInfo, show_colnames = FALSE, show_rownames = FALSE)

Pricipal component analysis

pca<-prcomp(data2_normalize)
cbind(sampleInfo, pca$x) %>% ggplot(aes(x=PC1, y=PC2, col=group)) + geom_point()

Heatmap

data3<-t(data2_normalize)
pheatmap(data3,annotation = sampleInfo, show_colnames = FALSE)