1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465(* Copyright (C) 2020, Francois Berenger
Yamanishi laboratory,
Department of Bioscience and Bioinformatics,
Faculty of Computer Science and Systems Engineering,
Kyushu Institute of Technology,
680-4 Kawazu, Iizuka, Fukuoka, 820-8502, Japan. *)(* A fingerprint-encoded molecule *)moduleA=ArraymoduleFp=FingerprintmoduleHt=HashtblmoduleL=MyListtypet={name:string;index:int;(* position in input file *)fp:Fp.t}letcreatenameindexbitstring={name;index;fp=Fp.of_stringbitstring}(* read one molecule from an FP file *)letread_one_molline=tryScanf.sscanfline"%s@,%f,%s"(funname_ic50bitstring->(name,bitstring))withScanf.Scan_failuremsg->failwith("FpMol.read_one_mol: fmt: %s@,%f,%s err: "^msg^" line: "^line)letparse_oneindexline=letname,bitstring=read_one_mollineincreatenameindexbitstringletmolecules_of_filefn=Utls.mapi_on_lines_of_filefnparse_oneletdistm1m2=Fp.distancem1.fpm2.fplettanim1m2=Fp.tanimotom1.fpm2.fpletget_namex=x.nameletget_indexx=x.indexletget_fpx=x.fpletnb_featuresx=Fp.nb_featuresx.fpletmol_is_activeline=BatString.starts_withline"active"letis_activex=mol_is_activex.nameletdrop_featuresto_dropx={xwithfp=Fp.drop_featuresto_dropx.fp}