  We study twisted bialgebras and double twisted bialgebras, that is to say
bialgebras in the category of linear species, or in the category of species in
the category of coalgebras. We define the notion of cofree twisted coalgebra
and generalize Hoffman's quasi-shuffle product, obtaining in particular a
twisted bialgebra of set compositions Comp. Given a special character , this
twisted bialgebra satisfies a terminal property, generalizing the one of the
Hopf algebra of quasisymmetric functions proved by Aguiar, Bergeron and
Sottile. We give Comp a second coproduct, making it a double twisted bialgebra,
and prove that it is a terminal object in the category of double twisted
bialgebras. Actions of characters on morphisms allow to obtain every twisted
bialgebra morphisms from a connected double twisted bialgebra to Comp. These
results are applied to examples based on graphs and on finite topologies,
obtaining species versions of the chromatic symmetric series and chromatic
polynomials, or of the Ehrhart polynomials. Moreover, through actions of
monoids of characters, we obtain a Twisted bialgebraic interpretation of the
duality principle.
