Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What fingerprint settings does the RDKit Molecule Substructure Filter use? #109

Open
TraceLD opened this issue Jun 16, 2022 · 1 comment

Comments

@TraceLD
Copy link

TraceLD commented Jun 16, 2022

I'm trying to figure out what fingerprint settings the RDKit Molecule Substructure Filter node uses when it pre-calculates fingerprints. I looked at the documentation of the node on KNIME Hub but there's nothing that specifies the fingerprint settings. Does it just use RDKit defaults?, i.e.

The default set of parameters used by the fingerprinter is: - minimum path size: 1 bond - maximum path size: 7 bonds - fingerprint size: 2048 bits - number of bits set per hash: 2 - minimum fingerprint size: 64 bits - target on-bit density 0.0

@manuelschwarze
Copy link
Contributor

The answer is in human-readable form: It uses an 1024 bit Pattern fingerprint (as defined here: https://github.com/rdkit/knime-rdkit/blob/master/org.rdkit.knime.nodes/src/org/rdkit/knime/nodes/rdkfingerprint/FingerprintType.java#L766-L802).

It is defined here in the source code:
https://github.com/rdkit/knime-rdkit/blob/master/org.rdkit.knime.nodes/src/org/rdkit/knime/nodes/moleculesubstructfilter/RDKitMoleculeSubstructFilterNodeModel.java#L177-L179

/** Settings used to calculate fingerprints for pre-screening. */
protected static final FingerprintSettings FINGERPRINT_SETTING =
		new DefaultFingerprintSettings(FingerprintType.pattern.name(), -1, -1, -1, -1, -1, 1024, -1, -1, -1, false);

It is using this class constructor in https://github.com/rdkit/knime-rdkit/blob/master/org.rdkit.knime.nodes/src/org/rdkit/knime/nodes/rdkfingerprint/DefaultFingerprintSettings.java#L130-L151

/**
 * Creates a new bit-based fingerprint settings object with the specified fingerprint type and settings.
 * 
 * @param strType Fingerprint type value. Can be null.
 * @param iTorsionPathLength Torsion min path values. Can be -1 ({@link #UNAVAILABLE}.
 * @param iMinPath Min Path value. Can be -1 ({@link #UNAVAILABLE}.
 * @param iMaxPath Min Path value. Can be -1 ({@link #UNAVAILABLE}.
 * @param iAtomPairMinPath AtomPair Min Path value. Can be -1 ({@link #UNAVAILABLE}.
 * @param iAtomPairMaxPath AtomPair Max Path value. Can be -1 ({@link #UNAVAILABLE}.
 * @param iNumBits Num Bits (Length) value. Can be -1 ({@link #UNAVAILABLE}.
 * @param iRadius Radius value. Can be -1 ({@link #UNAVAILABLE}.
 * @param iLayerFlags Layer Flags value. Can be -1 ({@link #UNAVAILABLE}.
 * @param iSimilarityBits Similarity bits. Can be -1 ({@link #UNAVAILABLE}.
 * @param bUseChirality Use Chirality. Can be null ({@link #UNAVAILABLE}.
 */
public DefaultFingerprintSettings(final String strType, final int iTorsionPathLength, final int iMinPath,
		final int iMaxPath, final int iAtomPairMinPath, final int iAtomPairMaxPath,
		final int iNumBits, final int iRadius, final int iLayerFlags,
		final int iSimilarityBits, final boolean bUseChirality) {
	this(strType, iTorsionPathLength, iMinPath, iMaxPath, iAtomPairMinPath, iAtomPairMaxPath,
			iNumBits, iRadius, iLayerFlags, iSimilarityBits, bUseChirality, false, null, false);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants