Fermionic and bosonic ghost systems are defined each in terms of a single vertex algebra which admits a one-parameter family of conformal structures. The observation that these structures are related to each other provides a simple way to obtain character formulae for a general twisted module of a ghost system. The U(1) symmetry and its subgroups that underly the twisted modules also define an infinite set of invariant vertex subalgebras. Their structure is studied in detail from a W-algebra point of view with particular emphasis on Z_N-invariant subalgebras of the fermionic ghost system.