She was in a bad mood. Something must have happened before I arrived to set her off.

Literal

She [topic-は] mood [subject-が] was-bad. me [subject-が] arrive [before-前に] happen [thing-こと] [from-で] was-being-irritated [must-に違いない].

Two sentences yoked together. The first is the textbook 機嫌が悪い ('be in a bad mood'). The second pulls together several layered patterns: the relative clause 私が到着する前に起こったこと ('something that happened before I arrived'), the で marking that something as the cause of the irritation, the onomatopoeic verb いらいらしている ('to be irritated, frustrated' — built on the 擬態語 いらいら for nervous agitation), and ~に違いない ('must be, no doubt') for confident inference. Together they paint a deductive narrative: she was angry, and the speaker concludes the cause must predate their arrival.