Kun:LabNotes/SingleCellExpr/2014-6-5: Difference between revisions
Jump to navigation
Jump to search
m (→Round 1) |
m (→Round 1) |
||
Line 36: | Line 36: | ||
x.cor = cor(log10(x+1),use="pairwise.complete.obs",method="pearson") | 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) | 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) | ||
[[Image:2014_1st_Quater_18_over-dispersed-Z2_sample_clustering.png|500px]] | |||
#Split samples into groups using k-mean clustering | |||
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) | |||
[[Image:2014_1st_Quater_18_over-dispersed-Z2_k2_clusters.png|400px]][[Image:2014_1st_Quater_18_over-dispersed-Z2_k2_clusters.png|400px]] | |||
[[Image:2014_1st_Quater_18_over-dispersed-Z2_k4_clusters.png|400px]][[Image:2014_1st_Quater_18_over-dispersed-Z2_k5_clusters.png|400px]] |
Revision as of 17:58, 9 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
#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
#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
#Split samples into groups using k-mean clustering 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) File:2014 1st Quater 18 over-dispersed-Z2 k2 clusters.pngFile:2014 1st Quater 18 over-dispersed-Z2 k2 clusters.png File:2014 1st Quater 18 over-dispersed-Z2 k4 clusters.pngFile:2014 1st Quater 18 over-dispersed-Z2 k5 clusters.png