Phosphoribosylformylglycinamidine synthase involved in the purines biosynthetic pathway (PubMed:967158). Catalyzes the ATP-dependent conversion of formylglycinamide ribonucleotide (FGAR) and glutamine to yield formylglycinamidine ribonucleotide (FGAM) and glutamate (PubMed:967158). ATP + H2O + L-glutamine + N(2)-formyl-N(1)-(5-phospho-beta-D-ribosyl)glycinamide = 2-formamido-N(1)-(5-O-phospho-beta-D-ribosyl)acetamidine + ADP + H(+) + L-glutamate + phosphate Purine metabolism; IMP biosynthesis via de novo pathway; 5-amino-1-(5-phospho-D-ribosyl)imidazole from N(2)-formyl-N(1)-(5-phospho-D-ribosyl)glycinamide: step 1/2. In the N-terminal section; belongs to the FGAMS family.