Options
All
  • Public
  • Public/Protected
  • All
Menu

@manufac-analytics/inchi

Index

Type aliases

CheckINCHIKeyReturnCode

CheckINCHIKeyReturnCode: typeof CheckINCHIKeyReturnCode[keyof typeof CheckINCHIKeyReturnCode]

CheckINCHIReturnCode

CheckINCHIReturnCode: typeof CheckINCHIReturnCode[keyof typeof CheckINCHIReturnCode]

GetINCHIReturnCode

GetINCHIReturnCode: typeof GetINCHIReturnCode[keyof typeof GetINCHIReturnCode]

Variables

Const CheckINCHIKeyReturnCode

CheckINCHIKeyReturnCode: { INCHIKEY_INVALID_LAYOUT: 2; INCHIKEY_INVALID_LENGTH: 1; INCHIKEY_INVALID_VERSION: 3; INCHIKEY_VALID_NON_STANDARD: -1; INCHIKEY_VALID_STANDARD: 0 } = ...

Type declaration

  • INCHIKEY_INVALID_LAYOUT: 2
  • INCHIKEY_INVALID_LENGTH: 1
  • INCHIKEY_INVALID_VERSION: 3
  • INCHIKEY_VALID_NON_STANDARD: -1
  • INCHIKEY_VALID_STANDARD: 0

Const CheckINCHIReturnCode

CheckINCHIReturnCode: { INCHI_FAIL_I2I: 4; INCHI_INVALID_LAYOUT: 3; INCHI_INVALID_PREFIX: 1; INCHI_INVALID_VERSION: 2; INCHI_VALID_NON_STANDARD: -1; INCHI_VALID_STANDARD: 0 } = ...

Type declaration

  • INCHI_FAIL_I2I: 4
  • INCHI_INVALID_LAYOUT: 3
  • INCHI_INVALID_PREFIX: 1
  • INCHI_INVALID_VERSION: 2
  • INCHI_VALID_NON_STANDARD: -1
  • INCHI_VALID_STANDARD: 0

Const GetINCHIReturnCode

GetINCHIReturnCode: { inchi_Ret_BUSY: 5; inchi_Ret_EOF: -1; inchi_Ret_ERROR: 2; inchi_Ret_FATAL: 3; inchi_Ret_OKAY: 0; inchi_Ret_SKIP: -2; inchi_Ret_UNKNOWN: 4; inchi_Ret_WARNING: 1 } = ...

Type declaration

  • inchi_Ret_BUSY: 5
  • inchi_Ret_EOF: -1
  • inchi_Ret_ERROR: 2
  • inchi_Ret_FATAL: 3
  • inchi_Ret_OKAY: 0
  • inchi_Ret_SKIP: -2
  • inchi_Ret_UNKNOWN: 4
  • inchi_Ret_WARNING: 1

Functions

CheckINCHI

  • Check if the string represents valid InChI/standard InChI

    example
    const status = CheckINCHI("InChI=1S/C3H5NO/c1-2-5-3-4-1/h3H,1-2H2/p+1", false);
    console.log(status);
    // 0
    

    Parameters

    • input: string

      source InChI string

    • Optional strict: boolean

      (optional) if false, just briefly check for proper layout (prefix, version, etc.)

    Returns CheckINCHIReturnCode

    One amongst -1 , 0 , 1 , 2 , 3 , 4

    • -1: InChI is valid and non-standard
    • 0: InChI is valid and standard
    • 1: InChI has invalid prefix
    • 2: InChI has invalid version number (not equal to 1)
    • 3: InChI has invalid layout
    • 4: Checking InChI through InChI2InChI either failed or produced a result which does not match the source InChI string

CheckINCHIKey

  • Check if the string represents valid InChIKey

    example
    const status = CheckINCHIKey("VNWKTOKETHGBQD-UHFFFAOYSA-N");
    console.log(status);
    // 0
    

    Parameters

    • input: string

      A source InChIKey string

    Returns CheckINCHIKeyReturnCode

    One amongst 1 , 0 , 1 , 2 , 3

    • -1: InChIKey is valid and non-standard
    • 0: InChIKey is valid and standard
    • 1: InChIKey has invalid length
    • 2: InChIKey has invalid layout
    • 3: InChIKey has invalid version number (not equal to 1)

GetStringLength

  • GetStringLength(input: string): number
  • Returns length of the string

    example
    const length = GetStringLength("VNWKTOKETHGBQD-UHFFFAOYSA-N");
    console.log(length);
    // 27
    

    Parameters

    • input: string

      An Inchi string

    Returns number

    length of the string

GetStructFromINCHI

  • This function creates structure from InChI string

    example
    const output = GetStructFromINCHI("InChI=1S/C2H6O/c1-2-3/h3H,2H2,1H3");
    console.log(output.status);
    // 0
    console.log(output.data.atom[0].x);
    // 0
    console.log(output.data.atom[0].y);
    // 0
    console.log(output.data.atom[0].z);
    // 0
    

    Parameters

    • input: string

      An Inchi String

    • Optional options: GetINCHIOptions

      (optional) An object containing chosen options as key and their values as true

    Returns GetStructFromINCHIOutput

    output is an object containing status and data

GetStructFromINCHIEx

  • This extended version of GetStructFromINCHI supports v. 1.05 extensions: polymers and Molfile V3000 (partial support).

    example
    const output = GetStructFromINCHIEx("InChI=1S/C2H6O/c1-2-3/h3H,2H2,1H3");
    console.log(output.status);
    // 0
    console.log(output.data.atom[0].x);
    // 0
    console.log(output.data.atom[0].y);
    // 0
    console.log(output.data.atom[0].z);
    // 0
    

    Parameters

    • input: string

      An Inchi String

    • Optional options: GetINCHIExOptions

      (optional) An object containing chosen options as key and their values as true

    Returns GetStructFromINCHIExOutput

    The data structure inchi_OutputStructEx. It is a superset of inchi_OutputStruct including additional data-substructures carrying an information on polymers and V3000 features.

GetStructFromStdINCHI

  • This is the “standard” counterpart of GetStructFromINCHI

    example
    const output = GetStructFromStdINCHI("InChI=1S/C2H6O/c1-2-3/h3H,2H2,1H3");
    console.log(output.status);
    // 0
    console.log(output.data.atom[0].x);
    // 0
    console.log(output.data.atom[0].y);
    // 0
    console.log(output.data.atom[0].z);
    // 0
    

    Parameters

    • input: string

      An Inchi String

    • Optional options: GetINCHIOptions

      (optional) An object containing chosen options as key and their values as true

    Returns GetStructFromINCHIOutput

    same as GetStructFromINCHI

Generated using TypeDoc