matchms.filtering.metadata_processing.add_fingerprint module
- matchms.filtering.metadata_processing.add_fingerprint.add_fingerprint(spectrum_in: Spectrum | None, fingerprint_type: str = 'daylight', nbits: int = 2048, clone: bool | None = True) Spectrum | None[source]
Add molecular finterprint to spectrum.
If smiles or inchi present in metadata, derive a molecular finterprint and add it to the spectrum.
- Parameters:
spectrum_in – Input spectrum.
fingerprint_type – Determine method for deriving molecular fingerprints. Supported choices are “daylight”, “morgan1”, “morgan2”, “morgan3”. Default is “daylight”.
nbits – Dimension or number of bits of generated fingerprint. Default is 2048.
clone – Optionally clone the Spectrum.
- Returns:
Spectrum with added fingerprint derived from SMILES or INCHI, or None if not present.
- Return type:
Spectrum or None