MCPcopy Create free account
hub / github.com/Mew233/pairwise / process_fingerprint

Function process_fingerprint

pairwise/prepare_data.py:311–329  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

309 molecules = [mol for mol in supplier if mol is not None]
310
311 def process_fingerprint():
312 # load fingerprint data
313 ## column is drug, index is morgan bits
314 # Read SDF File
315 # supplier = rdkit.Chem.SDMolSupplier(os.path.join(ROOT_DIR, 'data', 'drug_data','structures.sdf'))
316
317
318 fingerprints = dict()
319 for mol in molecules:
320 drugbank_id = mol.GetProp('DATABASE_ID')
321 ## or use MACCS: (MACCSkeys.GenMACCSKeys(molecules[0])
322 ## Here is morgan
323 bitvect = AllChem.GetMorganFingerprintAsBitVect(mol,2,nBits=256).ToBitString()
324 fingerprint = [int(i) for i in bitvect]
325 fingerprints[split_it(drugbank_id)] = fingerprint
326
327 fingerprints = pd.DataFrame(fingerprints)
328 fingerprints.columns = fingerprints.columns.astype(int)
329 return fingerprints
330
331 def process_MACCS():
332 # MACCS fingerprint

Callers 1

load_drug_featuresFunction · 0.85

Calls 1

split_itFunction · 0.85

Tested by

no test coverage detected