A phylogenetic model to predict the patterns of presence and absence of genes in bacterial genomes and estimate the frequency of horizontal gene transfer