model{
# E is the number of exons belong to gene
# T is the number of isoforms belong to gene
# l[i] is the length of exon i
# A is the isoform structure of gene, row corresponding to exon,and column corresponding to isoforms
# Sample is the matrix: row corresponding to sample, column correspongding to exon# length_transcript is the length of transcript
# parameters : N and p[] are interested
 # initialize r mu and alpha[]
 C <- 1000000000
 for(i in 1:E){
       zeros[i] ~ dpois(zeros.mean[i])
       zeros.mean[i] <- -Log[i] + C
    
       Log[i] <- log(lambda[i]) + (Sample[i]-1)*log(lambda[i]+omega[i]*Sample[i])-lambda[i]-omega[i]*Sample[i]-loggam(Sample[i]+1)
       lambda[i] <- read_depth*l[i]*A[i,]*f
     
 }
for(w in 1:E){
 omega[w] <- 1-sqrt(1/(D[w]+1))
 D[w] ~ dexp(0.9765026)
}


read_depth ~ dnorm(0.007,10000000)


f ~ dpois(lambda1)
lambda1 ~ dunif(r,mu)

}
