FIN=read.table("/Users/zhongyuantian/macshare/workSpace2021/1.TFY/1.3.TFY20201215/1.3.1.TFY1C_TFY1_OPTIMISE/GENENUMinMTForRAID/MTF1135.bed.hitby_Brown_alliso.hit.uniqGENE.AI.uniqCOUNT")
colnames(FIN)<-c("MTF","AI","genecount")
tail(FIN)
library(ggplot2)
library(scales)
library(dplyr)
FINA<-FIN%>%filter(AI=="A")
VCTA=FINA$genecount
tfmaxyA=(which.max(density(VCTA)$y))
tfmaxxA=(density(VCTA)$x[which.max(density(VCTA)$y)])
PLOTA_MTFGENECOUNT<-ggplot(FINA,aes(genecount))+
xlab("TF1C length (bp)")+
geom_density(color = "black",aes(y=..scaled..))+
geom_vline(xintercept = tfmaxxA,col="blue",linetype=2)+
geom_text(aes(x=tfmaxxA,y=0,label=comma(tfmaxxA)),col="navy",hjust=-0.1,vjust=-0.5)+
#scale_x_continuous( breaks = pretty_breaks(10),labels=unit_format(unit = "k", scale = 1e-3, sep = ""))+
# coord_cartesian(xlim=c(0,650000))+
theme_bw()+
theme(panel.grid = element_blank())
PLOTA_MTFGENECOUNT
head (FINA)