-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdispersion_table.R
More file actions
53 lines (44 loc) · 1.78 KB
/
Copy pathdispersion_table.R
File metadata and controls
53 lines (44 loc) · 1.78 KB
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
51
52
53
setwd('/media/bulk_01/users/goryu003/samples/')
CNVs_named=read.table ("/media/bulk_01/users/goryu003/samples/cn.mops_exon_named_final-8.txt", as.is=T, header=T)
head(CNVs_named)
head (CNVs_named$Exon_name)
head (CNVs_named$X84)
CNVs_named[1,]
CNVs_named[1,6:89 ]
is.numeric( CNVs_named[1,6:89 ])
as.numeric(CNVs_named[1,6:89 ])
gene_name=CNVs_named$Exon_name[1]
df_total=CNVs_named[1,]
for(i in 2:nrow(CNVs_named))
{
if (gene_name==CNVs_named$Exon_name[i])
{
df_1=CNVs_named[i,]
df_total=rbind(df_total,df_1)
}
else if (gene_name!=CNVs_named$Exon_name[i])
{
CNV_only=df_total[,6:89 ]
max_value_1=apply(CNV_only,2,max)
min_value_1=apply(CNV_only,2,min)
max_value_2=as.numeric(max_value_1)
min_value_2=as.numeric(min_value_1)
disper= max_value_2-min_value_2
df_CNV_dispersion=data.frame(disper)
df_CNV_dispersion$exon_number=nrow<-nrow(CNV_only)
df_CNV_dispersion$gene<-gene_name
write.table(df_CNV_dispersion,"exon_cnv_dispersion_whole_set.txt",append=T,col.names=F, row.names=F)
df_total=CNVs_named[i,]
gene_name=CNVs_named$Exon_name[i]
}
}
CNV_only=df_total[,6:89]
max_value_1=apply(CNV_only,2,max)
min_value_1=apply(CNV_only,2,min)
max_value_2=as.numeric(max_value_1)
min_value_2=as.numeric(min_value_1)
disper= max_value_2-min_value_2
df_CNV_dispersion=data.frame(disper)
df_CNV_dispersion$exon_number=nrow<-nrow(CNV_only)
df_CNV_dispersion$gene<-gene_name
write.table(df_CNV_dispersion,"exon_cnv_dispersion_whole_set.txt",append=T,col.names=F, row.names=F)