Ns126:Calendar/NOTES/2015-4-21

From ZhangLabWiki
Jump to navigation Jump to search
  • Now, I do know how to insert figures, but I don't know how to insert tables into MediaWiki. Therefore, I write a small code to transfer routine table to wikitable.
  • I must say: mediawiki is really a excellent tool to manage the lab and monitor the progress or task to help us complete the project quickly.
perl table2wikitable.pl input.table.txt
#!/usr/bin/perl
#table2wikitable.pl
use strict;
use Cwd;
chdir getcwd;

my $input=@ARGV[0];

open F,$input;
print "{| class=\"wikitable\" style=\"text-align: right; color: red;\"\n";
while(<F>){
chomp;
my @line=split /\t/;
my $tmp=join("||",@line);
print "| $tmp\n|-\n";
}
print"|}\n";
 
  • corresponding table is as the following. Pan-Cancer Methylation 450K dataset were collected from TCGA Project to identify optional padloc regions.
Symbol Case Control Cancer 肿瘤名称
KIRC 160 160 Kidney renal clear cell carcinoma 肾透明细胞癌
BRCA 92 92 Breast invasive carcinoma 浸润性乳腺癌
THCA 56 56 Thyroid carcinoma 甲状腺癌
HNSC 50 50 Head and Neck squamous cell carcinoma 头颈部鳞状细胞癌
PRAD 49 49 Prostate adenocarcinoma 前列腺癌
LIHC 49 49 Liver hepatocellular carcinoma 肝癌
KIRP 45 45 Kidney renal papillary cell carcinoma 肾乳头状细胞癌
LUSC 41 41 Lung squamous cell carcinoma 肺腺癌
COAD 39 39 Colon adenocarcinoma 结肠癌
UCEC 30 30 Uterine Corpus Endometrial carcinoma 子宫内膜癌
LUAD 26 26 Lung adenocarcinoma 肺鳞癌
  • In order to publish MONOD paper to a good paper quickly. 1) fast 2) large data
    • collect methylation 450 data of cancer tissues and normals from TCGA Project
      • sample size
      • clinical information: gender, age
tar xvf 08177614-f305-4fbf-84ca-fd2fbfe26755.tar   #
tar xvf 548dd1cf-84a1-4d96-86f0-b47d6300daa6.tar   #
tar xvf 9cd95b1c-782c-478d-9ec9-de7c9c441cc4.tar   #
tar xvf c5da6cd3-0266-4ebb-bd11-713ffe9b5ef9.tar   #
  • focus on 3 cancers which we have preliminary data (lung, colon, pancreatic)
library("stringr")
for(cancer in c("COAD","LUAD","LUSC","PAAD")){
dir<-paste("/home/sguo/monod/data/",tolower(cancer),"/DNA_Methylation/JHU_USC__HumanMethylation450/Level_3",sep="")
setwd(dir)
pattern=paste("jhu-usc.edu_",cancer,".*",sep="")
print (pattern)
file=list.files(pattern=pattern)
idv<-unique(as.array(str_extract(file,"TCGA-[0-9|a-z|A-Z]*-[0-9|a-z|A-Z]*")))
pairidv<-c()
for (i in 1:length(idv)){
  t1<-paste(idv[i],"-01",sep="") 
  t2<-paste(idv[i],"-11",sep="")
  if(all(any(grepl(t1,file)),any(grepl(t2,file)))){
    pairidv<-c(pairidv,t1,t2)
  }
}
l1<-length(pairidv)
l2<-length(file)
id1<-lapply(lapply(strsplit(file,"[.]"),function(x) x[6]),function(x) substr(x,1,15))
id2<-lapply(lapply(strsplit(file,"[.]"),function(x) x[6]),function(x) substr(x,14,15))
sam<-lapply(lapply(strsplit(file,"[.]"),function(x) x[6]),function(x) substr(x,1,15))
tab<-table(unlist(lapply(lapply(strsplit(file,"[.]"),function(x) x[6]),function(x) substr(x,14,15))))
c1<-tab[which(names(tab)=="01")]
c2<-tab[which(names(tab)=="11")]
c3<-length(pairidv)
print(c((c1),(c2),Pair=c3))
}
  • The sample size for the genome-wide DNA methyaltion dataset for 3 cancers in TCGA Project are as the following:
Cancer Normal Paired Total
COAD 312 38 76 350
LUAD 473 32 58 505
LUSC 370 42 80 412
PAAD 184 10 20 194
Sum 1339 122 234 1461
    • totally, 1339 cancer tissues and 122 normal tissues were used to refine the padloc regions.
    • firstly, we should check the methylation status of the CpG sites/regions in the normal tissues.
1) hypermethylation in cancer/patient plasma
2) hypomethylation in normal/health plasma
3) large methylation difference (delta beta)
4) high group specificity index (GSI)
5) high ratio release to plasma

File:GSI2.png

  • s(j): average methylation in individual group j
  • S(max): average methylation in the group with highest methylation level
# group specificity index,GSI
setwd("../pan")
load("PanPairMethData.RData")
pheno=data$pheno
xmean <- rowsum(data[,2:ncol(data)], pheno)/table(pheno)
gsi<-apply(xmean,2,function(x) (length(x)-sum(x)/max(x))/(length(x)-1))
rlt<-data.frame(pheno=names(table(pheno)),xmean[,match(names(sort(gsi,decreasing=T)[1:5]),colnames(xmean))])
write.table(rlt,file="pancancer.high.gsi.site.txt",sep="\t",quote=F,col.names=NA,row.names=T)
pdf("gsi.distribution.pdf")
hist(gsi,main="Histogram of Group Specific Index")
dev.off()
num90<-sum(gsi>0.85)
xmean90<-xmean[,match(names(sort(gsi,decreasing=T)[1:num90]),colnames(xmean))]
xx1<-table(data$pheno)[as.numeric(names(table(apply(xmean90,2,function(x) which.max(x)))))]
xx2<-table(apply(xmean90,2,function(x) which.max(x)))
rlt2<-data.frame(sample_size=xx1,xx2)
write.table(rlt2,file="target.status.specifi.txt",sep="\t",quote=F,col.names=NA,row.names=T)
  • run the code and you can find the strongest group specific index CpGs with TCGA Pancancer dataset.
Sample_size cg16579555 cg26240185 cg12587766 cg15375239 cg10157975
BRCA-01 0.01 0.014 0.021 0.012 0.011
BRCA-11 0.01 0.011 0.02 0.011 0.011
COAD-01 0.011 0.012 0.605 0.011 0.353
COAD-11 0.011 0.015 0.033 0.012 0.022
HNSC-01 0.011 0.012 0.021 0.013 0.031
HNSC-11 0.011 0.011 0.022 0.012 0.012
KIRC-01 0.009 0.01 0.016 0.019 0.011
KIRC-11 0.009 0.009 0.016 0.01 0.009
KIRP-01 0.01 0.026 0.021 0.016 0.01
KIRP-11 0.01 0.011 0.022 0.012 0.011
LIHC-01 0.396 0.498 0.042 0.468 0.028
LIHC-11 0.057 0.099 0.024 0.133 0.015
LUAD-01 0.01 0.014 0.022 0.012 0.012
LUAD-11 0.011 0.013 0.024 0.013 0.013
LUSC-01 0.009 0.01 0.017 0.01 0.009
LUSC-11 0.008 0.01 0.018 0.011 0.01
PRAD-01 0.011 0.011 0.02 0.012 0.011
PRAD-11 0.01 0.012 0.019 0.012 0.011
THCA-01 0.011 0.013 0.028 0.013 0.013
THCA-11 0.011 0.013 0.024 0.012 0.013
UCEC-01 0.013 0.014 0.02 0.012 0.026
UCEC-11 0.011 0.015 0.022 0.012 0.014
  • clearly, we can find cancer specific hypermethylated genes with previous method. Then, how about the distribution of the GSI.

File:Gsi.distribution.jpeg

  • 745 CpGs or regions whose GSI>0.9. these CpGs/regions showed high tissue/status specific.
  • 3181 CpGs or regions whose GSI>0.85. these CpGs/regions showed high tissue/status specific.
  • The question is that whether they can be found in patients plasma? (Dr.Zhang might have some information)
  • 3181 tissue and status specific hypermethylation CpG sites were showed as the following table.
Sample_size Var1 Freq
BRCA-01 92 1 33
BRCA-11 92 2 1
COAD-01 39 3 1695
COAD-11 39 4 16
HNSC-01 50 5 143
KIRC-01 160 7 1
KIRC-11 160 8 1
KIRP-01 45 9 20
KIRP-11 45 10 1
LIHC-01 49 11 768
LIHC-11 49 12 40
LUAD-01 26 13 1
LUSC-01 41 15 8
PRAD-01 49 17 271
PRAD-11 49 18 1
THCA-01 56 19 4
THCA-11 56 20 7
UCEC-01 30 21 168
UCEC-11 30 22 2
  • Here, I choose top 5 regions to represent such specific tissue and it's specific status (cancer or normal), code is as the following:
gsi2<-gsi[order(gsi,decreasing=T)]
rlt3<-c()
for(i in seq(1,22,by=2)){
  z<-0
  j<-0
  while(j<length(gsi2) & z<5){
  j=j+1
  max<-which.max(xmean[,match(names(gsi2[j]),colnames(xmean))])
  if(max==i){
    z<-z+1
    rlt3<-rbind(rlt3,(c(names(gsi2[j]),names(table(pheno))[i])))
  }
}
}
rlt3<-data.frame(rlt3)
inf<-read.table("/home/sguo/monod/data/paad/DNA_Methylation/JHU_USC__HumanMethylation450/Level_3/jhu-usc.edu_PAAD.HumanMethylation450.9.lvl-3.TCGA-S4-A8RM-01A-11D-A378-05.txt",head=F,skip=2,sep="\t")
cpg<-rlt3[,1]
cancer<-substr(rlt3[,2],1,4)
gene<-inf[match(rlt3[,1],inf[,1]),3]
chr<-inf[match(rlt3[,1],inf[,1]),4]
start<-inf[match(rlt3[,1],inf[,1]),5]-60
end<-inf[match(rlt3[,1],inf[,1]),5]+60
GSI<-gsi[match(rlt3[,1],names(gsi))]
rlt4<-data.frame(cpg,cancer,GSI,gene,chr,start,end)
write.table(rlt4,file="target.status.specifi.site.txt",sep="\t",quote=F,col.names=NA,row.names=T)
  • The results were showed as the following table. Top 5 important biomarkers for each cancer of the specific tissue and status were list.
cpg cancer GSI gene chr start end
cg18565473 BRCA 0.932682778 ETS1 11 128392042 128392162
cg23884187 BRCA 0.9157933441 C20orf95 20 37275009 37275129
cg14052221 BRCA 0.912760996 PSAT1 9 80911998 80912118
cg24797187 BRCA 0.9120597976 AFF3 2 100175708 100175828
cg18943693 BRCA 0.9116756297 1 155043501 155043621
cg12587766 COAD 0.9628664076 LIFR 5 38556375 38556495
cg10157975 COAD 0.9590682334 ZNF304 19 57862382 57862502
cg23977631 COAD 0.9547387465 LONRF2 2 100938739 100938859
cg04117229 COAD 0.9529809636 SPG20 13 36920753 36920873
cg09854653 COAD 0.9527461786 QKI 6 163834843 163834963
cg03988778 HNSC 0.9412487691 SVIP 11 22850831 22850951
cg08211306 HNSC 0.9364418236 ENPP4 6 46097724 46097844
cg26968387 HNSC 0.9325520916 ZNF420 19 37569208 37569328
cg03280624 HNSC 0.9251408321 ZNF583 19 56915595 56915715
cg00471966 HNSC 0.9237859158 ZNF420 19 37569290 37569410
cg26228351 KIRC 0.8668214436 KIF21B 1 200992596 200992716
cg00593900 KIRC 0.8404290268 ANGPTL6 19 10206686 10206806
cg11697226 KIRC 0.8393271691 TNFRSF11A 18 59992325 59992445
cg09865339 KIRC 0.83639651 GPC2;STAG3 7 99774875 99774995
cg02632185 KIRC 0.8242621029 MAST4 5 66299726 66299846
cg15598442 KIRP 0.9265204439 1 25175003 25175123
cg26622232 KIRP 0.9074060913 OXR1 8 107669727 107669847
cg16326979 KIRP 0.8986303106 OXR1 8 107670101 107670221
cg17031478 KIRP 0.8970812881 HOXC4;HOXC5 12 54427113 54427233
cg17136799 KIRP 0.8884003413 OXR1 8 107669723 107669843
cg16579555 LIHC 0.9680462923 RNF135 17 29298292 29298412
cg26240185 LIHC 0.966346469 FAR1 11 13690097 13690217
cg15375239 LIHC 0.961490202 SPINT2 19 38755227 38755347
cg15969216 LIHC 0.9580311599 TSC22D1 13 45150202 45150322
cg03326059 LIHC 0.9580238498 FAR1 11 13690100 13690220
cg13215643 LUAD 0.8553268659 DACT1 14 59104765 59104885
cg07017994 LUAD 0.8425613476 EPHB6 7 142552854 142552974
cg12487147 LUAD 0.8391970226 HSD17B8 6 33172382 33172502
cg26615830 LUAD 0.8371456733 MSX1 4 4861270 4861390
cg21929771 LUAD 0.8207003816 PTPRU 1 29586520 29586640
cg07240673 LUSC 0.8990393087 CLUAP1 16 3550848 3550968
cg18772127 LUSC 0.8862042556 CMTM7 3 32443436 32443556
cg08562243 LUSC 0.8748813166 CLUAP1 16 3551109 3551229
cg02566698 LUSC 0.8726750003 CLUAP1 16 3550872 3550992
cg02379764 LUSC 0.8697737274 CLUAP1 16 3550968 3551088
cg07635623 PRAD 0.9556665683 SERPINB1 6 2841815 2841935
cg14283569 PRAD 0.9475569263 19 51416153 51416273
cg05098590 PRAD 0.9434078407 ADD3 10 111767319 111767439
cg10938374 PRAD 0.942601773 IER3 6 30711998 30712118
cg16232979 PRAD 0.9424310073 TPM4 19 16187571 16187691
cg27115721 THCA 0.8819506898 FAM49A 2 16790278 16790398
cg04358131 THCA 0.8775891556 MAFK 7 1572192 1572312
cg10540754 THCA 0.8609459396 FAM49A 2 16790310 16790430
cg22749810 THCA 0.8552029028 RNF213 17 78237329 78237449
cg12822074 THCA 0.8497825469 RTN4RL2 11 57243805 57243925
cg03221247 UCEC 0.9555805745 LYPLAL1 1 219347398 219347518
cg15494117 UCEC 0.9514218403 TERC 3 169482835 169482955
cg15599946 UCEC 0.9474897559 TERC 3 169482839 169482959
cg18985581 UCEC 0.946277345 14 105512153 105512273
cg02665570 UCEC 0.9458580151 LYPLAL1 1 219347280 219347400
rm(list=ls())
setwd("/home/sguo/Dropbox/Project/PanCancer")
load("rf.proximity.6631.1500tree.RData")
rlt3<-data.frame(rownames(RF$importance)[match(sort(RF$importance,decreasing=T)[1:300],RF$importance)],sort(RF$importance,decreasing=T)[1:300])
inf<-read.table("/home/sguo/monod/data/paad/DNA_Methylation/JHU_USC__HumanMethylation450/Level_3/jhu-usc.edu_PAAD.HumanMethylation450.9.lvl-3.TCGA-S4-A8RM-01A-11D-A378-05.txt",head=F,skip=2,sep="\t")
gene<-inf[match(rlt3[,1],inf[,1]),3]
chr<-inf[match(rlt3[,1],inf[,1]),4]
start<-inf[match(rlt3[,1],inf[,1]),5]-60
end<-inf[match(rlt3[,1],inf[,1]),5]+60
GSI<-gsi[match(rlt3[,1],names(gsi))]
cpg<-rlt3[,1]
VIM<-rlt3[,2]
rlt4<-data.frame(cpg,VIM,GSI,gene,chr,start,end)
write.table(rlt4,file="top300.txt",sep="\t",quote=F,col.names=NA,row.names=T) 
  • top 75 important variables selected from random forest algorithm
  • VIM: variable importance
  • GSI: group specific index
chr start end cpg VIM GSI gene
1 9600055 9600175 cg03901886 0.7527770839 0.90858776 SLC25A33
1 25943056 25943176 cg06080267 0.9964247548 0.396840622 MAN1C1
1 45241764 45241884 cg07550267 0.6139353757 0.7744774163 SNORD46;RPS8
1 154435888 154436008 cg25135018 1.1579398716 0.2542848418 IL6R
1 205782179 205782299 cg25022560 0.689666593 0.7540172664 SLC41A1
10 29948368 29948488 cg13324103 1.2195568782 0.6584742177 SVIL
10 65442229 65442349 cg04148163 0.6111681566 0.3307470871 NA
10 94450956 94451076 cg24787755 0.8350950605 0.3569153802 HHEX
10 129350862 129350982 cg19321696 0.6204525113 0.4549838076 NPS
10 130385927 130386047 ch.10.2810236F 2.943185017 0.3580734812 NA
11 3877416 3877536 cg06349174 1.25625477 0.6498979205 STIM1
11 77122804 77122924 cg26996201 1.1437467953 0.8204421456 PAK1
11 95889394 95889514 cg15521790 0.822874101 0.3726921136 MAML2
11 114252352 114252472 ch.11.2339138R 4.2619507571 0.7229315151 NA
11 126152905 126153025 cg10291648 0.7004139255 0.5213674972 TIRAP
12 863545 863665 cg05615230 0.9420615719 0.7006003974 WNK1
12 3226385 3226505 cg11958128 1.9753368227 0.2515861697 TSPAN9
12 6665270 6665390 cg08875705 0.8908324386 0.5077694894 IFFO1
12 54090194 54090314 cg05120944 0.9328347886 0.7118414871 NA
12 108678186 108678306 cg07653800 0.7859823353 0.4191516247 NA
12 125819537 125819657 cg03428945 0.6217564925 0.4321944141 TMEM132B
13 114917237 114917357 cg20856545 0.8345343125 0.4269503759 NA
14 34415696 34415816 cg24170040 0.6532317962 0.2338509865 EGLN3
14 93651109 93651229 cg05199950 0.6905234361 0.2130837095 MOAP1;C14orf109
15 59225753 59225873 cg19083363 0.8685475284 0.4071556532 SLTM
15 64422201 64422321 ch.15.934240F 0.8219896207 0.7244697713 SNX1
16 1582521 1582641 cg17706173 0.7835224688 0.3236855023 IFT140
16 57147142 57147262 cg09100343 0.6293840758 0.2163426531 CPNE2
16 58231499 58231619 cg16570890 0.6791063582 0.2229238535 CSNK2A2
16 87541416 87541536 cg06723337 0.8006480781 0.3309506764 NA
16 89169798 89169918 cg05145233 0.60590424 0.2007694734 ACSF3
17 2304348 2304468 cg22188945 0.7132355571 0.3858541342 MNT
17 7482634 7482754 cg15095917 0.7065151168 0.5785444268 CD68
17 18854655 18854775 cg22159015 0.6353459241 0.2109526527 SLC5A10
17 38347543 38347663 cg20668644 0.6072404858 0.8419954529 RAPGEFL1
17 38478747 38478867 cg08580254 0.6341166925 0.6245268317 RARA
17 72745934 72746054 cg05245070 0.8878316511 0.5927578173 SLC9A3R1
18 19321646 19321766 cg25291907 0.7459762222 0.3789889437 MIB1
18 46447677 46447797 cg07661480 0.9216006768 0.2258655059 SMAD7
19 663033 663153 cg27297221 0.6151658465 0.4707300482 RNF126
19 2085226 2085346 cg02326386 1.6891350909 0.1928435344 MOBKL2A
19 3557478 3557598 cg18458026 0.7531306854 0.2154988356 C19orf28
19 15218653 15218773 cg04981492 0.7315780166 0.5005283445 SYDE1
19 15695239 15695359 cg27067425 1.2118209248 0.8905884347 NA
19 16682801 16682921 cg13630845 1.0457068888 0.4190268993 SLC35E1
19 19174771 19174891 cg25768103 0.9692324947 0.2463079679 SLC25A42
19 35454947 35455067 cg13412003 0.7024035872 0.1931523898 ZNF792
19 35633609 35633729 cg21105227 0.8229343388 0.8553915885 FXYD7;FXYD1
19 53098110 53098230 ch.19.57789982R 3.4066718963 0.7783309751 NA
19 56186482 56186602 cg10802291 0.7218154695 0.2437737683 EPN1
19 58715617 58715737 cg19416570 0.6295396794 0.4363244639 ZNF274
2 8825847 8825967 cg06659057 1.117764663 0.3526208675 NA
2 9471171 9471291 cg06549275 0.6122434498 0.2397999845 ASAP2
2 182451477 182451597 cg22274745 0.973310137 0.713374049 CERKL
2 192109930 192110050 cg17167076 0.7451925256 0.6177831567 MYO1B
2 235512706 235512826 ch.2.235177505R 2.5506292498 0.4026840223 NA
2 239112163 239112283 cg16101252 0.8543170331 0.3273364481 ILKAP
20 3451562 3451682 cg05928023 0.6481265693 0.574503526 ATRN
20 22995739 22995859 ch.20.22943799F 4.6613590534 0.8478966268 NA
20 35381178 35381298 ch.20.741059R 3.6099667053 0.7629989937 DSN1
3 16343137 16343257 cg16456087 0.6789975939 0.3034575124 OXNAD1
3 58456916 58457036 cg13575139 1.0156728993 0.6186794832 NA
3 72433777 72433897 cg10805254 1.1820370084 0.2502749589 RYBP
3 134371225 134371345 cg00310463 1.0863684156 0.49695302 KY
4 2813664 2813784 cg05336051 1.1598864999 0.3604126249 SH3BP2
4 56301571 56301691 cg05826175 2.1727957265 0.1823073923 CLOCK
4 124571325 124571445 cg18257996 0.6672094353 0.4719120447 NA
4 140661805 140661925 cg23206160 0.6237924752 0.6949826053 MAML3
5 472947 473067 cg17284070 0.6598847845 0.8367555434 LOC25845
5 7619923 7620043 cg26129110 0.6621186528 0.3695590235 ADCY2
5 10479670 10479790 cg01053766 0.6736994287 0.3516795265 NA
5 149865369 149865489 cg13933692 0.6100229219 0.2041172294 NA
5 179125770 179125890 cg09173344 0.8351629738 0.1826979689 CANX
6 2766132 2766252 cg02754722 1.0906682368 0.4421082644 WRNIP1
6 13428528 13428648 cg03606646 0.6368303445 0.3597661558 GFOD1