{"id":29625214,"url":"https://github.com/novartis/chemicalseriesreconstruction","last_synced_at":"2025-07-21T06:07:40.227Z","repository":{"id":255972744,"uuid":"852921015","full_name":"Novartis/ChemicalSeriesReconstruction","owner":"Novartis","description":"25 Years of Small-Molecule Optimization at Novartis: A Retrospective Analysis of Chemical Series Evolution","archived":false,"fork":false,"pushed_at":"2024-09-08T07:00:27.000Z","size":109,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-09-08T08:20:41.142Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Novartis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-05T16:55:35.000Z","updated_at":"2024-09-08T07:00:30.000Z","dependencies_parsed_at":"2024-09-08T08:20:42.006Z","dependency_job_id":null,"html_url":"https://github.com/Novartis/ChemicalSeriesReconstruction","commit_stats":null,"previous_names":["novartis/chemicalseriesreconstruction"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Novartis/ChemicalSeriesReconstruction","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Novartis%2FChemicalSeriesReconstruction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Novartis%2FChemicalSeriesReconstruction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Novartis%2FChemicalSeriesReconstruction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Novartis%2FChemicalSeriesReconstruction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Novartis","download_url":"https://codeload.github.com/Novartis/ChemicalSeriesReconstruction/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Novartis%2FChemicalSeriesReconstruction/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266248501,"owners_count":23899056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-21T06:07:39.637Z","updated_at":"2025-07-21T06:07:40.219Z","avatar_url":"https://github.com/Novartis.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ChemicalSeriesReconstruction\n\nThis is a command line software tool for automated identification of chemical series in sets of molecules, which is adjusted for dealing with larger amounts of data by means of a farthest-first pre-clustering. Additionally, an option for determining times active phases as well as the possibility to determine multi-scaffold series is implemented here.\n\nThis code was used to reconstruct the historical chemical series at Novartis, as published in \n\n**25 Years of Small-Molecule Optimization at Novartis: A Retrospective Analysis of Chemical Series Evolution**\n\nMaximilian Beckers et al., *Journal of Chemical Information and Modelling (2023)*  https://pubs.acs.org/doi/full/10.1021/acs.jcim.2c00785\n\n\n\n**Dependencies**\n\nNumPy, SciPy, scikit-learn, Numba, Pandas and RDKit. Arthor (https://www.nextmovesoftware.com/) will be used when available to speed up the calculations, otherwise the RDKit substructure functionalities will be used.\n\n**Structure of input data**\n\nAs input a comma separated txt-file needs to be provided. For the chemical series identification, a column of SMILES strings is required (Default column name is \"Structure\", but the actual column name can be given with the flag -column_name). For the active phase determination, we require a column with the registration dates of the compounds. As default, the date column needs to be named \"First Reg Date\", but the name of the date column can be given with the flag -date_column, and the dates have to be specified as \"yyyy-mm-dd\", e.g. \"1998-12-31\".\n\n## How to run the commandline interface ##\n\n***Preliminaries***\n\nBefore running the actual series reconstruction the first time, the ChEMBL substructure library will be setup. This will happen automatically when running the first time and will take some time to download the ChEMBL and to prepare a local file of the substructure library. This needs only be done once, so if the substructure library is generated, it will be used in all future runs of the series identification.\n\n***Running the series identification***\n\nTo run the algorithm, just run *chemical_series_reconstruction.py* with python3. Please make sure, all the required packages are installed. The only required input is the list of compounds, which has to be provided with the flag *-data*. \n\nThe following options are available:\n\n    Required:\n \n    -data      A txt-file as described above that contains the SMILES of the compounds and optionally also the registration dates. The name of the column can be given with the flag -smiles_column (see below, Default: \"Structure\")\n\n    Optional:\n\n    -flimit     The specificity limit for the scaffolds. The smaller, the more specific (Default: 0.002)\n    -min_series_size     The minimum number of compounds that is required for defining a chemical series. (Default: 10)\n    -smiles_column       Name of the column that contains the smiles of the compounds. (Default: \"Structure\").\n    -jaccard_similarity_threshold        Threshold of the Jaccard similarity for merging the series. If none, scaffolds will not be merged (Default: None)\n    -scaffolds     A txt-file containing a single column of SMARTS strings of the scaffolds (Default: None)\n    -size_sliding_window     Size of the sliding window, given as the number of days, in which compounds are summed up for determination of the active times of a series, i.e. when the series is actively worked on. If the number of compounds in the sliding window exceeds min-series-size, then we say that the respective days are active times. (If not given, then no active times determination will be done) (Default: None)\n    -date_column         Name of the column that contains the registration dates of the compounds. This is used for determining active phases of a chemical series (Default: \"First Reg Date\").\n    -gpu  This flag will enable usage of the GPU. CUDA needs to be available. For setup of CUDA see http://numba.pydata.org/numba-doc/latest/cuda/overview.html#requirements\n\nThe following lines of code give an example of a run with default settings:\n\n    $ python -u chemical_series_reconstruction.py -data data.csv\n\nAnother example with increased specificity limit and also determination of the active phases can be:\n\n    $ python -u chemical_series_reconstruction.py -data data.csv -flimit 0.00001 -size_sliding_window 365\n\nAnd last an example with the possibility of multi-scaffold series combined with active phase determination, which will be done on the multi-scaffold series:\n\n    $ python -u chemical_series_reconstruction.py -data data.csv -flimit 0.00001 -size_sliding_window 365 -jaccard_similarity_threshold 0.5\n\n***Output***\n\nOutput of the program is a txt-file with the same columns as the input file and has the name \"UPGMA.csv\". Additionally, the chemical series identifier of each compound is given in the column \"Class\". If multi-scaffold series are determined using the jaccard-similarity merging, the scaffold IDs are provided in the column \"Scaffold ID\". The information about the scaffolds is found in the file \"scaffolds.csv\".\nIf the active times are calculated as well, then the active series identifiers are given in the column \"Class (Active)\". \nAs a compound can be member of multiple series, a compound will appear multiple times in the output table in such cases. In other words, the output table is in long format.  \n    \n\n## How to run the library ##\n\nJust import the module and run the series identification in Python by\n\n    from ChemicalSeriesReconstruction import ChemicalSeriesReconstruction\n    series = ChemicalSeriesReconstruction(smiles_list, min_cluster_size, flimit, scaffolds, dates, size_sliding_window, jaccard_similarity_threshold);\n\nand then access the results by\n\n    # This is the pandas dataframe of the series data, same as \"UPGMA.csv\"\n    series.series_data\n\n    # This is the pandas dataframe f the scaffold data, similar to \"scaffolds.csv\"\n    series.mcs_data\n\nThe parameters are the same as for the command line tool described above. The compounds are provided as a list of SMILES. E.g. \n\n    smiles_list = LIST_OF_SMILES;\n    min_cluster_size = 10;\n    flimit = 0.001;\n    scaffolds = None;\n    dates = None;\n    size_sliding_window = None;\n    jaccard_similarity_threshold = None; \n    use_gpu = False;\n\nIf active phases should be determined, registration dates should be provided as a list of dates in \"dates\" and the size of the sliding window has to be specified in \"size_sliding_window\".\n\n## Testing the code ##\n\nA few test cases have been implemented to check validity of the results. The tests can be run from the main directory of this package using the unittest module by\n    \n    python -m unittest","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnovartis%2Fchemicalseriesreconstruction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnovartis%2Fchemicalseriesreconstruction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnovartis%2Fchemicalseriesreconstruction/lists"}