MASSA-Algorithm 2.0.0__tar.gz → 2.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. {massa_algorithm-2.0.0 → massa_algorithm-2.2.0}/MASSA_Algorithm/MASSA.py +4 -1
  2. {massa_algorithm-2.0.0 → massa_algorithm-2.2.0}/MASSA_Algorithm/MASSAlogos.py +2 -2
  3. {massa_algorithm-2.0.0 → massa_algorithm-2.2.0}/MASSA_Algorithm/MASSAopen_files.py +14 -14
  4. {massa_algorithm-2.0.0 → massa_algorithm-2.2.0}/MASSA_Algorithm.egg-info/PKG-INFO +180 -167
  5. {massa_algorithm-2.0.0 → massa_algorithm-2.2.0}/MASSA_Algorithm.egg-info/requires.txt +1 -1
  6. {massa_algorithm-2.0.0 → massa_algorithm-2.2.0}/PKG-INFO +180 -167
  7. {massa_algorithm-2.0.0 → massa_algorithm-2.2.0}/README.md +5 -4
  8. {massa_algorithm-2.0.0 → massa_algorithm-2.2.0}/setup.cfg +4 -4
  9. {massa_algorithm-2.0.0 → massa_algorithm-2.2.0}/setup.py +2 -2
  10. {massa_algorithm-2.0.0 → massa_algorithm-2.2.0}/LICENSE +0 -0
  11. {massa_algorithm-2.0.0 → massa_algorithm-2.2.0}/MANIFEST.in +0 -0
  12. {massa_algorithm-2.0.0 → massa_algorithm-2.2.0}/MASSA_Algorithm/MASSAargs.py +0 -0
  13. {massa_algorithm-2.0.0 → massa_algorithm-2.2.0}/MASSA_Algorithm/MASSAcluster.py +0 -0
  14. {massa_algorithm-2.0.0 → massa_algorithm-2.2.0}/MASSA_Algorithm/MASSAdescriptors.py +0 -0
  15. {massa_algorithm-2.0.0 → massa_algorithm-2.2.0}/MASSA_Algorithm/MASSAextraction.py +0 -0
  16. {massa_algorithm-2.0.0 → massa_algorithm-2.2.0}/MASSA_Algorithm/MASSAmoloutput.py +0 -0
  17. {massa_algorithm-2.0.0 → massa_algorithm-2.2.0}/MASSA_Algorithm/MASSAod.py +0 -0
  18. {massa_algorithm-2.0.0 → massa_algorithm-2.2.0}/MASSA_Algorithm/MASSApreparation.py +0 -0
  19. {massa_algorithm-2.0.0 → massa_algorithm-2.2.0}/MASSA_Algorithm/MASSAsplit.py +0 -0
  20. {massa_algorithm-2.0.0 → massa_algorithm-2.2.0}/MASSA_Algorithm/__init__.py +0 -0
  21. {massa_algorithm-2.0.0 → massa_algorithm-2.2.0}/MASSA_Algorithm/pyMASSA.py +0 -0
  22. {massa_algorithm-2.0.0 → massa_algorithm-2.2.0}/MASSA_Algorithm.egg-info/SOURCES.txt +0 -0
  23. {massa_algorithm-2.0.0 → massa_algorithm-2.2.0}/MASSA_Algorithm.egg-info/dependency_links.txt +0 -0
  24. {massa_algorithm-2.0.0 → massa_algorithm-2.2.0}/MASSA_Algorithm.egg-info/entry_points.txt +0 -0
  25. {massa_algorithm-2.0.0 → massa_algorithm-2.2.0}/MASSA_Algorithm.egg-info/top_level.txt +0 -0
@@ -1,3 +1,4 @@
1
+ import time
1
2
  from MASSA_Algorithm import MASSAlogos
2
3
  from MASSA_Algorithm import MASSAargs
3
4
  from MASSA_Algorithm import MASSAod
@@ -8,7 +9,8 @@ from MASSA_Algorithm import MASSApreparation
8
9
  from MASSA_Algorithm import MASSAcluster
9
10
  from MASSA_Algorithm import MASSAsplit
10
11
  from MASSA_Algorithm import MASSAmoloutput
11
- import time
12
+ from joblib import parallel_backend
13
+
12
14
 
13
15
 
14
16
  def returns_zero(total, test, validation):
@@ -49,6 +51,7 @@ def main():
49
51
  Main subroutine, allows the program to run directly from
50
52
  the command line when installed via pip.
51
53
  """
54
+ parallel_backend('multiprocessing')
52
55
  # Initializing from the command line.
53
56
  # Print the program logo:
54
57
  MASSAlogos.initial_print()
@@ -20,7 +20,7 @@ def initial_print():
20
20
  ██░░░▓▓▓▓░░░░░░░▓▓▓▓░░░░░░░▓▓▓▓░░░░█
21
21
  ██░░░░▓▓▓▓▓▓░░░░░▓▓▓▓▓▓░░░░░▓▓▓▓▓▓░░░░█ MASSA Algorithm:
22
22
  ████░░░░░▓▓▓▓░░░░░░░▓▓▓▓░░░░░░░▓▓▓▓░░░░░█████ Molecular data set sampling — Training-Test Separation
23
- █▓▓▓███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░███▓▓▓█ Version: v. 2.0.0
23
+ █▓▓▓███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░███▓▓▓█ Version: v. 2.2.0
24
24
  █▒▓▓▒▒▒████░░░░░░░░░░░░░░░░░░░░░░░░░░░░████▒▒▓▓▒█
25
25
  ██▓▒▒▒▓▓▓▓██████████████████████████████▓▓▓▒▒▒▒▓█ Developed by: Gabriel Corrêa Veríssimo
26
26
  ██▒▒▒▓▓▒▒▒▒▓▓▒▒▒▒▓▓▒▒▒▒▒▒▒▒▒▒▒▒▓▓▒▒▒▒▓▓▒▒▒▓▓▒▒██ LICENSE: AGPL-3.0
@@ -31,4 +31,4 @@ def initial_print():
31
31
 
32
32
 
33
33
  def python_logo():
34
- print("🍕 MASSA Algorithm v. 2.0.0: Molecular data set sampling")
34
+ print("🍕 MASSA Algorithm v. 2.2.0: Molecular data set sampling")
@@ -50,33 +50,33 @@ def find_name_column(columns):
50
50
  Returns:
51
51
  column_name (str): returns the name of the molecule name column.
52
52
  """
53
-
53
+ name_column = ""
54
54
  for column in columns:
55
55
  if "molecule name" == column.lower():
56
56
  print((f"Found '{column}' column."
57
57
  " Using it to name the molecules."))
58
58
  name_column = column
59
- return name_column
59
+ break
60
60
  elif "name" == column.lower():
61
61
  print((f"Found '{column}' column."
62
62
  " Using it to name the molecules."))
63
63
  name_column = column
64
- return name_column
64
+ break
65
65
  elif "molecule chembl id" == column.lower():
66
66
  print((f"Found '{column}' column."
67
67
  " Using it to name the molecules."))
68
68
  name_column = column
69
- return name_column
69
+ break
70
70
  elif "id" == column.lower():
71
71
  print((f"Found '{column}' column."
72
72
  " Using it to name the molecules."))
73
73
  name_column = column
74
- return name_column
75
- else:
76
- print(("Unable to find a column with molecule names."
77
- " Using the index to name the molecules."))
78
- name_column = "index"
79
- return name_column
74
+ break
75
+ if name_column == "":
76
+ print(("Unable to find a column with molecule names."
77
+ " Using the index to name the molecules."))
78
+ name_column = "index"
79
+ return name_column
80
80
 
81
81
 
82
82
  def read_df_smiles(df, write_log, drop_errors):
@@ -131,13 +131,13 @@ def read_df_smiles(df, write_log, drop_errors):
131
131
  return mols
132
132
 
133
133
 
134
- def read_EXCEL_smiles(file, write_log):
134
+ def read_EXCEL_smiles(file, write_log, drop_errors):
135
135
  df_supplier = pd.read_excel(file)
136
136
  mols_sanitized = read_df_smiles(df_supplier, write_log, drop_errors)
137
137
  return mols_sanitized
138
138
 
139
139
 
140
- def read_CSV_smiles(file, write_log):
140
+ def read_CSV_smiles(file, write_log, drop_errors):
141
141
  df_supplier = pd.read_csv(file, sep=",")
142
142
  mols_sanitized = read_df_smiles(df_supplier, write_log, drop_errors)
143
143
  return mols_sanitized
@@ -280,9 +280,9 @@ def read_molecules(file, write_log, drop_errors):
280
280
  elif file.endswith(".sdf") or file.endswith(".mol"):
281
281
  molecules = read_SDF(file, write_log, drop_errors)
282
282
  elif file.endswith(".xlsx") or file.endswith(".xls"):
283
- molecules = read_EXCEL_smiles(file, write_log)
283
+ molecules = read_EXCEL_smiles(file, write_log, drop_errors)
284
284
  elif file.endswith(".csv"):
285
- molecules = read_CSV_smiles(file, write_log)
285
+ molecules = read_CSV_smiles(file, write_log, drop_errors)
286
286
  return molecules
287
287
 
288
288
 
@@ -1,167 +1,180 @@
1
- Metadata-Version: 2.1
2
- Name: MASSA_Algorithm
3
- Version: 2.0.0
4
- Summary: MASSA Algorithm is a Python package to separate data sets of molecules into training and test sets, considering the diversity of structural, physicochemical and biological characteristics of these molecules.
5
- Home-page: https://github.com/gcverissimo/MASSA_Algorithm
6
- Author: Gabriel Corrêa Veríssimo
7
- Author-email: gcverissimo@outlook.com
8
- License: AGPLv3
9
- Keywords: chemoinformatics,training,test,training-test,dataset preparation,data set preparation,rdkit
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: Programming Language :: Python :: 3.8
12
- Classifier: Programming Language :: Python :: 3.9
13
- Classifier: Programming Language :: Python :: 3.10
14
- Classifier: Programming Language :: Python :: 3.11
15
- Classifier: License :: OSI Approved :: GNU Affero General Public License v3
16
- Classifier: Operating System :: OS Independent
17
- Classifier: Topic :: Scientific/Engineering :: Chemistry
18
- Requires-Python: >=3.8
19
- Description-Content-Type: text/markdown
20
- License-File: LICENSE
21
- Requires-Dist: numpy<2.0
22
- Requires-Dist: rdkit
23
- Requires-Dist: pandas
24
- Requires-Dist: matplotlib>=3.2
25
- Requires-Dist: scipy>=1.6
26
- Requires-Dist: scikit-learn>0.24
27
- Requires-Dist: kmodes>=0.10
28
-
29
- # MASSA Algorithm
30
- MASSA Algorithm: A tool for separating data sets of molecules into training and test sets. Developed with the objective of preparing data sets for the generation of prediction models in cheminformatics.
31
-
32
-
33
- ## Version 1.0.0
34
- - Version 1.0.0 includes a code refactoring and adds the ability to split data into training, test, and validation subsets.
35
-
36
- ## Version 2.0.0
37
- - Version 2.0.0 introduces algorithm changes to better handle large datasets. Specifically, for datasets with 10,000 molecules or more, Hierarchical Clustering Analysis (HCA) is automatically replaced by MiniBatch K-Means. This is the new default behavior, but it can be controlled using the flag -a / --large-datasets. Since dendrograms are generated from HCA, dendrogram plotting is disabled for large datasets. In such cases, the flag -f / --dendrogram-plot is automatically disabled, regardless of user input.
38
-
39
- - This version introduces the ability to call the MASSA Algorithm from any Python script using MASSA_Algorithm.pyMASSA.py_massa(). However, instructions and documentation for doing so will be provided in future updates.
40
-
41
- - Version 2.0.0 also addresses the "NaN/None values in y" error, which was caused by duplicate molecule names. In this version, molecules with identical names are detected and renamed by appending their original index as a suffix to ensure uniqueness.
42
-
43
- - MASSA now preserves the input order of molecules in its output. However, molecules with chemical errors are skipped and excluded from the process.
44
-
45
- ## Instalation
46
- MASSA Algorithm can be installed using pip:
47
- ```
48
- pip install MASSA_Algorithm
49
- ```
50
- To upgrade to the latest version (recommended), also use pip:
51
- ```
52
- pip install --upgrade MASSA_Algorithm
53
- ```
54
- Alternatively, you can build the latest development version from source:
55
- ```
56
- git clone https://github.com/gcverissimo/MASSA_Algorithm.git
57
- cd MASSA_Algorithm
58
- python setup.py install
59
- ```
60
- ### Requirements
61
- * python: >= 3.8;
62
- * rdkit;
63
- * numpy: < 2.0;
64
- * pandas;
65
- * matplotlib: >= 3.2;
66
- * scipy: >= 1.6;
67
- * scikit-learn: > 0.24;
68
- * kmodes:¹ >= 0.10.
69
- Newer versions of the packages may also work, but they need to be tested.
70
- NOTE: Also tested on: scikit-learn: 1.7.0, scipy: 1.16.1, numpy: 2.0.2, rdkit: 2025.03.5.
71
-
72
- ## Usage
73
- Once installed, the program can be run directly from the command line:
74
- ```
75
- MASSA_Algorithm -i <input_file>.sdf -o <output_file>.sdf
76
- ```
77
-
78
- Required arguments:
79
- * **Input file**: ```-i``` or ```--input```.
80
- * MASSA Algorithm accepts input files in the formats: .sdf, .mol, .mol2, .xlsx, .xls, and .csv. However, the .sdf format is preferred. Notes:
81
- * .mol2 files have limitations in storing molecular properties and follow different saving patterns. Due to this, we only support .mol2 files that are generated by Discovery Studio Visualizer.
82
- * For .xlsx, .xls, and .csv:
83
- * MASSA will look for a column with smiles in the name and use it as the source of input molecules.
84
- * MASSA will look for a column with one of the following names in the priority order: Molecule name, Name, Molecule ChEMBL ID, or ID. If none of these columns are found, it will use the molecule index.
85
- * **Output file**: ```-o``` or ```--output```.
86
- * Enter the output file name or file path. Image files will be saved to a folder within the same directory as the output file.
87
- * It is highly recommended to use an .sdf file to avoid errors.
88
-
89
- Optional arguments include:
90
- * **Splitting strategy**: ```-y``` or ```--splitting_strategy```.
91
- * Defines the splitting strategy, either into training and test sets or into training, test, and validation sets.
92
- * Options = 'tt', 'tt-val'.
93
- * 'tt', means splitting into training and test sets. 'tt-val', means splitting into training, test, and validation sets.
94
- * Default = 'tt'.
95
- * **Percentage of molecules in training set**: ```-p``` or ```--percentage_of_training```.
96
- * Percentage of molecules in training set. Must be a number from 0 to 1.
97
- * Default = 0.8.
98
- * **Number of biological activities for separation**: ```-b``` or ```--number_of_biological```.
99
- * Number of biological activities that will be used to separate the set into training and test.
100
- * Default = 1.
101
- * **Name of biological activities for separation**: ```-s``` or ```--the_biological_activities```.
102
- * The biological activity(ies) or other y-property(ies) used for QSAR or machine learning modeling. The algorithm can handle one or more properties. Enter a list with the names of biological activities separated by commas and no spaces. These properties must be represented as either integers or floating-point numbers. If your dataset is represented in classes (e.g., active or inactive; soluble, partially soluble, or insoluble), you should represent them as integers (e.g., 0 or 1; 1, 2, or 3).
103
- * Example: ```MASSA_Algorithm -i <input_file>.sdf -o <output_file>.sdf -s pIC50,pMIC```.
104
- * Default = If not entered directly on the command line, it will be requested during algorithm execution.
105
- * **Number of principal components in PCA**: ```-n``` or ```--number_of_PCs```.
106
- * Defines the number of principal components to reduce the dimensionality of variables related to biological, physicochemical and structural domains. If the value is a decimal between 0 and 1, the number of principal components is what explains for (```<input number>```* 100)% of the variance. If the value is greater than 1, the number of PCs will be exactly the input integer, but PAY ATTENTION:
107
-
108
- 1) If the number of PCs is an integer and equal to or greater than the number of physicochemical properties (7), the PCA step will be bypassed for this domain.
109
- 2) The same for the biological domain.
110
- 3) If the number of biological activities is less than 3, the PCA step will be bypassed for this domain.
111
- * Default = 0.85.
112
- * **SVD solver parameter for PCA**: ```-v``` or ```--svd_solver_for_PCA```.
113
- * See the sklearn.decomposition.PCA topic on https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.PCA.html for more info.
114
- * Default = full.
115
- * **HCA linkage method**: ```-l``` or ```--linkage_method```.
116
- * The linkage criterion to use. The algorithm will merge the pairs of cluster that minimize this criterion.
117
- * Options = complete, single, ward, average, weighted, centroid, median. For more info, see the scipy.cluster.hierarchy.linkage topic on https://docs.scipy.org/doc/scipy/reference/generated/scipy.cluster.hierarchy.linkage.html?highlight=linkage#scipy.cluster.hierarchy.linkage.
118
- * Default = complete.
119
- * **Extension of image files**: ```-t``` or ```--image_type```.
120
- * Extension of the image files that will be generated. Suggested = png or svg.
121
- * Default = png.
122
- * **Font size for X-axis of dendrograms**: ```-d``` or ```--dendrogram_Xfont_size```.
123
- * Sets the font size on the x-axis of the dendrogram (molecule labels).
124
- * Default = 5.
125
- * **Font size for X-axis of bar plots**: ```-x``` or ```--barplot_Xfont_size```.
126
- * Sets the font size on the x-axis of the bar plot (cluster labels).
127
- * Default = 12.
128
- * **Enable Dendrogram plot**: ```-f``` or ```--dendrogram_plot```.
129
- * Defines whether or not dendrogram images will be generated.
130
- * Options = true (dendrogram will be generated), false (dendrogram will not be generated).
131
- * Default = true.
132
- * **Ignore Errors**: ```-e``` or ```--drop_errors```.
133
- * Ignore chemistry errors, saving only molecules without any errors.
134
- * Options = true (ignore molecule errors and log them in the log file), false (treat molecule errors as fatal and fail the execution).
135
- * Default = false.
136
- * **Large Dataset**: ```-a``` or ```--large_dataset```.
137
- * Switch the MASSA algorithm from HCA to MiniBatch-KMeans to handle large datasets.
138
- * Options = auto (switches to KMeans if ≥ 10,000 molecules), false = use HCA (for smaller datasets), true = use KMeans (for large datasets).
139
- * Default = auto.
140
-
141
- #### Command line help
142
- A full description of the arguments can also be viewed directly from the command line using the command:
143
- ```
144
- MASSA_Algorithm -h
145
- ```
146
- or
147
- ```
148
- MASSA_Algorithm --help
149
- ```
150
-
151
- ## Cite
152
- 1. To ensure accurate citation, kindly include a reference to the MASSA article, accessible via the DOI:
153
- Veríssimo, G. C.; Panteleão, S. Q.; Fernandes, P. O.; Gertrudes, J. C.; Kronenberger, T.; Honorio, K. M.; Maltarollo; V. G. MASSA Algorithm: an automated rational sampling of training and test subsets for QSAR modeling. J. Comput. Aided Mol. Des. 2023, 37, 735–754. https://doi.org/10.1007/s10822-023-00536-y.
154
-
155
- 2. Furthermore, please incorporate the program citation following the provided template:
156
-
157
- ```
158
- @Misc{veríssimo2021,
159
- author = {Gabriel Corrêa Veríssimo},
160
- title = {MASSA Algorithm: Molecular data set sampling for training-test separation},
161
- howpublished = {\url{https://github.com/gcverissimo/MASSA_Algorithm}},
162
- year = {2021}
163
- }
164
- ```
165
-
166
- ## References
167
- [1]: DE VOS, N. J. kmodes categorical clustering library. https://github.com/nicodv/kmodes. 2015-2021.
1
+ Metadata-Version: 2.4
2
+ Name: MASSA_Algorithm
3
+ Version: 2.2.0
4
+ Summary: MASSA Algorithm is a Python package to separate data sets of molecules into training and test sets, considering the diversity of structural, physicochemical and biological characteristics of these molecules.
5
+ Home-page: https://github.com/gcverissimo/MASSA_Algorithm
6
+ Author: Gabriel Corrêa Veríssimo
7
+ Author-email: gcverissimo@outlook.com
8
+ License: AGPLv3
9
+ Keywords: chemoinformatics,training,test,training-test,dataset preparation,data set preparation,rdkit
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.8
12
+ Classifier: Programming Language :: Python :: 3.9
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: License :: OSI Approved :: GNU Affero General Public License v3
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Topic :: Scientific/Engineering :: Chemistry
18
+ Requires-Python: >=3.8
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: numpy
22
+ Requires-Dist: rdkit
23
+ Requires-Dist: pandas
24
+ Requires-Dist: matplotlib>=3.2
25
+ Requires-Dist: scipy>=1.6
26
+ Requires-Dist: scikit-learn>0.24
27
+ Requires-Dist: kmodes>=0.10
28
+ Dynamic: author
29
+ Dynamic: author-email
30
+ Dynamic: classifier
31
+ Dynamic: description
32
+ Dynamic: description-content-type
33
+ Dynamic: home-page
34
+ Dynamic: keywords
35
+ Dynamic: license
36
+ Dynamic: license-file
37
+ Dynamic: requires-dist
38
+ Dynamic: requires-python
39
+ Dynamic: summary
40
+
41
+ # MASSA Algorithm
42
+ MASSA Algorithm: A tool for separating data sets of molecules into training and test sets. Developed with the objective of preparing data sets for the generation of prediction models in cheminformatics.
43
+
44
+
45
+ ## Version 1.0.0
46
+ - Version 1.0.0 includes a code refactoring and adds the ability to split data into training, test, and validation subsets.
47
+
48
+ ## Version 2.0.0
49
+ - Version 2.0.0 introduces algorithm changes to better handle large datasets. Specifically, for datasets with 10,000 molecules or more, Hierarchical Clustering Analysis (HCA) is automatically replaced by MiniBatch K-Means. This is the new default behavior, but it can be controlled using the flag -a / --large-datasets. Since dendrograms are generated from HCA, dendrogram plotting is disabled for large datasets. In such cases, the flag -f / --dendrogram-plot is automatically disabled, regardless of user input.
50
+
51
+ - This version introduces the ability to call the MASSA Algorithm from any Python script using MASSA_Algorithm.pyMASSA.py_massa(). However, instructions and documentation for doing so will be provided in future updates.
52
+
53
+ - Version 2.0.0 also addresses the "NaN/None values in y" error, which was caused by duplicate molecule names. In this version, molecules with identical names are detected and renamed by appending their original index as a suffix to ensure uniqueness.
54
+
55
+ - MASSA now preserves the input order of molecules in its output. However, molecules with chemical errors are skipped and excluded from the process.
56
+
57
+ ## Instalation
58
+ MASSA Algorithm can be installed using pip:
59
+ ```
60
+ pip install MASSA_Algorithm
61
+ ```
62
+ To upgrade to the latest version (recommended), also use pip:
63
+ ```
64
+ pip install --upgrade MASSA_Algorithm
65
+ ```
66
+ Alternatively, you can build the latest development version from source:
67
+ ```
68
+ git clone https://github.com/gcverissimo/MASSA_Algorithm.git
69
+ cd MASSA_Algorithm
70
+ python setup.py install
71
+ ```
72
+ ### Requirements
73
+ * python: >= 3.8;
74
+ * rdkit;
75
+ * numpy;
76
+ * pandas;
77
+ * matplotlib: >= 3.2;
78
+ * scipy: >= 1.6;
79
+ * scikit-learn: > 0.24;
80
+ * kmodes:¹ >= 0.10.
81
+
82
+ NOTE: Also tested on: scikit-learn: 1.7.0, scipy: 1.16.1, numpy: 2.0.2, rdkit: 2025.03.5.
83
+
84
+ ## Usage
85
+ Once installed, the program can be run directly from the command line:
86
+ ```
87
+ MASSA_Algorithm -i <input_file>.sdf -o <output_file>.sdf
88
+ ```
89
+
90
+ Required arguments:
91
+ * **Input file**: ```-i``` or ```--input```.
92
+ * MASSA Algorithm accepts input files in the formats: .sdf, .mol, .mol2, .xlsx, .xls, and .csv. However, the .sdf format is preferred. Notes:
93
+ * .mol2 files have limitations in storing molecular properties and follow different saving patterns. Due to this, we only support .mol2 files that are generated by Discovery Studio Visualizer.
94
+ * For .xlsx, .xls, and .csv:
95
+ * MASSA will look for a column with smiles in the name and use it as the source of input molecules.
96
+ * MASSA will look for a column with one of the following names in the priority order: Molecule name, Name, Molecule ChEMBL ID, or ID. If none of these columns are found, it will use the molecule index.
97
+ * **Output file**: ```-o``` or ```--output```.
98
+ * Enter the output file name or file path. Image files will be saved to a folder within the same directory as the output file.
99
+ * It is highly recommended to use an .sdf file to avoid errors.
100
+
101
+ Optional arguments include:
102
+ * **Splitting strategy**: ```-y``` or ```--splitting_strategy```.
103
+ * Defines the splitting strategy, either into training and test sets or into training, test, and validation sets.
104
+ * Options = 'tt', 'tt-val'.
105
+ * 'tt', means splitting into training and test sets. 'tt-val', means splitting into training, test, and validation sets.
106
+ * Default = 'tt'.
107
+ * **Percentage of molecules in training set**: ```-p``` or ```--percentage_of_training```.
108
+ * Percentage of molecules in training set. Must be a number from 0 to 1.
109
+ * Default = 0.8.
110
+ * **Number of biological activities for separation**: ```-b``` or ```--number_of_biological```.
111
+ * Number of biological activities that will be used to separate the set into training and test.
112
+ * Default = 1.
113
+ * **Name of biological activities for separation**: ```-s``` or ```--the_biological_activities```.
114
+ * The biological activity(ies) or other y-property(ies) used for QSAR or machine learning modeling. The algorithm can handle one or more properties. Enter a list with the names of biological activities separated by commas and no spaces. These properties must be represented as either integers or floating-point numbers. If your dataset is represented in classes (e.g., active or inactive; soluble, partially soluble, or insoluble), you should represent them as integers (e.g., 0 or 1; 1, 2, or 3).
115
+ * Example: ```MASSA_Algorithm -i <input_file>.sdf -o <output_file>.sdf -s pIC50,pMIC```.
116
+ * Default = If not entered directly on the command line, it will be requested during algorithm execution.
117
+ * **Number of principal components in PCA**: ```-n``` or ```--number_of_PCs```.
118
+ * Defines the number of principal components to reduce the dimensionality of variables related to biological, physicochemical and structural domains. If the value is a decimal between 0 and 1, the number of principal components is what explains for (```<input number>```* 100)% of the variance. If the value is greater than 1, the number of PCs will be exactly the input integer, but PAY ATTENTION:
119
+
120
+ 1) If the number of PCs is an integer and equal to or greater than the number of physicochemical properties (7), the PCA step will be bypassed for this domain.
121
+ 2) The same for the biological domain.
122
+ 3) If the number of biological activities is less than 3, the PCA step will be bypassed for this domain.
123
+ * Default = 0.85.
124
+ * **SVD solver parameter for PCA**: ```-v``` or ```--svd_solver_for_PCA```.
125
+ * See the sklearn.decomposition.PCA topic on https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.PCA.html for more info.
126
+ * Default = full.
127
+ * **HCA linkage method**: ```-l``` or ```--linkage_method```.
128
+ * The linkage criterion to use. The algorithm will merge the pairs of cluster that minimize this criterion.
129
+ * Options = complete, single, ward, average, weighted, centroid, median. For more info, see the scipy.cluster.hierarchy.linkage topic on https://docs.scipy.org/doc/scipy/reference/generated/scipy.cluster.hierarchy.linkage.html?highlight=linkage#scipy.cluster.hierarchy.linkage.
130
+ * Default = complete.
131
+ * **Extension of image files**: ```-t``` or ```--image_type```.
132
+ * Extension of the image files that will be generated. Suggested = png or svg.
133
+ * Default = png.
134
+ * **Font size for X-axis of dendrograms**: ```-d``` or ```--dendrogram_Xfont_size```.
135
+ * Sets the font size on the x-axis of the dendrogram (molecule labels).
136
+ * Default = 5.
137
+ * **Font size for X-axis of bar plots**: ```-x``` or ```--barplot_Xfont_size```.
138
+ * Sets the font size on the x-axis of the bar plot (cluster labels).
139
+ * Default = 12.
140
+ * **Enable Dendrogram plot**: ```-f``` or ```--dendrogram_plot```.
141
+ * Defines whether or not dendrogram images will be generated.
142
+ * Options = true (dendrogram will be generated), false (dendrogram will not be generated).
143
+ * Default = true.
144
+ * **Ignore Errors**: ```-e``` or ```--drop_errors```.
145
+ * Ignore chemistry errors, saving only molecules without any errors.
146
+ * Options = true (ignore molecule errors and log them in the log file), false (treat molecule errors as fatal and fail the execution).
147
+ * Default = true.
148
+ * **Large Dataset**: ```-a``` or ```--large_dataset```.
149
+ * Switch the MASSA algorithm from HCA to MiniBatch-KMeans to handle large datasets.
150
+ * Options = auto (switches to KMeans if ≥ 10,000 molecules), false = use HCA (for smaller datasets), true = use KMeans (for large datasets).
151
+ * Default = auto.
152
+
153
+ #### Command line help
154
+ A full description of the arguments can also be viewed directly from the command line using the command:
155
+ ```
156
+ MASSA_Algorithm -h
157
+ ```
158
+ or
159
+ ```
160
+ MASSA_Algorithm --help
161
+ ```
162
+
163
+ ## Cite
164
+ 1. To ensure accurate citation, kindly include a reference to the MASSA article, accessible via the DOI:
165
+ Veríssimo, G. C.; Panteleão, S. Q.; Fernandes, P. O.; Gertrudes, J. C.; Kronenberger, T.; Honorio, K. M.; Maltarollo; V. G. MASSA Algorithm: an automated rational sampling of training and test subsets for QSAR modeling. J. Comput. Aided Mol. Des. 2023, 37, 735–754. https://doi.org/10.1007/s10822-023-00536-y.
166
+
167
+ 2. Furthermore, please incorporate the program citation following the provided template:
168
+
169
+ ```
170
+ @Misc{veríssimo2021,
171
+ author = {Gabriel Corrêa Veríssimo},
172
+ title = {MASSA Algorithm: Molecular data set sampling for training-test separation},
173
+ howpublished = {\url{https://github.com/gcverissimo/MASSA_Algorithm}},
174
+ year = {2021}
175
+ }
176
+ ```
177
+
178
+ ## References
179
+ [1]: DE VOS, N. J. kmodes categorical clustering library. https://github.com/nicodv/kmodes. 2015-2021.
180
+
@@ -1,4 +1,4 @@
1
- numpy<2.0
1
+ numpy
2
2
  rdkit
3
3
  pandas
4
4
  matplotlib>=3.2
@@ -1,167 +1,180 @@
1
- Metadata-Version: 2.1
2
- Name: MASSA_Algorithm
3
- Version: 2.0.0
4
- Summary: MASSA Algorithm is a Python package to separate data sets of molecules into training and test sets, considering the diversity of structural, physicochemical and biological characteristics of these molecules.
5
- Home-page: https://github.com/gcverissimo/MASSA_Algorithm
6
- Author: Gabriel Corrêa Veríssimo
7
- Author-email: gcverissimo@outlook.com
8
- License: AGPLv3
9
- Keywords: chemoinformatics,training,test,training-test,dataset preparation,data set preparation,rdkit
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: Programming Language :: Python :: 3.8
12
- Classifier: Programming Language :: Python :: 3.9
13
- Classifier: Programming Language :: Python :: 3.10
14
- Classifier: Programming Language :: Python :: 3.11
15
- Classifier: License :: OSI Approved :: GNU Affero General Public License v3
16
- Classifier: Operating System :: OS Independent
17
- Classifier: Topic :: Scientific/Engineering :: Chemistry
18
- Requires-Python: >=3.8
19
- Description-Content-Type: text/markdown
20
- License-File: LICENSE
21
- Requires-Dist: numpy<2.0
22
- Requires-Dist: rdkit
23
- Requires-Dist: pandas
24
- Requires-Dist: matplotlib>=3.2
25
- Requires-Dist: scipy>=1.6
26
- Requires-Dist: scikit-learn>0.24
27
- Requires-Dist: kmodes>=0.10
28
-
29
- # MASSA Algorithm
30
- MASSA Algorithm: A tool for separating data sets of molecules into training and test sets. Developed with the objective of preparing data sets for the generation of prediction models in cheminformatics.
31
-
32
-
33
- ## Version 1.0.0
34
- - Version 1.0.0 includes a code refactoring and adds the ability to split data into training, test, and validation subsets.
35
-
36
- ## Version 2.0.0
37
- - Version 2.0.0 introduces algorithm changes to better handle large datasets. Specifically, for datasets with 10,000 molecules or more, Hierarchical Clustering Analysis (HCA) is automatically replaced by MiniBatch K-Means. This is the new default behavior, but it can be controlled using the flag -a / --large-datasets. Since dendrograms are generated from HCA, dendrogram plotting is disabled for large datasets. In such cases, the flag -f / --dendrogram-plot is automatically disabled, regardless of user input.
38
-
39
- - This version introduces the ability to call the MASSA Algorithm from any Python script using MASSA_Algorithm.pyMASSA.py_massa(). However, instructions and documentation for doing so will be provided in future updates.
40
-
41
- - Version 2.0.0 also addresses the "NaN/None values in y" error, which was caused by duplicate molecule names. In this version, molecules with identical names are detected and renamed by appending their original index as a suffix to ensure uniqueness.
42
-
43
- - MASSA now preserves the input order of molecules in its output. However, molecules with chemical errors are skipped and excluded from the process.
44
-
45
- ## Instalation
46
- MASSA Algorithm can be installed using pip:
47
- ```
48
- pip install MASSA_Algorithm
49
- ```
50
- To upgrade to the latest version (recommended), also use pip:
51
- ```
52
- pip install --upgrade MASSA_Algorithm
53
- ```
54
- Alternatively, you can build the latest development version from source:
55
- ```
56
- git clone https://github.com/gcverissimo/MASSA_Algorithm.git
57
- cd MASSA_Algorithm
58
- python setup.py install
59
- ```
60
- ### Requirements
61
- * python: >= 3.8;
62
- * rdkit;
63
- * numpy: < 2.0;
64
- * pandas;
65
- * matplotlib: >= 3.2;
66
- * scipy: >= 1.6;
67
- * scikit-learn: > 0.24;
68
- * kmodes:¹ >= 0.10.
69
- Newer versions of the packages may also work, but they need to be tested.
70
- NOTE: Also tested on: scikit-learn: 1.7.0, scipy: 1.16.1, numpy: 2.0.2, rdkit: 2025.03.5.
71
-
72
- ## Usage
73
- Once installed, the program can be run directly from the command line:
74
- ```
75
- MASSA_Algorithm -i <input_file>.sdf -o <output_file>.sdf
76
- ```
77
-
78
- Required arguments:
79
- * **Input file**: ```-i``` or ```--input```.
80
- * MASSA Algorithm accepts input files in the formats: .sdf, .mol, .mol2, .xlsx, .xls, and .csv. However, the .sdf format is preferred. Notes:
81
- * .mol2 files have limitations in storing molecular properties and follow different saving patterns. Due to this, we only support .mol2 files that are generated by Discovery Studio Visualizer.
82
- * For .xlsx, .xls, and .csv:
83
- * MASSA will look for a column with smiles in the name and use it as the source of input molecules.
84
- * MASSA will look for a column with one of the following names in the priority order: Molecule name, Name, Molecule ChEMBL ID, or ID. If none of these columns are found, it will use the molecule index.
85
- * **Output file**: ```-o``` or ```--output```.
86
- * Enter the output file name or file path. Image files will be saved to a folder within the same directory as the output file.
87
- * It is highly recommended to use an .sdf file to avoid errors.
88
-
89
- Optional arguments include:
90
- * **Splitting strategy**: ```-y``` or ```--splitting_strategy```.
91
- * Defines the splitting strategy, either into training and test sets or into training, test, and validation sets.
92
- * Options = 'tt', 'tt-val'.
93
- * 'tt', means splitting into training and test sets. 'tt-val', means splitting into training, test, and validation sets.
94
- * Default = 'tt'.
95
- * **Percentage of molecules in training set**: ```-p``` or ```--percentage_of_training```.
96
- * Percentage of molecules in training set. Must be a number from 0 to 1.
97
- * Default = 0.8.
98
- * **Number of biological activities for separation**: ```-b``` or ```--number_of_biological```.
99
- * Number of biological activities that will be used to separate the set into training and test.
100
- * Default = 1.
101
- * **Name of biological activities for separation**: ```-s``` or ```--the_biological_activities```.
102
- * The biological activity(ies) or other y-property(ies) used for QSAR or machine learning modeling. The algorithm can handle one or more properties. Enter a list with the names of biological activities separated by commas and no spaces. These properties must be represented as either integers or floating-point numbers. If your dataset is represented in classes (e.g., active or inactive; soluble, partially soluble, or insoluble), you should represent them as integers (e.g., 0 or 1; 1, 2, or 3).
103
- * Example: ```MASSA_Algorithm -i <input_file>.sdf -o <output_file>.sdf -s pIC50,pMIC```.
104
- * Default = If not entered directly on the command line, it will be requested during algorithm execution.
105
- * **Number of principal components in PCA**: ```-n``` or ```--number_of_PCs```.
106
- * Defines the number of principal components to reduce the dimensionality of variables related to biological, physicochemical and structural domains. If the value is a decimal between 0 and 1, the number of principal components is what explains for (```<input number>```* 100)% of the variance. If the value is greater than 1, the number of PCs will be exactly the input integer, but PAY ATTENTION:
107
-
108
- 1) If the number of PCs is an integer and equal to or greater than the number of physicochemical properties (7), the PCA step will be bypassed for this domain.
109
- 2) The same for the biological domain.
110
- 3) If the number of biological activities is less than 3, the PCA step will be bypassed for this domain.
111
- * Default = 0.85.
112
- * **SVD solver parameter for PCA**: ```-v``` or ```--svd_solver_for_PCA```.
113
- * See the sklearn.decomposition.PCA topic on https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.PCA.html for more info.
114
- * Default = full.
115
- * **HCA linkage method**: ```-l``` or ```--linkage_method```.
116
- * The linkage criterion to use. The algorithm will merge the pairs of cluster that minimize this criterion.
117
- * Options = complete, single, ward, average, weighted, centroid, median. For more info, see the scipy.cluster.hierarchy.linkage topic on https://docs.scipy.org/doc/scipy/reference/generated/scipy.cluster.hierarchy.linkage.html?highlight=linkage#scipy.cluster.hierarchy.linkage.
118
- * Default = complete.
119
- * **Extension of image files**: ```-t``` or ```--image_type```.
120
- * Extension of the image files that will be generated. Suggested = png or svg.
121
- * Default = png.
122
- * **Font size for X-axis of dendrograms**: ```-d``` or ```--dendrogram_Xfont_size```.
123
- * Sets the font size on the x-axis of the dendrogram (molecule labels).
124
- * Default = 5.
125
- * **Font size for X-axis of bar plots**: ```-x``` or ```--barplot_Xfont_size```.
126
- * Sets the font size on the x-axis of the bar plot (cluster labels).
127
- * Default = 12.
128
- * **Enable Dendrogram plot**: ```-f``` or ```--dendrogram_plot```.
129
- * Defines whether or not dendrogram images will be generated.
130
- * Options = true (dendrogram will be generated), false (dendrogram will not be generated).
131
- * Default = true.
132
- * **Ignore Errors**: ```-e``` or ```--drop_errors```.
133
- * Ignore chemistry errors, saving only molecules without any errors.
134
- * Options = true (ignore molecule errors and log them in the log file), false (treat molecule errors as fatal and fail the execution).
135
- * Default = false.
136
- * **Large Dataset**: ```-a``` or ```--large_dataset```.
137
- * Switch the MASSA algorithm from HCA to MiniBatch-KMeans to handle large datasets.
138
- * Options = auto (switches to KMeans if ≥ 10,000 molecules), false = use HCA (for smaller datasets), true = use KMeans (for large datasets).
139
- * Default = auto.
140
-
141
- #### Command line help
142
- A full description of the arguments can also be viewed directly from the command line using the command:
143
- ```
144
- MASSA_Algorithm -h
145
- ```
146
- or
147
- ```
148
- MASSA_Algorithm --help
149
- ```
150
-
151
- ## Cite
152
- 1. To ensure accurate citation, kindly include a reference to the MASSA article, accessible via the DOI:
153
- Veríssimo, G. C.; Panteleão, S. Q.; Fernandes, P. O.; Gertrudes, J. C.; Kronenberger, T.; Honorio, K. M.; Maltarollo; V. G. MASSA Algorithm: an automated rational sampling of training and test subsets for QSAR modeling. J. Comput. Aided Mol. Des. 2023, 37, 735–754. https://doi.org/10.1007/s10822-023-00536-y.
154
-
155
- 2. Furthermore, please incorporate the program citation following the provided template:
156
-
157
- ```
158
- @Misc{veríssimo2021,
159
- author = {Gabriel Corrêa Veríssimo},
160
- title = {MASSA Algorithm: Molecular data set sampling for training-test separation},
161
- howpublished = {\url{https://github.com/gcverissimo/MASSA_Algorithm}},
162
- year = {2021}
163
- }
164
- ```
165
-
166
- ## References
167
- [1]: DE VOS, N. J. kmodes categorical clustering library. https://github.com/nicodv/kmodes. 2015-2021.
1
+ Metadata-Version: 2.4
2
+ Name: MASSA_Algorithm
3
+ Version: 2.2.0
4
+ Summary: MASSA Algorithm is a Python package to separate data sets of molecules into training and test sets, considering the diversity of structural, physicochemical and biological characteristics of these molecules.
5
+ Home-page: https://github.com/gcverissimo/MASSA_Algorithm
6
+ Author: Gabriel Corrêa Veríssimo
7
+ Author-email: gcverissimo@outlook.com
8
+ License: AGPLv3
9
+ Keywords: chemoinformatics,training,test,training-test,dataset preparation,data set preparation,rdkit
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.8
12
+ Classifier: Programming Language :: Python :: 3.9
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: License :: OSI Approved :: GNU Affero General Public License v3
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Topic :: Scientific/Engineering :: Chemistry
18
+ Requires-Python: >=3.8
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: numpy
22
+ Requires-Dist: rdkit
23
+ Requires-Dist: pandas
24
+ Requires-Dist: matplotlib>=3.2
25
+ Requires-Dist: scipy>=1.6
26
+ Requires-Dist: scikit-learn>0.24
27
+ Requires-Dist: kmodes>=0.10
28
+ Dynamic: author
29
+ Dynamic: author-email
30
+ Dynamic: classifier
31
+ Dynamic: description
32
+ Dynamic: description-content-type
33
+ Dynamic: home-page
34
+ Dynamic: keywords
35
+ Dynamic: license
36
+ Dynamic: license-file
37
+ Dynamic: requires-dist
38
+ Dynamic: requires-python
39
+ Dynamic: summary
40
+
41
+ # MASSA Algorithm
42
+ MASSA Algorithm: A tool for separating data sets of molecules into training and test sets. Developed with the objective of preparing data sets for the generation of prediction models in cheminformatics.
43
+
44
+
45
+ ## Version 1.0.0
46
+ - Version 1.0.0 includes a code refactoring and adds the ability to split data into training, test, and validation subsets.
47
+
48
+ ## Version 2.0.0
49
+ - Version 2.0.0 introduces algorithm changes to better handle large datasets. Specifically, for datasets with 10,000 molecules or more, Hierarchical Clustering Analysis (HCA) is automatically replaced by MiniBatch K-Means. This is the new default behavior, but it can be controlled using the flag -a / --large-datasets. Since dendrograms are generated from HCA, dendrogram plotting is disabled for large datasets. In such cases, the flag -f / --dendrogram-plot is automatically disabled, regardless of user input.
50
+
51
+ - This version introduces the ability to call the MASSA Algorithm from any Python script using MASSA_Algorithm.pyMASSA.py_massa(). However, instructions and documentation for doing so will be provided in future updates.
52
+
53
+ - Version 2.0.0 also addresses the "NaN/None values in y" error, which was caused by duplicate molecule names. In this version, molecules with identical names are detected and renamed by appending their original index as a suffix to ensure uniqueness.
54
+
55
+ - MASSA now preserves the input order of molecules in its output. However, molecules with chemical errors are skipped and excluded from the process.
56
+
57
+ ## Instalation
58
+ MASSA Algorithm can be installed using pip:
59
+ ```
60
+ pip install MASSA_Algorithm
61
+ ```
62
+ To upgrade to the latest version (recommended), also use pip:
63
+ ```
64
+ pip install --upgrade MASSA_Algorithm
65
+ ```
66
+ Alternatively, you can build the latest development version from source:
67
+ ```
68
+ git clone https://github.com/gcverissimo/MASSA_Algorithm.git
69
+ cd MASSA_Algorithm
70
+ python setup.py install
71
+ ```
72
+ ### Requirements
73
+ * python: >= 3.8;
74
+ * rdkit;
75
+ * numpy;
76
+ * pandas;
77
+ * matplotlib: >= 3.2;
78
+ * scipy: >= 1.6;
79
+ * scikit-learn: > 0.24;
80
+ * kmodes:¹ >= 0.10.
81
+
82
+ NOTE: Also tested on: scikit-learn: 1.7.0, scipy: 1.16.1, numpy: 2.0.2, rdkit: 2025.03.5.
83
+
84
+ ## Usage
85
+ Once installed, the program can be run directly from the command line:
86
+ ```
87
+ MASSA_Algorithm -i <input_file>.sdf -o <output_file>.sdf
88
+ ```
89
+
90
+ Required arguments:
91
+ * **Input file**: ```-i``` or ```--input```.
92
+ * MASSA Algorithm accepts input files in the formats: .sdf, .mol, .mol2, .xlsx, .xls, and .csv. However, the .sdf format is preferred. Notes:
93
+ * .mol2 files have limitations in storing molecular properties and follow different saving patterns. Due to this, we only support .mol2 files that are generated by Discovery Studio Visualizer.
94
+ * For .xlsx, .xls, and .csv:
95
+ * MASSA will look for a column with smiles in the name and use it as the source of input molecules.
96
+ * MASSA will look for a column with one of the following names in the priority order: Molecule name, Name, Molecule ChEMBL ID, or ID. If none of these columns are found, it will use the molecule index.
97
+ * **Output file**: ```-o``` or ```--output```.
98
+ * Enter the output file name or file path. Image files will be saved to a folder within the same directory as the output file.
99
+ * It is highly recommended to use an .sdf file to avoid errors.
100
+
101
+ Optional arguments include:
102
+ * **Splitting strategy**: ```-y``` or ```--splitting_strategy```.
103
+ * Defines the splitting strategy, either into training and test sets or into training, test, and validation sets.
104
+ * Options = 'tt', 'tt-val'.
105
+ * 'tt', means splitting into training and test sets. 'tt-val', means splitting into training, test, and validation sets.
106
+ * Default = 'tt'.
107
+ * **Percentage of molecules in training set**: ```-p``` or ```--percentage_of_training```.
108
+ * Percentage of molecules in training set. Must be a number from 0 to 1.
109
+ * Default = 0.8.
110
+ * **Number of biological activities for separation**: ```-b``` or ```--number_of_biological```.
111
+ * Number of biological activities that will be used to separate the set into training and test.
112
+ * Default = 1.
113
+ * **Name of biological activities for separation**: ```-s``` or ```--the_biological_activities```.
114
+ * The biological activity(ies) or other y-property(ies) used for QSAR or machine learning modeling. The algorithm can handle one or more properties. Enter a list with the names of biological activities separated by commas and no spaces. These properties must be represented as either integers or floating-point numbers. If your dataset is represented in classes (e.g., active or inactive; soluble, partially soluble, or insoluble), you should represent them as integers (e.g., 0 or 1; 1, 2, or 3).
115
+ * Example: ```MASSA_Algorithm -i <input_file>.sdf -o <output_file>.sdf -s pIC50,pMIC```.
116
+ * Default = If not entered directly on the command line, it will be requested during algorithm execution.
117
+ * **Number of principal components in PCA**: ```-n``` or ```--number_of_PCs```.
118
+ * Defines the number of principal components to reduce the dimensionality of variables related to biological, physicochemical and structural domains. If the value is a decimal between 0 and 1, the number of principal components is what explains for (```<input number>```* 100)% of the variance. If the value is greater than 1, the number of PCs will be exactly the input integer, but PAY ATTENTION:
119
+
120
+ 1) If the number of PCs is an integer and equal to or greater than the number of physicochemical properties (7), the PCA step will be bypassed for this domain.
121
+ 2) The same for the biological domain.
122
+ 3) If the number of biological activities is less than 3, the PCA step will be bypassed for this domain.
123
+ * Default = 0.85.
124
+ * **SVD solver parameter for PCA**: ```-v``` or ```--svd_solver_for_PCA```.
125
+ * See the sklearn.decomposition.PCA topic on https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.PCA.html for more info.
126
+ * Default = full.
127
+ * **HCA linkage method**: ```-l``` or ```--linkage_method```.
128
+ * The linkage criterion to use. The algorithm will merge the pairs of cluster that minimize this criterion.
129
+ * Options = complete, single, ward, average, weighted, centroid, median. For more info, see the scipy.cluster.hierarchy.linkage topic on https://docs.scipy.org/doc/scipy/reference/generated/scipy.cluster.hierarchy.linkage.html?highlight=linkage#scipy.cluster.hierarchy.linkage.
130
+ * Default = complete.
131
+ * **Extension of image files**: ```-t``` or ```--image_type```.
132
+ * Extension of the image files that will be generated. Suggested = png or svg.
133
+ * Default = png.
134
+ * **Font size for X-axis of dendrograms**: ```-d``` or ```--dendrogram_Xfont_size```.
135
+ * Sets the font size on the x-axis of the dendrogram (molecule labels).
136
+ * Default = 5.
137
+ * **Font size for X-axis of bar plots**: ```-x``` or ```--barplot_Xfont_size```.
138
+ * Sets the font size on the x-axis of the bar plot (cluster labels).
139
+ * Default = 12.
140
+ * **Enable Dendrogram plot**: ```-f``` or ```--dendrogram_plot```.
141
+ * Defines whether or not dendrogram images will be generated.
142
+ * Options = true (dendrogram will be generated), false (dendrogram will not be generated).
143
+ * Default = true.
144
+ * **Ignore Errors**: ```-e``` or ```--drop_errors```.
145
+ * Ignore chemistry errors, saving only molecules without any errors.
146
+ * Options = true (ignore molecule errors and log them in the log file), false (treat molecule errors as fatal and fail the execution).
147
+ * Default = true.
148
+ * **Large Dataset**: ```-a``` or ```--large_dataset```.
149
+ * Switch the MASSA algorithm from HCA to MiniBatch-KMeans to handle large datasets.
150
+ * Options = auto (switches to KMeans if ≥ 10,000 molecules), false = use HCA (for smaller datasets), true = use KMeans (for large datasets).
151
+ * Default = auto.
152
+
153
+ #### Command line help
154
+ A full description of the arguments can also be viewed directly from the command line using the command:
155
+ ```
156
+ MASSA_Algorithm -h
157
+ ```
158
+ or
159
+ ```
160
+ MASSA_Algorithm --help
161
+ ```
162
+
163
+ ## Cite
164
+ 1. To ensure accurate citation, kindly include a reference to the MASSA article, accessible via the DOI:
165
+ Veríssimo, G. C.; Panteleão, S. Q.; Fernandes, P. O.; Gertrudes, J. C.; Kronenberger, T.; Honorio, K. M.; Maltarollo; V. G. MASSA Algorithm: an automated rational sampling of training and test subsets for QSAR modeling. J. Comput. Aided Mol. Des. 2023, 37, 735–754. https://doi.org/10.1007/s10822-023-00536-y.
166
+
167
+ 2. Furthermore, please incorporate the program citation following the provided template:
168
+
169
+ ```
170
+ @Misc{veríssimo2021,
171
+ author = {Gabriel Corrêa Veríssimo},
172
+ title = {MASSA Algorithm: Molecular data set sampling for training-test separation},
173
+ howpublished = {\url{https://github.com/gcverissimo/MASSA_Algorithm}},
174
+ year = {2021}
175
+ }
176
+ ```
177
+
178
+ ## References
179
+ [1]: DE VOS, N. J. kmodes categorical clustering library. https://github.com/nicodv/kmodes. 2015-2021.
180
+
@@ -32,14 +32,14 @@ python setup.py install
32
32
  ### Requirements
33
33
  * python: >= 3.8;
34
34
  * rdkit;
35
- * numpy: < 2.0;
35
+ * numpy;
36
36
  * pandas;
37
37
  * matplotlib: >= 3.2;
38
38
  * scipy: >= 1.6;
39
39
  * scikit-learn: > 0.24;
40
40
  * kmodes:¹ >= 0.10.
41
- Newer versions of the packages may also work, but they need to be tested.
42
- NOTE: Also tested on: scikit-learn: 1.7.0, scipy: 1.16.1, numpy: 2.0.2, rdkit: 2025.03.5.
41
+
42
+ NOTE: Also tested on: scikit-learn: 1.7.0, scipy: 1.16.1, numpy: 2.0.2, rdkit: 2025.03.5.
43
43
 
44
44
  ## Usage
45
45
  Once installed, the program can be run directly from the command line:
@@ -104,7 +104,7 @@ Optional arguments include:
104
104
  * **Ignore Errors**: ```-e``` or ```--drop_errors```.
105
105
  * Ignore chemistry errors, saving only molecules without any errors.
106
106
  * Options = true (ignore molecule errors and log them in the log file), false (treat molecule errors as fatal and fail the execution).
107
- * Default = false.
107
+ * Default = true.
108
108
  * **Large Dataset**: ```-a``` or ```--large_dataset```.
109
109
  * Switch the MASSA algorithm from HCA to MiniBatch-KMeans to handle large datasets.
110
110
  * Options = auto (switches to KMeans if ≥ 10,000 molecules), false = use HCA (for smaller datasets), true = use KMeans (for large datasets).
@@ -137,3 +137,4 @@ Veríssimo, G. C.; Panteleão, S. Q.; Fernandes, P. O.; Gertrudes, J. C.; Kronen
137
137
 
138
138
  ## References
139
139
  [1]: DE VOS, N. J. kmodes categorical clustering library. https://github.com/nicodv/kmodes. 2015-2021.
140
+
@@ -1,4 +1,4 @@
1
- [egg_info]
2
- tag_build =
3
- tag_date = 0
4
-
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -5,7 +5,7 @@ with open('README.md', 'r') as readme:
5
5
 
6
6
  setuptools.setup(
7
7
  name='MASSA_Algorithm',
8
- version='2.0.0',
8
+ version='2.2.0',
9
9
  description='MASSA Algorithm is a Python package to separate data sets of molecules into training and test sets, considering the diversity of structural, physicochemical and biological characteristics of these molecules.',
10
10
  long_description=long_description,
11
11
  long_description_content_type='text/markdown',
@@ -16,7 +16,7 @@ setuptools.setup(
16
16
  packages=setuptools.find_packages(),
17
17
  entry_points={'console_scripts': [
18
18
  'MASSA_Algorithm = MASSA_Algorithm.MASSA:main']},
19
- install_requires=['numpy < 2.0', 'rdkit', 'pandas', 'matplotlib >= 3.2',
19
+ install_requires=['numpy', 'rdkit', 'pandas', 'matplotlib >= 3.2',
20
20
  'scipy >= 1.6', 'scikit-learn > 0.24', 'kmodes >= 0.10'],
21
21
  python_requires='>=3.8',
22
22
  keywords=['chemoinformatics', 'training', 'test', 'training-test',
File without changes