Interface JSMol

Represents a molecule object generated by RDKit.js

JSMol's are created using the RDKitModule.get_mol() methods.

interface JSMol {
    add_hs(): string;
    condense_abbreviations(): string;
    condense_abbreviations(maxCoverage: number, useLinkers: boolean): string;
    condense_abbreviations_from_defs(definitions: string, maxCoverage: number, useLinkers: boolean): string;
    delete(): void;
    draw_to_canvas(canvas: HTMLCanvasElement, width: number, height: number): void;
    draw_to_canvas_with_highlights(canvas: HTMLCanvasElement, details: string): void;
    draw_to_canvas_with_offset(canvas: HTMLCanvasElement, offsetx: number, offsety: number, width: number, height: number): void;
    generate_aligned_coords(templateMol: JSMol, options: string): string;
    get_aromatic_form(): string;
    get_as_uint8array(): Uint8Array;
    get_cxsmarts(): string;
    get_cxsmiles(): string;
    get_descriptors(): string;
    get_inchi(): string;
    get_json(): string;
    get_kekule_form(): string;
    get_molblock(): string;
    get_morgan_fp(): string;
    get_morgan_fp(options: string): string;
    get_morgan_fp_as_binary_text(): string;
    get_morgan_fp_as_binary_text(radius: number, len: number): string;
    get_morgan_fp_as_uint8array(): Uint8Array;
    get_morgan_fp_as_uint8array(options: string): Uint8Array;
    get_new_coords(): string;
    get_new_coords(useCoordGen: boolean): string;
    get_pattern_fp(): string;
    get_pattern_fp(options: string): string;
    get_pattern_fp_as_binary_text(): string;
    get_pattern_fp_as_binary_text(len: number): string;
    get_pattern_fp_as_uint8array(): Uint8Array;
    get_pattern_fp_as_uint8array(options: string): Uint8Array;
    get_pickle(): string;
    get_prop(key: string): string;
    get_prop_list(): string[];
    get_prop_list(includePrivate: boolean): string[];
    get_prop_list(includePrivate: boolean, includeComputed: boolean): string[];
    get_smarts(): string;
    get_smiles(): string;
    get_stereo_tags(): string;
    get_substruct_match(q: JSMol): string;
    get_substruct_matches(q: JSMol): string;
    get_svg(): string;
    get_svg(width: number, height: number): string;
    get_svg_with_highlights(details: string): string;
    get_v3Kmolblock(): string;
    has_coords(): boolean;
    has_prop(key: string): boolean;
    is_valid(): boolean;
    normalize_depiction(): number;
    normalize_depiction(canonicalize: number): number;
    normalize_depiction(canonicalize: number, scaleFactor: number): number;
    remove_hs(): string;
    set_new_coords(): boolean;
    set_new_coords(useCoordGen: boolean): boolean;
    set_prop(key: string, val: string): boolean;
    set_prop(key: string, val: string, computed: boolean): boolean;
    straighten_depiction(): void;
}

Methods

  • Add explicit hydrogens

    Returns string

    V2000 Molfile string with explicit hydrogens

  • Returns string

  • Parameters

    • maxCoverage: number
    • useLinkers: boolean

    Returns string

  • Parameters

    • definitions: string
    • maxCoverage: number
    • useLinkers: boolean

    Returns string

  • Delete C++ mol objects manually from memory

    See Emscripten docs for more details

    Returns void

  • Draw the molecule to an HTML5 canvas

    Parameters

    • canvas: HTMLCanvasElement

      canvas ID

    • width: number

      width in pixels

    • height: number

      height in pixels

    Returns void

  • Draw the molecule to an HTML5 canvas, with atom highlights

    Parameters

    Returns void

  • Draw the molecule to an HTML5 canvas with an offset

    Parameters

    • canvas: HTMLCanvasElement

      canvas ID

    • offsetx: number

      offset X in pixels

    • offsety: number

      offset Y in pixels

    • width: number

      width in pixels

    • height: number

      height in pixels

    Returns void

  • Aligns molecule with the template. you can also specify the following options (passed as a stringified JSON object)

    Parameters

    • templateMol: JSMol
    • options: string

    Returns string

  • Returns the V2000 Molfile representation of the aromatic form of the molecule

    Returns string

  • Returns an unsigned integer array representation

    Returns Uint8Array

  • Returns the Chemaxon Extended SMARTS string

    Returns string

  • Returns the Chemaxon Extended SMILES string

    Returns string

  • Returns a stringified JSON object of molecular descriptors

    Returns string

  • Return the InChI string

    Returns string

  • Returns the JSON representation

    Returns string

  • Returns the V2000 Molfile representation of the kekule form of the molecule

    Returns string

  • Returns the V2000 Molfile string

    Returns string

  • Returns the Morgan fingerprint as string

    Returns string

  • Returns the Morgan fingerprint as string.

    You can also specify the following options (passed as a stringified JSON object)

    Parameters

    • options: string

    Returns string

  • Returns the Morgan fingerprint as binary

    Returns string

  • Returns the Morgan fingerprint as binary

    Parameters

    • radius: number

      fingerprint radius

    • len: number

      fingerprint length

    Returns string

  • Returns the Morgan fingerprint as an unsigned integer array

    Returns Uint8Array

  • Returns the Morgan fingerprint as an unsigned integer array

    You can also specify the following options (passed as a stringified JSON object)

    Parameters

    • options: string

    Returns Uint8Array

  • Return a V2000 Molfile string with newly generated coordinates

    Returns string

  • Return a V2000 Molfile string with newly generated coordinates

    Parameters

    • useCoordGen: boolean

      use the CoordGen algorithm

    Returns string

  • Returns the pattern fingerprint as string

    Returns string

  • Returns the pattern fingerprint as string

    you can also specify the following options (passed as a stringified JSON object)

    Parameters

    • options: string

    Returns string

  • Returns the pattern fingerprint as binary

    Returns string

  • Returns the pattern fingerprint as binary

    Parameters

    • len: number

      fingerprint length

    Returns string

  • Returns the pattern fingerprint as an unsigned integer array

    Returns Uint8Array

  • Returns the pattern fingerprint as an unsigned integer array

    you can also specify the following options (passed as a stringified JSON object)

    Parameters

    • options: string

    Returns Uint8Array

  • Returns the pickled string representation of the molecule

    Returns string

  • Get a property on the molecule

    Parameters

    • key: string

      property name

    Returns string

  • Returns the list of property names

    Returns string[]

  • Returns the list of property names

    Parameters

    • includePrivate: boolean

      set to true to include private properties

    Returns string[]

  • Returns the list of property names

    Parameters

    • includePrivate: boolean

      set to true to include private properties

    • includeComputed: boolean

      set to true to include computed properties

    Returns string[]

  • Returns the SMARTS string

    Returns string

  • Returns the SMILES string

    Returns string

  • Returns a stringified JSON object containing the atoms and bonds of stereo centers

    Returns string

  • Returns a substructure match string

    Parameters

    Returns string

    A stringified JSON object containing the matched atoms and bonds of the parent molecule

  • Returns all substructure matches

    Parameters

    Returns string

    A stringified JSON object containing the matched atoms and bonds of the parent molecule

  • Returns an SVG of the molecule

    Returns string

  • Returns an SVG of the molecule

    Parameters

    • width: number

      Width in pixels

    • height: number

      Height in pixels

    Returns string

  • Returns an SVG of the molcule, with atoms highlighted

    Parameters

    Returns string

  • Returns the V3000 Molfile string

    Returns string

  • Check is the molecule has any 2D coordinates generated

    Returns boolean

  • Check whether the molecule has a certain property

    Parameters

    • key: string

      property name

    Returns boolean

  • Returns true if the molecule's structure is valid

    Returns boolean

  • Returns number

  • Parameters

    • canonicalize: number

    Returns number

  • Parameters

    • canonicalize: number
    • scaleFactor: number

    Returns number

  • Remove explicit hydrogens

    Returns string

    V2000 Molfile string without explicit hydrogens

  • Generate new 2D coordinates

    Returns boolean

  • Generate new 2D coordinates

    Parameters

    • useCoordGen: boolean

      use the CoordGen algorithm

    Returns boolean

  • Sets a property on the molecule

    Parameters

    • key: string

      property name

    • val: string

      property value

    Returns boolean

  • Sets a property on the molecule

    Parameters

    • key: string

      property name

    • val: string

      property value

    • computed: boolean

      set true to flag the value as computed

    Returns boolean

  • Returns void