Demethylsterigmatocystin 6-O-methyltransferase; part of the gene cluster that mediates the biosynthesis of aflatoxins, a group of polyketide-derived furanocoumarins, and part of the most toxic and carcinogenic compounds among the known mycotoxins (PubMed:15006741). The four major aflatoxins produced by A.parasiticus are aflatoxin B1 (AFB1), aflatoxin B2 (AFB2), aflatoxin G1 (AFG1) and aflatoxin G2 (AFG2) (PubMed:15006741). The first step of the pathway is the conversion of acetate to norsolorinic acid (NOR) and requires the fatty acid synthase subunits aflA and aflB, as well as the PKS aflC (PubMed:15006741). AflC combines a hexanoyl starter unit and 7 malonyl-CoA extender units to synthesize the precursor NOR (PubMed:18403714). The hexanoyl starter unit is provided to the acyl-carrier protein (ACP) domain by the fungal fatty acid synthase aflA/aflB (PubMed:16256699). The second step is the conversion of NOR to averantin (AVN) and requires the norsolorinic acid ketoreductase aflD, which catalyzes the dehydration of norsolorinic acid to form (1'S)-averantin (PubMed:10584035). The norsolorinic acid reductases aflE and aflF may also play a role in the conversion of NOR to AVN (PubMed:15006741). The cytochrome P450 monooxygenase aflG then catalyzes the hydroxylation of AVN to 5'hydroxyaverantin (HAVN) (PubMed:8368836). The next step is performed by the 5'-hydroxyaverantin dehydrogenase aflH that transforms HAVN to 5'-oxoaverantin (OAVN) which is further converted to averufin (AVF) by aflK that plays a dual role in the pathway, as a 5'-oxoaverantin cyclase that mediates conversion of 5'-oxoaverantin, as well as a versicolorin B synthase in a later step in the pathway (PubMed:15006741, PubMed:11055914, PubMed:15932995). The averufin oxidase aflI catalyzes the conversion of AVF to versiconal hemiacetal acetate (VHA) (PubMed:15006741). VHA is then the substrate for the versiconal hemiacetal acetate esterase aflJ to yield versiconal (VAL) (PubMed:15006741). Versicolorin B synthase aflK then converts VAL to versicolorin B (VERB) by closing the bisfuran ring of aflatoxin which is required for DNA-binding, thus giving to aflatoxin its activity as a mutagen (PubMed:15006741, PubMed:8368837, PubMed:15932995). Then, the activity of the versicolorin B desaturase aflL leads to versicolorin A (VERA) (PubMed:15006741, PubMed:8368837). A branch point starts from VERB since it can also be converted to dihydrodemethylsterigmatocystin (DMDHST), probably also by aflL, VERA being a precursor for aflatoxins B1 and G1, and DMDHST for aflatoxins B2 and G2 (PubMed:15006741). Next, the versicolorin reductase aflM and the cytochrome P450 monooxygenase aflN are involved in conversion of VERA to demethylsterigmatocystin (DMST) (PubMed:15006741, PubMed:1339261, PubMed:15771506). AflX and aflY seem also involved in this step, through probable aflX-mediated epoxide ring-opening step following versicolorin A oxidation and aflY-mediated Baeyer-Villiger oxidation required for the formation of the xanthone ring (PubMed:16332900, PubMed:16461654). The methyltransferase aflO then leads to the modification of DMST to sterigmatocystin (ST), and of DMDHST to dihydrosterigmatocystin (DHST) (PubMed:10543813, PubMed:10806361, PubMed:16349476). Both ST and DHST are then substrates of the O-methyltransferase aflP to yield O-methylsterigmatocystin (OMST) and dihydro-O-methylsterigmatocystin (DHOMST), respectively (PubMed:8434913). Finally OMST is converted to aflatoxins B1 and G1, and DHOMST to aflatoxins B2 and G2, via the action of several enzymes including O-methylsterigmatocystin oxidoreductase aflQ, the cytochrome P450 monooxygenase aflU, but also the NADH-dependent flavin oxidoreductase nadA which is specifically required for the synthesis of AFG1 (PubMed:15006741, PubMed:11996570, PubMed:15528514, PubMed:18486503). 6-demethylsterigmatocystin + S-adenosyl-L-methionine = H(+) + S-adenosyl-L-homocysteine + sterigmatocystin Optimum pH is 6.5-9.0. Mycotoxin biosynthesis; aflatoxin biosynthesis. Belongs to the class I-like SAM-binding methyltransferase superfamily. Cation-independent O-methyltransferase family. COMT subfamily. The predicted gene P875_00052999 has been split into 2 genes: P875_00052999-1 (aflP) and P875_00052999-2 (aflO).