Methylecgonidine
Methylecgonidine (anhydromethylecgonine; anhydroecgonine methyl ester; AEME) is a chemical intermediate derived from ecgonine or cocaine. Methylecgonidine is a pyrolysis product formed when crack cocaine is smoked, making this substance a useful biomarker to specifically test for use of crack cocaine, as opposed to powder cocaine which does not form methylecgonidine as a metabolite. Methylecgonidine has a relatively short half-life of 18–21 minutes, after which it is metabolised to ecgonidine, meaning that the relative concentrations of the two compounds can be used to estimate how recently crack cocaine has been smoked. Methylecgonidine has been shown to be specifically more harmful to the body than other byproducts of cocaine; for example to the heart, lungs &  liver. The toxicity is due to a partial agonist effect at M1 and M3 muscarinic receptors, leading to DNA fragmentation and neuronal death by apoptosis. AEME is also used in scientific research for the manufacture of phenyltropane analogues such as troparil, dichloropane, iometopane, and CFT. Methylecgonidine could also theoretically be used to produce cocaine and so may be a controlled substance in some countries. Synthesis

Methylecgonidine can be synthesized non pyrolytically from cocaine via hydrolysis/dehydration followed by esterification with methanol. The scheme by Kline is based on the reaction of 2,4,6-cycloheptatriene-7-carboxylic acid with methylamine. This is a modified version of  by Grundmann and Ottmann. In the accompanying patent  these same authors react their methylecgonidine with two equivalents of PhLi to form a tertiary alcohol by "hard" addition to the ester and not "soft" Michael addition. However, the product is only one tenth the potency of atropine. The methyl 2,4,6-cycloheptatriene-1-carboxylate can be made synthetically. Davies et al. synthesized (R/S)-methylecgonidine by a tandem cyclopropanation/Cope rearrangement. Thus, reaction of methyldiazobutenoate (2) with 5 equiv of N-((2-(TMS)ethoxy)carbonyl)pyrrole (1) in the presence of rhodium(II) hexanoate/hexane gave the [3.2.1]-azabicyclic system (R/S)-8 in 62% yield. The unsubstituted double bond was selectively reduced using Wilkinson catalyst to provide N-protected anhydroecgonine methyl ester ((R/S)-4). Following deprotection of N8 nitrogen with TBAF and reductive methylation with formaldehyde and sodium cyanoborohydride, (R/S)-5 was obtained in overall good yield. See also 
 Arecoline
 Anatoxin-a
 Tropacocaine

References 

Tropane alkaloids
Cycloalkenes
Methyl esters