The major component of the outer leaflet of the outer membrane of Gram-negative bacteria is lipopolysaccharide (LPS). The outermost domain of LPS is a polysaccharide called O antigen. Pseudomonas aeruginosa establishes biofilms on wet surfaces in a wide range of habitats and mutations in O-antigen biosynthesis genes affect bacterial adhesion and the structure of these biofilms. The P. aeruginosa O6 O antigen contains a 2-acetamido-2-deoxy-d-galacturonamide (d-GalNAcAN) residue. O-antigen biosynthesis in this serotype requires the wbpS gene, which encodes a protein with conserved domains of the glutamine-dependent amidotransferase family. Replacement of conserved amino acids in the N-terminal glutaminase conserved domain of WbpS inhibited O-antigen biosynthesis under restricted-ammonia conditions, but not in rich media; suggesting that this domain functions to provide ammonia for O-antigen biosynthesis under restricted-ammonia conditions, by hydrolysis of glutamine. Escherichia coli O121 also produces a d-GalNAcAN-containing O antigen, and possesses a homologue of wbpS called wbqG. An E. coli O121 wbqG mutant was cross-complemented by providing wbpS in trans, and vice versa, showing that these two genes are functionally interchangeable. The E. coli O121 wbqG mutant O antigen contains 2-acetamido-2-deoxy-d-galacturonate (d-GalNAcA), instead of d-GalNAcAN, demonstrating that wbqG is specifically required for biosynthesis of the carboxamide in this sugar.