A thermodynamic model of transcriptome formation