Advanced Search
Published: Mar 28, 2022 Views: 619
#-----------------------------------------------------------------------------------------------------------------------------------------------
### download GSE file
#-----------------------------------------------------------------------------------------------------------------------------------------------
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("GEOquery")
library(GEOquery)
mygeomat <- getGEO("GSE33630", GSEMatrix=TRUE)
dataMatrix<-mygeomat$GSE33630_series_matrix.txt.gz@assayData$exprs
rownames(dataMatrix)<-mygeomat$GSE33630_series_matrix.txt.gz@featureData@data$`Gene Symbol`
dataMatrix[1:5,1:15]
#-----------------------------------------------------------------------------------------------------------------------------------------------
### deconvolution using CELLCODE
#-----------------------------------------------------------------------------------------------------------------------------------------------
library(CellCODE)
# Marker file is a marker matrix file that can be a reference for bulk data deconvolution, composed of about 15 markers for each cell type.
# markers are composed of well-known markers and differentially expressed genes in each cell type.
# represent the cell type markers to "1", but others "0".
# example
| Fol | PTC | PTC2 | |
| TFF3 | 1 | 0 | 0 |
| TPO | 1 | 0 | 0 |
| MT1G | 1 | 0 | 0 |
| CRABP1 | 1 | 0 | 0 |
| SNHG9 | 1 | 0 | 0 |
| FN1 | 0 | 1 | 0 |
| NPC2 | 0 | 1 | 0 |
| PERP | 0 | 1 | 0 |
| KRT7 | 0 | 1 | 0 |
| HOPX | 0 | 1 | 0 |
| MDK | 0 | 0 | 1 |
| S100A13 | 0 | 0 | 1 |
| NPW | 0 | 0 | 1 |
| TESC | 0 | 0 | 1 |
| MS4A4A | 0 | 0 | 1 |
marker = read.table( "thyroid_cellcode.txt", sep = "\t", header = T)
rownames(marker)=make.names(marker[,1], unique=T)
marker=marker[,-1]
dim(marker)
head(marker)
marker[1:4,1:5]
grp <- c("ATC", "ATC", "ATC", "ATC", "ATC", "ATC", "ATC", "ATC", "ATC", "ATC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "PTC", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "NOM", "ATC")
dataMatrix=as.matrix(dataMatrix)
marker=as.matrix(marker)
grp=factor(grp)
colnames(dataMatrix)=grp
SPVs=getAllSPVs(dataMatrix , grp=grp, marker , method="mixed", plot=T, mix.par=0.3)
write.table(SPVs, file="GSE33630.txt", sep="\t", quote=F)
# plot using the ggplot2 or other plotting program
Do you have any questions about this protocol?
Post your question to gather feedback from the community. We will also invite the authors of this article to respond.
Share
Bluesky
X
Copy link