The given notes E, F#, G, and B form a major chord in the key of E major. In a major key, the pattern of whole and half steps is whole, whole, half, whole, whole, whole, half. Starting on E and following this pattern, we get the notes E, F#, G#, A, B, C#, and D#. Therefore, the major key represented by the given notes is E major.