MASSA-Algorithm 0.9.2__py3-none-any.whl → 0.9.4__py3-none-any.whl

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.
@@ -1,7 +1,8 @@
1
1
  import pandas as pd
2
2
  from rdkit.Chem import Descriptors
3
- from rdkit.Chem import rdMolDescriptors
4
- from rdkit.DataStructs import cDataStructs
3
+ from rdkit.Chem import AllChem
4
+ # from rdkit.Chem import rdMolDescriptors
5
+ # from rdkit.DataStructs import cDataStructs
5
6
 
6
7
  def physicochemical_descriptors(file):
7
8
  NumHAcceptors = {}
@@ -33,9 +34,25 @@ def physicochemical_descriptors(file):
33
34
  def atompairs_fingerprint(file):
34
35
  FP_dict = {}
35
36
  for i in file['molecules']:
36
- FPasBitVect = rdMolDescriptors.GetHashedAtomPairFingerprintAsBitVect(i, nBits=1024) # Determine the fingerprint of the molecule using AtomPairs Fingerprint.
37
- FPasBinary = cDataStructs.BitVectToText(FPasBitVect) # Convert fingerprint to text.
38
- BinaryAsList = list(FPasBinary) # Each bit of fingerprint will be a string item of a list.
37
+ # Updated AtomPair Fingerprint (without count).
38
+ # To use AtomPairCount use the function (fpgen.GetCountFingerprintAsNumPy).
39
+ # 1) Determine the fingerprint generator using AtomPairs Fingerprint.
40
+ # 2) Generate the numpy array fingerprint using the generator.
41
+ # 3) Transform the np.array in list.
42
+ fpgen = AllChem.GetAtomPairGenerator(fpSize=1024) # 1
43
+ FPasBinary = fpgen.GetFingerprintAsNumPy(i) # 2
44
+ BinaryAsList = list(FPasBinary) # 3
45
+
46
+ # DEPRECATED (by RDKit):
47
+ # 1) Determine the fingerprint of the molecule using AtomPairs Fingerprint.
48
+ # 2) Convert fingerprint to text.
49
+ # 3) Each bit of fingerprint will be a string item of a list.
50
+ # FPasBitVect = rdMolDescriptors.GetHashedAtomPairFingerprintAsBitVect(
51
+ # i, nBits=1024
52
+ # ) # 1
53
+ # FPasBinary = cDataStructs.BitVectToText(FPasBitVect) # 2
54
+ # BinaryAsList = list(FPasBinary) # 3
55
+
39
56
  BinaryAsNewList = []
40
57
  for a in BinaryAsList:
41
58
  b = int(a) # Each bit of fingerprint will be a int item of a list.
@@ -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. 0.9.2
23
+ █▓▓▓███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░███▓▓▓█ Version: v. 0.9.4
24
24
  █▒▓▓▒▒▒████░░░░░░░░░░░░░░░░░░░░░░░░░░░░████▒▒▓▓▒█
25
25
  ██▓▒▒▒▓▓▓▓██████████████████████████████▓▓▓▒▒▒▒▓█ Developed by: Gabriel Corrêa Veríssimo
26
26
  ██▒▒▒▓▓▒▒▒▒▓▓▒▒▒▒▓▓▒▒▒▒▒▒▒▒▒▒▒▒▓▓▒▒▒▒▓▓▒▒▒▓▓▒▒██ LICENSE: AGPL-3.0