A federal judge took the witness stand during a secret hearing in U.S. District Court Wednesday and flatly denied an allegation by a police informant that he saw the judge about a year ago at the home of a Washington physician who later appeared before the judge as a defendant in a criminal case.

Judge Barrington D. Parker, under questioning by U.S. Attorney Charles F.C. Ruff, testifed he did not know the informant, Nathaniel Lee Edwards, and said he could "state without fear of contradiction" that he had not been in the house at 77 G St. SW that is owned by the physician, Dr. Marshall D. Nickerson Jr.

Nickerson pleaded quilty before Parker to one count of mail fraud and a drug distribution charge in December 1979. Last February, Parker sentenced Nickerson to serve six months in jail. Edwards currently in prison after a second-degree murder conviction, is the government's key witness against a third man, Martin A. Bramson.

Bramson was scheduled to stand trial before Parker this week on conspiracy and drug distribution charges. The government contends that Bramson, who operates a pharmacy at 2802 Rhode Island Ave., NE, filled prescriptions for Edwards that were written by Nickerson. Nickerson is not charged in connection with the Bramson case.

According to a transcript of the closed proceeding, Ruff said the purpose of the hearing was to determine whether it would be appropriate for Parker to remain on the Bramson case "whatever the truth or falsity" of Edwards' claim. The hearing was conducted Wednesday by Judge John Lewis Smith, Jr., who was acting thatday as chief judge of the federal court. Parker released a copy of a transcript of the hearing yesterday.

At the close of the hearing, Smith said the matter was obviously "a case of mistaken identity and I question somewhat the source," according to the transcript. Smith said he saw no reason why Parker should remove himself from the Bramson case.

In addition to Parker, Smith heard testimony from Edwards, two District police investigators, and an attorney whom Edwards also alleged was present the same evening at Nickerson's house in the spring of 1979. The attorney denied Edwards' allegation. The witnesses were also questioned by Bramson's lawyers, Robert Howie and Herbert Harmon.

Parker is expected to conduct another hearing Monday in the Bramson case.