The synonym to get the compound name from.
The compound name from the synonym.
const cmpd = await getCompoundNameFromAlias("2-Acetoxybenzenecarboxylic acid");
console.log(cmpd);
// Outputs: Aspirin
export async function getCompoundNameFromAlias(cmpdsynonym: string): Promise<string | undefined> {
const searchResult = await executeSDQSearch({
where: { cmpdsynonym },
select: ["cid", "cmpdname", "iupacname"],
limit: 1,
});
if (!searchResult) {
return undefined;
}
return searchResult[0].cmpdname;
}
Get the compound name from a synonym.