A Manhattan judge today declined to dismiss a crack-deal case where a fourth of the evidence inexplicably went missing under the care of disgraced NYPD “lab rat” Mariem Megalla.

But the judge allowed the defense lawyer to raise the issue of the vanished crack with jurors when the case of accused Harlem dealer Kasien Adderley goes to trial Wednesday.

Cops had vouchered eight crack rocks — allegedly tossed to the sidewalk by Adderley’s co-defendant — when he was busted outside his W. 111th apartment two Februaries ago.

But more than 200 milligrams was missing — the equivalent of two of the eight rocks — when the evidence was retested as part of the NYPD’s “Megalla Corrective Action,” according to internal police documents.

A full year into the retesting of her lab work, more than 100 errors have been uncovered in the paperwork of some 50 drug cases Megalla worked on, the documents reveal. Meanwhile, Megalla remains on the NYPD payroll — at $69,000 a year — in a non-lab job.

Prosecutors have said they will not call Megalla to the stand in the Adderley case — and instead will call the NYPD criminalist who retested the crack.

“A jury will decide whether they can trust that the evidence was tampered with, or is in the same condition as when it was first received by Megalla,” Adderley’s defense lawyer, Darius Wadia, said after court yesterday.

Adderley — who has an armed robbery and assault record — is battling charges that he was passing drugs and money to two young co-defendants. He insists he was just shaking hands with his little brother’s friend as he left his apartment.