The associated production of a $W$ boson with a jet originating from either a light parton or heavy-flavor quark is studied in the forward region using proton-proton collisions. The analysis uses data corresponding to integrated luminosities of 1.0 and $2.0,{rm fb}^{-1}$ collected with the LHCb detector at center-of-mass energies of 7 and 8 TeV, respectively. The $W$ bosons are reconstructed using the $Wtomu u$ decay and muons with a transverse momentum, $p_{rm T}$, larger than 20 GeV in the pseudorapidity range $2.0<eta<4.5$. The partons are reconstructed as jets with $p_{rm T} > 20$ GeV and $2.2 < eta < 4.2$. The sum of the muon and jet momenta must satisfy $p_{rm T} > 20$ GeV. The fraction of $W+$jet events that originate from beauty and charm quarks is measured, along with the charge asymmetries of the $W!+!b$ and $W!+!c$ production cross-sections. The ratio of the $W+$jet to $Z+$jet production cross-sections is also measured using the $Ztomumu$ decay. All results are in agreement with Standard Model predictions.