Kun:LabNotes/SingleCellExpr/2014-6-5: Difference between revisions

From ZhangLabWiki
Jump to navigation Jump to search
Line 388: Line 388:
|}
|}
*Now I combined all the "top-ten" differentially expressed genes that I found between Cluster 1/2 and four sub-clusters in 1, and compiled a "[[Media:2014_1st_Quater_18_1N_cluster_specific_genes.txt|cluster-specific gene list]]". With this list, I made a heat map for the expression levels of these genes across all samples.
*Now I combined all the "top-ten" differentially expressed genes that I found between Cluster 1/2 and four sub-clusters in 1, and compiled a "[[Media:2014_1st_Quater_18_1N_cluster_specific_genes.txt|cluster-specific gene list]]". With this list, I made a heat map for the expression levels of these genes across all samples.
   [[Image:2014_1st_Quater_18_1N_cluster_specific_genes_expr_heatmap.png|1000px]]
   [[Image:2014_1st_Quater_18_1N_cluster_specific_genes_expr_heatmap.png|800px]]

Revision as of 22:20, 11 June 2014

Preparing the 2014Jun data set

Data source

  • The data came from 18 C1 experiments.
    • 20131219_C1_hNuc-20140222_Expt123Hiseq(oligo dT only)
    • 20140123_C1_hNuc-20140210_Expt119HiSeq
    • 20140205_C1_hNuc-20140222_Expt123Hiseq
    • 20140212_C1_hNuc-20140222_Expt123Hiseq
    • 20140213_C1_hNuc-20140222_Expt123Hiseq
    • 20140218_C1_hNuc-20140317_Expt128HiSeq
    • 20140220_C1_hNuc-20140317_Expt128HiSeq
    • 20140225_C1_hNuc-20140317_Expt128HiSeq
    • 20140226_C1_hNuc-20140317_Expt128HiSeq
    • 20140227_C1_hNuc-20140414_Expt131HiSeq
    • 20140313_C1_hNuc-20140414_Expt131HiSeq
    • 20140317_C1_hNuc-20140414_Expt131HiSeq
    • 20140304_C1_hNuc-20140521_Expt138HiSeq
    • 20140318_C1_hNuc-20140521_Expt138HiSeq
    • 20140320_C1_hNuc-20140521_Expt138HiSeq
    • 20140321_C1_hNuc-20140521_Expt138HiSeq
 cd /home/kunzhang/RNAseq/SCAP/expr_matrix
 ../scripts/merge_expr_matrix.pl 20131219_C1_hNuc-20140222_TPM_matrix_name_corrected.txt 20140210_96Samples_hNuc_Expt119HiSeq_C1_STAR_0123_TPM_matrix_name_corrected.txt 20140205_C1_hNuc-20140222_TPM_matrix_name_corrected.txt 20140212_C1_hNuc-20140222_TPM_matrix_name_corrected.txt 20140213_C1_hNuc-20140222_TPM_matrix_name_corrected.txt 20140218_C1_hNuc_expr_matrix.txt 20140220_C1_hNuc_expr_matrix.txt 20140225_C1_hNuc_expr_matrix.txt 20140226_C1_hNuc_expr_matrix.txt 20140227_C1_hNuc_expr_matrix.txt 20140311_C1_hNuc_expr_matrix.txt 20140313_C1_hNuc_expr_matrix.txt 20140317_C1_hNuc_expr_matrix.txt  20140304_C1_hNuc_expr_matrix.txt 20140318_C1_hNuc_expr_matrix.txt 20140320_C1_hNuc_expr_matrix.txt 20140321_C1_hNuc_expr_matrix.txt > 2014_1st_Quater_18_expr_matrix.txt
  cd ../summary_stats
  ../scripts/get_excluded_sample_id.pl 20131219_C1_hNuc-20140222_mappnig_stats_name_corrected.txt 20140123_C1_hNuc-20140210_mappnig_stats_name_corrected.txt 20140205_C1_hNuc-20140222_mapping_stats_name_corrected.txt 20140212_C1_hNuc-20140222_mapping_stats_name_corrected.txt 20140212_C1_hNuc-20140222_mapping_stats.txt 20140213_C1_hNuc-20140222_mapping_stats_name_corrected.txt 20140218_C1_mapping_stat.txt 20140220_C1_mapping_stat.txt 20140225_C1_mapping_stat.txt 20140226_C1_mapping_stat.txt 20140227_C1_hNuc_mapping_stats.txt 20140311_C1_hNuc_mapping_stats.txt 20140313_C1_hNuc_mapping_stats.txt 20140317_C1_hNuc_mapping_stats.txt 20140304_C1_mapping_stat.txt 20140318_C1_mapping_stat.txt  20140320_C1_mapping_stat.txt 20140321_C1_mapping_stat.txt > 2014_1st_Quater_18_expr_matrix_1N_excluded_ids.txt
 ../scripts/filterExprMatrix.pl 2014_1st_Quater_18_expr_matrix.txt ../summary_stats/2014_1st_Quater_18_expr_matrix_1N_excluded_ids.txt > 2014_1st_Quater_18_1N_expr_matrix_filtered.txt

A total of 728 data sets (10323 genes) were obtained after the filtering (at least 1M total reads; mapping rate >0.4; # ERCC detected > 24; % ERCC reads < 0.3; <30% missing values per gene).

Iterative over-dispersion analysis

Round 1

Identify over-dispersed genes
 #Find over-dispersed genes for the entire data set, using a Z cutoff of 2.
 ../scripts/exprMatrix2overDispersedGenes.pl 2014_1st_Quater_18_1N_expr_matrix_filtered.txt 2 > 2014_1st_Quater_18_1N_Z2_overDispersed_genes.txt
 #Extract the gene expression matrix for the over-dispersed genes.
 ../scripts/extract_gene_set_ENSG.pl  2014_1st_Quater_18_1N_Z2_overDispersed_genes.txt 2014_1st_Quater_18_1N_expr_matrix_filtered.txt > 2014_1st_Quater_18_1N_Z2_overDispersed_expr_matrix.txt
Hierarchical clustering of samples based on these genes
 #Visualize the sample clustering.
 library(gplots)
 x=read.table("2014_1st_Quater_18_1N_Z2_overDispersed_expr_matrix.txt",header=TRUE,row.names=1);
 x.cor = cor(log10(x+1),use="pairwise.complete.obs",method="pearson")
 heatmap.2(as.matrix(x.cor), col=bluered(128), scale="none", cexCol=0.1, cexRow=0.1 ,key=T, symkey=F,density.info="histogram",trace="none",dendrogram="both",Rowv=TRUE,Colv=TRUE)
 File:2014 1st Quater 18 over-dispersed-Z2 sample clustering.png
 #Cut the dendrogram, and extract the sample names in each cluster
 hc.rows<- hclust(dist(x.cor))
 plot(hc.rows,cex=0.1) 
 ct<- cutree(hc.rows, h=11) # the threshold (11) was selected by visually inspect the dendrogram.
 rect.hclust(hc.rows, h=11) # draw red rectangles to mark the subgroups
 write.table(ct, file="2014_1st_Quater_18_1N_Z2_overDispersed_cutree_3_clusters.txt", sep = "\t", row.names=TRUE, col.names=TRUE)
 File:2014 1st Quater 18 over-dispersed-Z2 dendrogram cutree h11.png
 #Generate gene expression matrix for each cluster
 ../scripts/extractSampleClusterExprMatrix.pl 2014_1st_Quater_18_expr_matrix.txt 2014_1st_Quater_18_1N_Z2_overDispersed_cutree_3_clusters.txt 1 > 2014_1st_Quater_18_expr_matrix_cutree-h11_c1.txt
 ../scripts/extractSampleClusterExprMatrix.pl 2014_1st_Quater_18_expr_matrix.txt 2014_1st_Quater_18_1N_Z2_overDispersed_cutree_3_clusters.txt 2 > 2014_1st_Quater_18_expr_matrix_cutree-h11_c2.txt &
 ../scripts/extractSampleClusterExprMatrix.pl 2014_1st_Quater_18_expr_matrix.txt 2014_1st_Quater_18_1N_Z2_overDispersed_cutree_3_clusters.txt 3 > 2014_1st_Quater_18_expr_matrix_cutree-h11_c3.txt &
 #Check whether samples in these cluster have specific neural transmitters.
 ./make_gene_set_heatmap_Hs.pl neural_transmitter_metabolism.txt ../expr_matrix/2014_1st_Quater_18_expr_matrix_cutree-h11_c1.txt
 ./make_gene_set_heatmap_Hs.pl neural_transmitter_metabolism.txt ../expr_matrix/2014_1st_Quater_18_expr_matrix_cutree-h11_c2.txt
 ./make_gene_set_heatmap_Hs.pl neural_transmitter_metabolism.txt ../expr_matrix/2014_1st_Quater_18_expr_matrix_cutree-h11_c3.txt
                            Cluster #1                                               Cluster #2                                               Cluster #3
 File:2014 1st Quater 18 expr matrix cutree-h11 c1 neural transmitter metabolism expr heatmap.pngFile:2014 1st Quater 18 expr matrix cutree-h11 c2 neural transmitter metabolism expr heatmap.pngFile:2014 1st Quater 18 expr matrix cutree-h11 c3 neural transmitter metabolism expr heatmap.png
  • Clear Cluster #1 are mostly GAD1-/GAD2- neurons, and Cluster #3 are mostly GAD1+/GAD2+ neurons. Cluster #2 is a mixture of both. While overall there is a separate between excitatory versus inhibitory neurons, the clustering is not exactly based on such a difference. There is probably another feature that determines the clustering.
K-mean partitioning based on the over-dispersed genes
 library(cluster) 
 library(fpc)
 x=read.table("2014_1st_Quater_18_1N_Z2_overDispersed_expr_matrix.txt",header=TRUE,row.names=1)
 x[is.na(x)] <- 0
 y=log10(x+1)
 tys = scale(t(y))
 k_5=kmeans(tys, 5)
 k_4=kmeans(tys, 4)
 k_3=kmeans(tys, 3)
 k_2=kmeans(tys, 2)
 plotcluster(tys,k_2$cluster)
 plotcluster(tys,k_3$cluster)
 plotcluster(tys,k_4$cluster)
 plotcluster(tys,k_5$cluster)
 write.table(k_3$cluster, file="2014_1st_Quater_18_1N_Z2_overDispersed_k-mean_3_clusters.txt", sep = "\t", row.names=TRUE, col.names=TRUE)
 write.table(k_2$cluster, file="2014_1st_Quater_18_1N_Z2_overDispersed_k-mean_2_clusters.txt", sep = "\t", row.names=TRUE, col.names=TRUE)
 File:2014 1st Quater 18 over-dispersed-Z2 k2 clusters.pngFile:2014 1st Quater 18 over-dispersed-Z2 k3 clusters.png
 File:2014 1st Quater 18 over-dispersed-Z2 k4 clusters.pngFile:2014 1st Quater 18 over-dispersed-Z2 k5 clusters.png
 #Generate gene expression matrix for each cluster
 ../scripts/extractSampleClusterExprMatrix.pl 2014_1st_Quater_18_expr_matrix.txt 2014_1st_Quater_18_1N_Z2_overDispersed_k-mean_2_clusters.txt 1 > 2014_1st_Quater_18_expr_matrix_k-mean2_c1.txt &
 ../scripts/extractSampleClusterExprMatrix.pl 2014_1st_Quater_18_expr_matrix.txt 2014_1st_Quater_18_1N_Z2_overDispersed_k-mean_2_clusters.txt 2 > 2014_1st_Quater_18_expr_matrix_k-mean2_c2.txt &
 ../scripts/extractSampleClusterExprMatrix.pl 2014_1st_Quater_18_expr_matrix.txt 2014_1st_Quater_18_1N_Z2_overDispersed_k-mean_3_clusters.txt 1 > 2014_1st_Quater_18_expr_matrix_k-mean3_c1.txt &
 ../scripts/extractSampleClusterExprMatrix.pl 2014_1st_Quater_18_expr_matrix.txt 2014_1st_Quater_18_1N_Z2_overDispersed_k-mean_3_clusters.txt 2 > 2014_1st_Quater_18_expr_matrix_k-mean3_c2.txt &
 ../scripts/extractSampleClusterExprMatrix.pl 2014_1st_Quater_18_expr_matrix.txt 2014_1st_Quater_18_1N_Z2_overDispersed_k-mean_3_clusters.txt 3 > 2014_1st_Quater_18_expr_matrix_k-mean3_c3.txt &
  ./make_gene_set_heatmap_Hs.pl neural_transmitter_metabolism.txt ../expr_matrix/2014_1st_Quater_18_expr_matrix_k-mean2_c1.txt
  ./make_gene_set_heatmap_Hs.pl neural_transmitter_metabolism.txt ../expr_matrix/2014_1st_Quater_18_expr_matrix_k-mean2_c2.txt
  ./make_gene_set_heatmap_Hs.pl neural_transmitter_metabolism.txt ../expr_matrix/2014_1st_Quater_18_expr_matrix_k-mean3_c1.txt
  ./make_gene_set_heatmap_Hs.pl neural_transmitter_metabolism.txt ../expr_matrix/2014_1st_Quater_18_expr_matrix_k-mean3_c2.txt
  ./make_gene_set_heatmap_Hs.pl neural_transmitter_metabolism.txt ../expr_matrix/2014_1st_Quater_18_expr_matrix_k-mean3_c3.txt
                         Cluster #1 (k=2)                                               Cluster #2  (k=2)                      
  File:2014 1st Quater 18 expr matrix k-mean2 c1 neural transmitter metabolism expr heatmap.pngFile:2014 1st Quater 18 expr matrix k-mean2 c2 neural transmitter metabolism expr heatmap.png
                        Cluster #1(k=3)                                          Cluster #2(k=3)                                         Cluster #3(k=3)
  File:2014 1st Quater 18 expr matrix k-mean3 c1 neural transmitter metabolism expr heatmap.pngFile:2014 1st Quater 18 expr matrix k-mean3 c2 neural transmitter metabolism expr heatmap.pngFile:2014 1st Quater 18 expr matrix k-mean3 c3 neural transmitter metabolism expr heatmap.png
  • The sample clusters obtained by cutting the dendrogram are not entirely consistent with the k-mean generated clusters. For example, Cluster #1 in the k-3 clustering result include all #3, plus some #2 samples in the dendrogram. Similarly, GAD1/GAD2 seem to contribute to the separation, but there is also something else.
Identify over-dispersed genes using a less stringent threshold
  • When looked into the matrix of over-dispersed genes, I found that only 95 genes were in the list. Perhaps that's too few and not sufficient for robust sample clustering. Therefore I repeated the whole analysis using a Z cutoff of 1, which allowed me to identify 564 genes.
 ../scripts/exprMatrix2overDispersedGenes.pl 2014_1st_Quater_18_1N_expr_matrix_filtered.txt 1 > 2014_1st_Quater_18_1N_Z1_overDispersed_genes.txt
 #Extract the gene expression matrix for the over-dispersed genes.
 ../scripts/extract_gene_set_ENSG.pl  2014_1st_Quater_18_1N_Z1_overDispersed_genes.txt 2014_1st_Quater_18_1N_expr_matrix_filtered.txt > 2014_1st_Quater_18_1N_Z1_overDispersed_expr_matrix.txt
 x=read.table("2014_1st_Quater_18_1N_Z1_overDispersed_expr_matrix.txt",header=TRUE,row.names=1);
 x.cor = cor(log10(x+1),use="pairwise.complete.obs",method="pearson")
 hm<-heatmap.2(as.matrix(x.cor), col=bluered(128), scale="none", cexCol=0.1, cexRow=0.1 ,key=T, symkey=F,density.info="histogram",trace="none",dendrogram="both",Rowv=TRUE,Colv=TRUE)
 hc.rows<- hclust(dist(x.cor))
 plot(hc.rows,cex=0.1) 
 ct<- cutree(hc.rows, h=11) # 
 rect.hclust(hc.rows, h=11) # draw red rectangles to mark the subgroups
 write.table(ct, file="2014_1st_Quater_18_1N_Z1_overDispersed_cutree_2_clusters.txt", sep = "\t", row.names=TRUE, col.names=TRUE)
 x=read.table("2014_1st_Quater_18_1N_Z1_overDispersed_expr_matrix.txt",header=TRUE,row.names=1)
 x[is.na(x)] <- 0
 y=log10(x+1)
 tys = scale(t(y))
 k_5=kmeans(tys, 5)
 k_4=kmeans(tys, 4)
 k_3=kmeans(tys, 3)
 k_2=kmeans(tys, 2)
 plotcluster(tys,k_2$cluster)
 plotcluster(tys,k_3$cluster)
 plotcluster(tys,k_4$cluster)
 plotcluster(tys,k_5$cluster)
 write.table(k_3$cluster, file="2014_1st_Quater_18_1N_Z1_overDispersed_k-mean_3_clusters.txt", sep = "\t", row.names=TRUE, col.names=TRUE)
 write.table(k_2$cluster, file="2014_1st_Quater_18_1N_Z1_overDispersed_k-mean_2_clusters.txt", sep = "\t", row.names=TRUE, col.names=TRUE)
 
 ../scripts/extractSampleClusterExprMatrix.pl 2014_1st_Quater_18_expr_matrix.txt 2014_1st_Quater_18_1N_Z1_overDispersed_cutree_2_clusters.txt 1 > 2014_1st_Quater_18_expr_matrix_Z1_cutree-h11_c1.txt
 ../scripts/extractSampleClusterExprMatrix.pl 2014_1st_Quater_18_expr_matrix.txt 2014_1st_Quater_18_1N_Z1_overDispersed_cutree_2_clusters.txt 2 > 2014_1st_Quater_18_expr_matrix_Z1_cutree-h11_c2.txt 
 ../scripts/extractSampleClusterExprMatrix.pl 2014_1st_Quater_18_expr_matrix.txt 2014_1st_Quater_18_1N_Z1_overDispersed_k-mean_2_clusters.txt 1 > 2014_1st_Quater_18_expr_matrix_Z1_k-mean2_c1.txt 
 ../scripts/extractSampleClusterExprMatrix.pl 2014_1st_Quater_18_expr_matrix.txt 2014_1st_Quater_18_1N_Z1_overDispersed_k-mean_2_clusters.txt 2 > 2014_1st_Quater_18_expr_matrix_Z1_k-mean2_c2.txt 
 ../scripts/extractSampleClusterExprMatrix.pl 2014_1st_Quater_18_expr_matrix.txt 2014_1st_Quater_18_1N_Z1_overDispersed_k-mean_3_clusters.txt 1 > 2014_1st_Quater_18_expr_matrix_Z1_k-mean3_c1.txt 
 ../scripts/extractSampleClusterExprMatrix.pl 2014_1st_Quater_18_expr_matrix.txt 2014_1st_Quater_18_1N_Z1_overDispersed_k-mean_3_clusters.txt 2 > 2014_1st_Quater_18_expr_matrix_Z1_k-mean3_c2.txt 
 ../scripts/extractSampleClusterExprMatrix.pl 2014_1st_Quater_18_expr_matrix.txt 2014_1st_Quater_18_1N_Z1_overDispersed_k-mean_3_clusters.txt 3 > 2014_1st_Quater_18_expr_matrix_Z1_k-mean3_c3.txt 
  File:2014 1st Quater 18 over-dispersed-Z1 sample clustering.png
  File:2014 1st Quater 18 over-dispersed-Z1 dendrogram cutree h11.png
 File:2014 1st Quater 18 over-dispersed-Z1 k2 clusters.pngFile:2014 1st Quater 18 over-dispersed-Z1 k3 clusters.png
 File:2014 1st Quater 18 over-dispersed-Z1 k4 clusters.pngFile:2014 1st Quater 18 over-dispersed-Z1 k5 clusters.png
                        Cluster #1(k=2)                                          Cluster #2(k=2) 
  File:2014 1st Quater 18 expr matrix Z1 k-mean2 c1 neural transmitter metabolism expr heatmap.pngFile:2014 1st Quater 18 expr matrix Z1 k-mean2 c2 neural transmitter metabolism expr heatmap.png
                        Cluster #1(k=3)                                          Cluster #2(k=3)                                         Cluster #3(k=3)
  File:2014 1st Quater 18 expr matrix Z1 k-mean3 c1 neural transmitter metabolism expr heatmap.pngFile:2014 1st Quater 18 expr matrix Z1 k-mean3 c2 neural transmitter metabolism expr heatmap.pngFile:2014 1st Quater 18 expr matrix Z1 k-mean3 c3 neural transmitter metabolism expr heatmap.png
  • Clearly the separate is much cleaner with 565 genes that have Z-score above 1. However, GAD1/GAD2 positive neurons are still not fully separated. For example, with k=2, Cluster #1 still have a fraction of GAD1/GAD2 positive neurons. Such neurons seem to have dual identities. There could be true neurons like these, or perhaps these data sets came from two nuclei when they overlapped on each other and looked like one nucleus under the microscope. We might need to use RNA FISH to distinguish these two hypotheses.
Identify differentially expressed genes between clusters
  • I took the over-dispersed genes for all samples (2014_1st_Quater_18_1N_Z1_overDispersed_expr_matrix.txt), and assigned each sample to one of the two clusters based on the k-mean analysis (2014_1st_Quater_18_1N_Z1_overDispersed_k-mean_2_clusters.txt).
  • Then I ran SAM to identify differentially expressed genes. The majority of the genes were differentially expressed, which is not surprising since these genes were pre-selected based on the variability, and the two clusters were well separated.
  Media:2014_1st_Quater_18_1N_Z1_overDispersed_expr_matrix_for_SAM.xlsx
  File:2014 1st Quater 18 expr matrix Z1 k-mean2 two-clusters-SAM-plot.png
  Top ten up/down genes:
Gene ID Fold Change q-value(%) HUGO Gene ID Fold Change q-value(%) HUGO
ENSG00000157103.6 14770220922 0 SLC6A1 ENSG00000135426.9 2.56E-10 0 TESPA1
ENSG00000136750.7 9609687782 0 GAD2 ENSG00000179456.9 6.60E-10 0 ZBTB18
ENSG00000128683.8 9106160761 0 GAD1 ENSG00000198963.5 9.72E-10 0 RORB
ENSG00000077044.5 2678606715 0 DGKD ENSG00000156140.4 1.21E-09 0 ADAMTS3
ENSG00000129244.4 1642874016 0 ATP1B2 ENSG00000120738.7 1.32E-09 0 EGR1
ENSG00000164512.12 1351632660 0 ANKRD55 ENSG00000060718.14 1.43E-09 0 COL11A1
ENSG00000175352.6 1338510457 0 NRIP3 ENSG00000135919.8 1.52E-09 0 SERPINE2
ENSG00000103460.12 1303571887 0 TOX3 ENSG00000167614.8 1.56E-09 0 TTYH1
ENSG00000017427.11 938250314.6 0 IGF1 ENSG00000169507.5 1.96E-09 0 SLC38A11
ENSG00000127328.17 863574011.2 0 RAB3IP ENSG00000135636.8 2.18E-09 0 DYSF
  • I then manually annotated some of the genes. Note that I used /home/kunzhang/RNAseq/SCAP/scripts/ENSG2HUGO.pl to convert a list of ENSG IDs into HUGO IDs. The top most up-regulated genes in Cluster #2 are mostly GABAergic neuron related genes, which is not surprising. The ones that are up-regulated in Cluster #1 have more diverse functions. Many are glycoproteins, related to calcium binding or cell adhesion.
  • I did found a few interesting transcriptional regulators, such as ZBTB18/SATB2 for Cluster #1 and TOX3 for Cluster #2.
  • Then I decided to focus the analysis only on known transcription factors.
    • Extract the gene expression matrix for all known TFs (based on the list in nrg2538).
 ./make_gene_set_heatmap_Hs.pl nrg2538_TF_genes.txt ../expr_matrix/2014_1st_Quater_18_1N_expr_matrix_filtered.txt
    • Renamed nrg2538_TF_genes_expr_matrix.txt to 2014_1st_Quater_18_1N_nrg2538_TF_genes_expr_matrix.txt, then assigned each sample to one of the two clusters(2014_1st_Quater_18_1N_Z1_overDispersed_k-mean_2_clusters.txt).
    • Run SAM analysis.
  Media:2014_1st_Quater_18_1N_nrg2538_TF_genes_expr_matrix_for_SAM.xlsx
  File:2014 1st Quater 18 expr matrix nrg2538 k-mean2 two-clusters-SAM-plot.png
    • Top ten differentially expressed genes:
Up in Cluster 1 Up in Cluser 2
Gene ID Fold Change q-value(%) Gene ID Fold Change q-value(%)
RORB 9.85E-10 0 TOX3 1.07E+09 0
EGR1 1.31E-09 0 RXRA 2.77E+08 0
ZBTB7C 2.75E-09 0 ZNF641 9.95E+07 0.663375427
HOPX 2.92E-09 0 PPARA 8.41E+07 0
NEUROD2 3.60E-09 0 ETS1 7.65E+07 0
STAT6 3.86E-09 0 BACH1 2.60E+01 0
PLXND1 4.18E-09 0 ZNF385D 1.89E+01 0
ONECUT2 4.50E-09 0 SOX6 7.97E+00 0
LHX2 4.59E-09 0 TOX2 7.29E+00 0
MKX 5.16E-09 0 ZNF536 6.96E+00 0

Round 2

K-mean cluster 1 (mostly GAD1-/GAD2- neurons)
../scripts/exprMatrix2overDispersedGenes.pl 2014_1st_Quater_18_expr_matrix_Z1_k-mean2_c1.txt 1 > 2014_1st_Quater_18_k-mean2_c1_Z1_overDispersed_genes.txt
../scripts/extract_gene_set_ENSG.pl  2014_1st_Quater_18_k-mean2_c1_Z1_overDispersed_genes.txt 2014_1st_Quater_18_1N_expr_matrix_filtered.txt > 2014_1st_Quater_18_k-mean2_c1_Z1_overDispersed_genes_expr_matrix.txt
library(gplots)
x=read.table("2014_1st_Quater_18_k-mean2_c1_Z1_overDispersed_genes_expr_matrix.txt",header=TRUE,row.names=1);
x.cor = cor(log10(x+1),use="pairwise.complete.obs",method="pearson")
heatmap.2(as.matrix(x.cor), col=bluered(128), scale="none", cexCol=0.1, cexRow=0.1 ,key=T, symkey=F,density.info="histogram",trace="none",dendrogram="both",Rowv=TRUE,Colv=TRUE)
File:2014 1st Quater 18 k-mean2 c1 Z1 overDispersed genes sample clustering.png 
hc.rows<- hclust(dist(x.cor))
plot(hc.rows,cex=0.1) 
ct<- cutree(hc.rows, h=8) # 
rect.hclust(hc.rows, h=8) # draw red rectangles to mark the subgroups
write.table(ct, file="2014_1st_Quater_18_k-mean2_c1_Z1_overDispersed_genes_cutree_2_clusters.txt", sep = "\t", row.names=TRUE, col.names=TRUE)
File:2014 1st Quater 18 k-mean2 c1 Z1 overDispersed genes sample clustering cutree2.png

library(cluster) 
library(fpc)
x[is.na(x)] <- 0
y=log10(x+1)
tys = scale(t(y))
k_5=kmeans(tys, 5)
k_4=kmeans(tys, 4)
k_3=kmeans(tys, 3)
k_2=kmeans(tys, 2)
plotcluster(tys,k_2$cluster)
plotcluster(tys,k_3$cluster)
plotcluster(tys,k_4$cluster)
plotcluster(tys,k_5$cluster)
write.table(k_3$cluster, file="2014_1st_Quater_18_k-mean2_c1_Z1_overDispersed_genes_k-mean_3_clusters.txt", sep = "\t", row.names=TRUE, col.names=TRUE)
write.table(k_2$cluster, file="2014_1st_Quater_18_k-mean2_c1_Z1_overDispersed_genes_k-mean_2_clusters.txt", sep = "\t", row.names=TRUE, col.names=TRUE)
 File:2014 1st Quater 18 k-mean2 c1 Z1 overDispersed genes k2 clusters.pngFile:2014 1st Quater 18 k-mean2 c1 Z1 overDispersed genes k3 clusters.png
 File:2014 1st Quater 18 k-mean2 c1 Z1 overDispersed genes k4 clusters.pngFile:2014 1st Quater 18 k-mean2 c1 Z1 overDispersed genes k5 clusters.png
  • It appeared that these neurons can be divided into four cleanly separated clusters. The next questions would be to find out the identity or meaning of these clusters.
Finding genes up-regulated in the four sub-groups of K-mean cluster 1
  • For this I took the over-dispersed genes in all k-mean (k=2) cluster 1 samples from Round 1 (2014_1st_Quater_18_k-mean2_c1_Z1_overDispersed_genes_expr_matrix.txt), label the samples with four groups based on the Round 2 k-mean clustering results (2014_1st_Quater_18_k-mean2_c1_Z1_overDispersed_genes_k-mean_4_clusters), and run the SAM analysis under the multi-class model. Obviously most of the genes (365/486) are differentially expressed in one or more groups. I sorted these genes based on the "contrast" for each of the four groups, then selected the top 10 genes that have the highest contrast for each group (note that I skipped a few that have no annotations, such as RP11-123O10.4).
 Media:2014_1st_Quater_18_k-mean2_c1_Z1_overDispersed_genes_expr_matrix_for_SAM_4-clusters.xlsx
 Group 1
HUGO contrast-1 contrast-2 contrast-3 contrast-4
KCNIP3 11.16739647 -4.478728361 -2.350967986 -8.986883423
PTPRK 10.01585583 -8.448597715 3.281430094 -10.8506507
EGR1 9.747299154 -4.684003738 -1.824346768 -7.36895931
LINGO1 9.58144463 -4.624228762 -0.40094134 -9.099549439
HECW1 9.394975421 -5.855567107 -1.766355741 -5.738812994
SEMA4D 8.81652661 -2.666120885 -2.904782293 -6.55968048
NGEF 8.802471142 -4.446578057 1.310832307 -10.42218722
ZNF804B 8.5895529 -6.751014558 -0.494902477 -5.345801831
RORB 8.54586603 -3.975389056 -2.334804946 -5.602362517
CPNE4 8.480061688 -3.478772801 -1.500439455 -7.129478032
 Group 2
HUGO contrast-1 contrast-2 contrast-3 contrast-4
EYA4 -5.321417894 12.84154833 -6.951889857 4.354034676
PID1 -4.831615771 12.56961797 -5.8966099 2.475220629
PHKB -4.678402329 12.53723223 -6.323235779 2.853976955
SEC14L1 -4.063798258 12.32036809 -6.629922109 2.568378636
PDE3A -3.022438352 12.1453072 -9.026753944 4.419686124
HFM1 -4.719507944 12.04260411 -5.660492381 2.521496057
PPEF2 -3.137958388 12.00043463 -7.707046659 2.960175498
SLCO5A1 -3.904449914 11.97087414 -6.695142422 2.771008518
GRIP1 -3.072843559 8.984872116 -12.26343691 12.04528531
FSTL5 -0.971506882 8.634044019 -7.959248851 3.462288967
 Group 3
HUGO contrast-1 contrast-2 contrast-3 contrast-4
XIST -7.68079175 -2.540266439 12.60231218 -2.948850821
SYN3 4.509683673 -7.724417995 8.033069861 -9.762531396
STXBP5L 6.297609932 -8.539816682 7.94343846 -11.4885019
CBLN2 7.536329826 -9.613307235 7.650603365 -11.86021
CA10 7.632543482 -10.16386485 7.578192948 -11.35073153
FAM19A1 7.740036874 -9.88390345 7.393307367 -11.54462373
TESPA1 8.398699091 -10.48531557 7.16022654 -11.60713383
DGKB 5.667978001 -6.42129736 7.073847338 -11.51450378
ANKDD1A -3.551719544 -0.094358135 6.717202522 -3.652511861
SLIT3 4.749934938 -6.512804085 6.654470337 -9.486357108
  Group 4
HUGO contrast-1 contrast-2 contrast-3 contrast-4
ERBB4 -5.47746011 6.466422889 -8.491198974 13.09425661
ZNF385D -5.612887639 6.706045987 -8.288955267 12.78215485
GAD1 -3.992672286 7.380574545 -10.18753447 12.2404974
GRIP1 -3.072843559 8.984872116 -12.26343691 12.04528531
GAD2 -4.399414548 6.847386992 -9.173866991 12.02002257
KLHL5 -2.873803987 3.718134302 -8.032442931 11.36189782
SLC6A1 -3.64699617 8.167746887 -10.4614637 11.29912374
QKI -3.926567386 5.118752239 -7.596491468 10.93301198
SAMD5 -1.299998198 2.202125809 -8.017337836 10.52149593
TENM3 -1.967305855 1.641470543 -6.793668393 10.43483179
  • Now I combined all the "top-ten" differentially expressed genes that I found between Cluster 1/2 and four sub-clusters in 1, and compiled a "cluster-specific gene list". With this list, I made a heat map for the expression levels of these genes across all samples.
  File:2014 1st Quater 18 1N cluster specific genes expr heatmap.png