The genomes of eukaryotic organisms are highly organized within the nucleus of the cell.  DNA is packaged into chromatin by wrapping around a core of histone proteins to form a nucleosome.  These nucleosomes are further compacted by aggregation and folding to form a highly condensed chromatin structure.  A range of different states of condensation are possible, and the tightness of this structure varies during the cell cycle, being most compact during the process of cell division.  Chromatin structure plays a critical role in regulating gene transcription by regulating protein access to the DNA.  The chromatin structure is controlled by a series of post translational modifications to histone proteins, mainly within the tails of histones H3 and H4 that extend beyond the core nucleosome structure.  These reversible modifications include acetylation, methylation, phosphorylation, ubiquitination and SUMOylation.  These epigenetic marks are written and erased by specific enzymes that modify specific residues within the histone tail, thereby forming an epigenetic code.  Other nuclear proteins bind to these marks and effect outputs specified by this information through the regulation of chromatin structure and gene transcription.  Increasing evidence links genetic changes to genes encoding epigenetic modifiers and regulators leading to aberrant histone marks in diseases such as neurodegenerative disorders, metabolic diseases, inflammation and cancer. 
Histone acetylation is typically associated with the activation of gene transcription, as the modification weakens the interaction between the DNA and the histone proteins, permitting greater access to DNA by the transcriptional machinery.  Specific proteins bind to acetylated lysine residues within histones to “read” the epigenetic code.  A highly conserved protein module called the bromodomain binds to acetylated lysine residues on histone and other proteins.  There are more than 60 bromodomain-containing proteins in the human genome. 
The BET (Bromodomain and Extra-Terminal) family of bromodomain containing proteins comprises 4 proteins (BRD2, BRD3, BRD4 and BRD-t) that share a conserved structural organization containing tandem N-terminal bromodomains capable of binding to acetylated lysine residues of histones and other proteins.  BRD2, BRD3 and BRD4 are ubiquitiously expressed while BRDt is restricted to germ cells.  BRD proteins play essential, but non-overlapping roles in regulating gene transcription and controlling cell growth.  BET proteins are associated with large protein complexes including Mediator, PAFc and super elongation complex that regulate many aspects of gene transcription.  BRD2 and BRD4 proteins have been shown to remain in complex with chromosomes during mitosis and are required to promote transcription of critical genes including cyclin D and c-Myc that initiate the cell cycle (Mochizuki J Biol.  Chem.  2008 283:9040-9048).  BRD4 is essential for recruiting the protein translational elongation factor B complex to the promoters of inducible genes resulting in the phosphorylation of RNA polymerase II and stimulating productive gene transcription and elongation (Jang et al.  Mol.  Cell 2005 19:523-534).  In some instances, a kinase activity of BRD4 may directly phosphorylate and activate RNA polymerase II (Devaiah et al.  PNAS 2012 109:6927-6932).  Cells lacking BRD4 show impaired progression through cell cycle.  BRD2 and BRD3 are reported to associate with histones along actively transcribed genes and may be involved in facilitating transcriptional elongation (Leroy et al, Mol.  Cell.  2008 30:51-60).  In addition to acetylated histones, BET proteins have been shown to bind selectively to acetylated transcription factors including the RelA subunit of NF-kB and GATA1 thereby directly regulating the transcriptional activity of these proteins to control expression of genes involved in inflammation and hematopoietic differentiation (Huang et al, Mol.  Cell.  Biol.  2009 29:1375-1387; Lamonica Proc.  Nat.  Acad.  Sci.  2011 108:E159-168). 
A recurrent translocation involving NUT (nuclear protein in testes) with BRD3 or BRD4 to form a novel fusion oncogene, BRD-NUT, is found in a highly malignant form of epithelial neoplasia (French et al, Cancer Research 2003 63:304-307; French et al, Journal of Clinical Oncology 2004 22:4135-4139).  Selective ablation of this oncogene restores normal cellular differentiation and reverses the tumorigenic phenotype (Filippakopoulos et al, Nature 2010 468:1068-1073).  Genetic knockdown of BRD2, BRD3 and BRD4 has been shown to impair the growth and viability of a wide range of hematological and solid tumor cells (Zuber et al, Nature 2011 478:524-528; Delmore et al, Cell 2011 146:904-917).  Aside from a role in cancer, BET proteins regulate inflammatory responses to bacterial challenge, and a BRD2 hypomorph mouse model showed dramatically lower levels of inflammatory cytokines and protection from obesity induced diabetes (Wang et al Biochem J. 2009 425:71-83; Belkina et al.  J. Immunol 2013).  In addition, some viruses make use of these BET proteins to tether their genomes to the host cell chromatin, as part of the process of viral replication or use BET proteins to facilitate viral gene transcription and repression (You et al, Cell 2004 117:349-60; Zhu et al, Cell Reports 2012 2:807-816). 
Accordingly, there is a need for compounds that modulate the activity of the BET family of proteins, including BRD2, BRD3, and BRD4, that can be used to treat BET protein-associated diseases such as cancer.  The compounds of the invention help meet this need.