ChemPlot icon indicating copy to clipboard operation
ChemPlot copied to clipboard

Is it possible to change the default finger print size ?

Open Kohulan opened this issue 3 years ago • 4 comments

Hi @mcsorkun , Hi @dajtmullaj ,

When we initiate the Plotter with a given data it always tends to generate an ECFP fingerprint size of 2048. Is it possible to modify the fingerprint size before generating the fingerprints for a given dataset?

Kohulan avatar Mar 30 '23 12:03 Kohulan

@Kohulan I apologize for the late reply. ChemPlot currently does not offer a straightforward way to modify the fingerprint size. However a way to obtain your desired results is the following; create a "wrapper" function on get_ecfp():

from chemplot.descriptors import get_ecfp

CUSTOM_RADIUS = ...
CUSTOM_SIZE = ...

def custom_get_ecfp(smiles_list, target, default_ChemPlot_radius, default_ChemPlot_size):
    return get_ecfp(smiles_list, target, CUSTOM_RADIUS, CUSTOM_SIZE)

You can then build a Plotter object using its constructor:

from chemplot import Plotter
from chemplot.descriptors import get_mordred_descriptors

Plotter(smiles_list, target, target_type, sim_type, get_mordred_descriptors, custom_get_ecfp)

Here target can be empty and target_type, sim_type can be null.

dajtmullaj avatar Dec 13 '24 00:12 dajtmullaj

Hi @dajtmullaj , thanks for the reply and workaround description! What do you think of @Kohulan 's PR that introduces this option directly in ChemPlot https://github.com/mcsorkun/ChemPlot/pull/21 ?

JonasSchaub avatar Dec 13 '24 10:12 JonasSchaub

Hi @JonasSchaub! I went through the PR! Thank you for contributing to the project. "Clean-up" changes, like dependencies versions, have been addressed in the latest release (1.3.1). Regarding the changes introducing more customization to the fingerprint generation, we are pretty exited about it! We have gotten some requests for making also the descriptors generation more customizable. Hence we are discussing a possible new release where we open up descriptor and fingerprint customization and what is the best way to do it, while trying to keep the library simple!

dajtmullaj avatar Dec 14 '24 13:12 dajtmullaj

@dajtmullaj I'm always in favour of more customisability, looking forward to the new developments!

JonasSchaub avatar Dec 16 '24 08:12 JonasSchaub