-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathintersect_gene_name_tss.R
35 lines (21 loc) · 1.12 KB
/
intersect_gene_name_tss.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
tss = read.table("~/resources/hg38_tss.bed",sep="\t",header=F,stringsAsFactors=F)
c25 = read.table("cluster2_5_lsgenes_names.txt",sep="\t",header=F,stringsAsFactors=F)
c134 = read.table("cluster1_3_4_names.txt",sep="\t",header=F,stringsAsFactors=F)
#
table(tss[,4] %in% c25$V1)
table(tss[,4] %in% c134$V1)
#table(c25$V1 %in% tss[,4])
#c25[,1][!c25$V1 %in% tss[,4]]
write.table(tss[tss[,4] %in% c25$V1,], "c25_tss.bed", quote=F,col.names=F,row.names=F,sep="\t")
write.table(tss[tss[,4] %in% c134$V1,], "c134_tss.bed",quote=F,col.names=F,row.names=F,sep="\t")
####
gene = read.table("~/resources/hg38_genes.bed",sep="\t",header=F,stringsAsFactors=F)
c25 = read.table("cluster2_5_lsgenes_names.txt",sep="\t",header=F,stringsAsFactors=F)
c134 = read.table("cluster1_3_4_names.txt",sep="\t",header=F,stringsAsFactors=F)
#
table(gene[,4] %in% c25$V1)
table(gene[,4] %in% c134$V1)
#table(c25$V1 %in% tss[,4])
#c25[,1][!c25$V1 %in% tss[,4]]
write.table(gene[gene[,4] %in% c25$V1,], "c25_gene.bed", quote=F,col.names=F,row.names=F,sep="\t")
write.table(gene[gene[,4] %in% c134$V1,], "c134_gene.bed",quote=F,col.names=F,row.names=F,sep="\t")