-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake_tiles_for_promoter_novel
23 lines (23 loc) · 1.32 KB
/
make_tiles_for_promoter_novel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
make_tiles_for_promoter_novel<-function(x)
{
gene_select_region_CreA<-import.bed(x)
A_value<-NULL
for( i in 1:length(end(ranges(gene_select_region_CreA))))
{
A_value[i]=0
}
tiles2=sapply(1:length(end(ranges(gene_select_region_CreA))),function(i)
if(gene_select_region_CreA$score[i]=="1")
A_value[i]+seq(start(ranges(gene_select_region_CreA))[i]-3000,start(ranges(gene_select_region_CreA))[i]+1500,length.out=321)
else
A_value[i]+seq(end(ranges(gene_select_region_CreA))[i]+3000,end(ranges(gene_select_region_CreA))[i]-1500,length.out=321))
Chromatin_length<-read.table("/Users/dongliguo/Documents/reference_sequences/A_nidulans/annotation/genome.size")
si<-Seqinfo(seqnames=as.character(Chromatin_length$V1),seqlengths=Chromatin_length$V2,genome="A_nidulans")
tiles_3 = GRanges(tilename = paste( rep(gene_select_region_CreA$name, each=321), 1:321, sep="_" ),
seqnames = Rle( rep(as.character(seqnames(gene_select_region_CreA)),each=321)),
ranges=IRanges(start=as.vector(tiles2),
width=50),
strand=Rle(rep("*",length(as.vector(tiles2)))),
seqinfo=si)
return(tiles_3)
}