DNA microarrays have the ability to analyze the expression of thousands of the same set of genes under at least two different experimental conditions. However, DNA microarrays require substantial amounts of RNA to generate the probes, especially when bacterial RNA is used for hybridization (50 microg of bacterial total RNA contains approximately 2 microg of mRNA). We have developed a computer-based algorithm for prediction of the minimal number of primers to specifically anneal to all genes in a given genome. The algorithm predicts, for example, that 37 oligonucleotides should prime all genes in the Mycobacterium tuberculosis genome. We tested the usefulness of the genome-directed primers (GDPs) in comparison to random primers for gene expression profiling using DNA microarrays. Both types of primers were used to generate fluorescent-labeled probes and to hybridize to an array of 960 mycobacterial genes. Compared to random-primer probes, the GDP probes were more sensitive and more specific, especially when mammalian RNA samples were spiked with mycobacterial RNA. The GDPs were used for gene expression profiling of mycobacterial cultures grown to early log or stationary growth phases. This approach could be useful for accurate genome-wide expression analysis, especially for in vivo gene expression profiling, as well as directed amplification of sequenced genomes.