-
Notifications
You must be signed in to change notification settings - Fork 1
/
Nsyn6I12.ANNOVAR.R
50 lines (46 loc) · 1.88 KB
/
Nsyn6I12.ANNOVAR.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
RiskAAC<-function(data){
risk1<-grep("D",data$SIFT_pred)
risk2<-grep("D|P",data$Polyphen2_HDIV_pred)
risk3<-grep("D|P",data$Polyphen2_HVAR_pred)
risk4<-grep("D",data$LRT_pred)
risk5<-grep("D",data$MutationTaster_pred)
risk6<-grep("H|M",data$MutationAssessor_pred)
risk7<-grep("D",data$FATHMM_pred)
risk8<-grep("D",data$PROVEAN_pred)
risk9<-grep("D",data$MetaSVM_pred)
risk10<-grep("D",data$MetaLR_pred)
risk11<-grep("D",data$fathmm.MKL_coding_pred)
risk12<-grep("D",data$M.CAP_pred)
rlt=c(risk1,risk2,risk3,risk4,risk5,risk6,risk7,risk8,risk9,risk10,risk11,risk12)
return(rlt)
}
file=list.files(pattern="multianno.csv")
LOF<-c()
for(i in 1:length(file)){
data<-read.csv(file[i])
data[,3]<-data$avsnp150
num<-RiskAAC(data)
summ<-table(num)
Nsyn6I12<-names(summ)[which(summ>2)]
frameshift_deletion<-grep('\\bframeshift deletion',data$ExonicFunc.refGene)
frameshift_insertion<-grep('\\bframeshift insertion',data$ExonicFunc.refGene)
stop<-grep('stop',data$ExonicFunc.refGene)
lof<-sort(c(Nsyn6I12,frameshift_deletion,frameshift_insertion,stop))
write.csv(data[lof,],file=paste(file[i],".lof",sep=""),row.names = F,quote=F)
write.table(data[lof,1:7],file=paste(file[i],".lof.txt",sep=""),sep="\t",row.names = F,col.names=F,quote=F)
print(file[i])
print(nrow(data))
}
data<-read.csv("FSTL1.hg19_multianno.csv")
data[,3]<-data$avsnp150
num<-RiskAAC(data)
summ<-table(num)
Nsyn6I12<-names(summ)[which(summ>6)]
frameshift_deletion<-grep('\\bframeshift deletion',data$ExonicFunc.refGene)
frameshift_insertion<-grep('\\bframeshift insertion',data$ExonicFunc.refGene)
stop<-grep('stop',data$ExonicFunc.refGene)
lof<-sort(c(Nsyn6I12,frameshift_deletion,frameshift_insertion,stop))
write.csv(data[lof,],file="FSTL1.lof",row.names = F,quote=F)
write.table(data[lof,1:7],file=paste(file[i],".lof.txt",sep=""),sep="\t",row.names = F,col.names=F,quote=F)
print(file[i])
print(nrow(data))