Wetterau Inc., a major St. Louis food wholesaler and manufacturer, has agreed to buy seven local Cook's Supermarkets, and is negotiating to have them run by Magruder Inc., another major independent grocer in the Washington area.

The sale of Cook's, which is expected to be completed in early January, would give Wetterau a substantial foothold in a lucrative food market that recently has attracted food wholesalers and distributors from outside the area.

Neither Cook nor Magruder officials would comment yesterday on the deal, and Wetterau executives could not be reached at the company's corporate offices in Hazelwood, Mo., or at its regional headquarters in Reading, Pa.

Informed industry sources said, however, that Cook's has agreed to sell Wetterau seven of the nine supermarkets that Cook's operates in the Washington area in a transaction estimated to be worth about $6 million. Cook's would continue to operate two of the smaller stores in the chain.

The Cook chain, one of the most successful independent food retailers in the Washington area, is headed by Robert and Bruce S. Cook, brothers who took over the family-owned business in 1963.

Magruder's is expected to lease the seven Cook supermarkets from Wetterau, which would boost the Magruder chain from nine stores to 16. Magruder currently holds a 3.1 percent market share in the Washington area, just ahead of Cook's 2.7 percent share, according to estimates by Food World, a trade publication.

The sale of Cook's to Wetterau and the expansion by Magruder's are not expected to have an impact on the overall competitive picture in the Washington area, where Giant Food Inc. and Safeway Stores dominate the market.

Becoming a major new competitor for food wholesalers and distributors in the Washington-Baltimore area, Wetterau would establish a strong position as a principal supplier for Magruder and other independents, according to industry sources.

"What [Wetterau] is trying to do is gain a foothold in the market," said a knowledgeable source in the food industry. "Wetterau has the financial clout, and it is the party that pulled everything together."

Wetterau is the third-largest food wholesale and distribution company in the United States. The diverse operations of its several divisions include manufacturing frozen food products, food warehousing and distribution, printing and retail grocery sales. It reported revenue of more than $2.3 billion in 1984.

From its regional headquarters in Reading, Wetterau has moved aggressively to expand its share of the Middle Atlantic market, including the purchase of food chains in Pennsylvania and Western Maryland in recent years.

Although it owns several retail grocery stores, Wetterau's primary interest in this market is in expanding its wholesale business, according to several sources. That interest has been heightened by a very competitive environment that has developed among new wholesalers that have flocked to what is generally considered one of the most lucrative markets along the Eastern Seaboard, industry officials agree.

"We've seen several new wholesalers come into this area in recent years, and that entry has been mostly from southern Pennsylvania," observed a knowledgeable industry official. "What has happened in the wholesale business is that, as more opportunities become available, more wholesalers are taking equity positions, rather than just supplying retailers."

Several food chains such as Pantry Pride and Memco have withdrawn from this market in recent years, and many of the stores that they left behind have been taken over by independents such as Cook. Wholesalers, eager to expand their market shares, are positioning to take advantage of opportunities created by the growth of independent food retailers, according to industry observers.