InChIKey_test: Test whether InChIKey follows valid format

Description Usage Arguments Value Author(s) See Also Examples

View source: R/ChemicalCuration.R

Description

This basic function using string manipulation to test whether an InChIKey is in the expected format. Useful to detect conversions and retrieval results. This function checks if the string contains 27 characters and 2 dashes/3 blocks.

Usage

1
InChIKey_test(InChIKey)

Arguments

InChIKey

InChIKey to test.

Value

Returns TRUE or FALSE (fails test).

Author(s)

Emma Schymanski <emma.schymanski@uni.lu>

See Also

getSuspectInChIKey.

Examples

1
2
3
4
5
CactusKey <- getCactus("benzene","stdinchikey")
InChIKey_test(CactusKey)
CactusKey <- trimKey(CactusKey)
InChIKey_test(CactusKey)
InChIKey_test("UHOVQNZJYSORNB-UHFFFAOYSA-N")

schymane/RChemMass documentation built on Jan. 25, 2021, 5:45 a.m.