kmeans.py
def generate_fingerprint_df(infile_name, fp_type="morgan2", fp_bits=1024):
    """
    Read an input file and generate fingerprints to infile_name + _parquet.gz
    :param infile_name: input file name
    :param fp_type: fingerprint file
    :param fp_bits: fingerprint bits
    :return: fingerprint dataframe
    """
    fingerprint_generator = FingerprintGenerator(fp_type, fp_bits)
    suppl = molecule_supplier_from_name(infile_name)
    fp_list = []
    name_list = []
    smiles_list = []
    print(f"Generating {fp_type} fingerprints with {fp_bits} bits")
    for mol in tqdm(suppl):
        if mol:
            smiles = Chem.MolToSmiles(mol)
            fp_list.append(fingerprint_generator.get_numpy_fp(mol))
            name_list.append(mol.GetProp("_Name"))
            smiles_list.append(smiles)
    start = time.time()
    df = pd.DataFrame(np.array(fp_list), columns=fingerprint_generator.get_names())
    elapsed = time.time() - start
    df.insert(0, "SMILES", smiles_list)
    df.insert(1, "Name", name_list)
    print(f"{elapsed:.1f} sec required to generate dataframe")
    return df

    Read an input file and generate fingerprints to infile_name + _parquet.gz
    :param infile_name: input file name
    :param fp_type: fingerprint file
    :param fp_bits: fingerprint bits
    :return: fingerprint dataframe
    
Read an input file and generate fingerprints to infile_name + _parquet.gz
Read an input file and generate fingerprints to infile_name + _parquet . gz
def generate_fingerprint_df(infile_name, fp_type="morgan2", fp_bits=1024):
    fingerprint_generator = FingerprintGenerator(fp_type, fp_bits)
    suppl = molecule_supplier_from_name(infile_name)
    fp_list = []
    name_list = []
    smiles_list = []
    print(f"Generating {fp_type} fingerprints with {fp_bits} bits")
    for mol in tqdm(suppl):
        if mol:
            smiles = Chem.MolToSmiles(mol)
            fp_list.append(fingerprint_generator.get_numpy_fp(mol))
            name_list.append(mol.GetProp("_Name"))
            smiles_list.append(smiles)
    start = time.time()
    df = pd.DataFrame(np.array(fp_list), columns=fingerprint_generator.get_names())
    elapsed = time.time() - start
    df.insert(0, "SMILES", smiles_list)
    df.insert(1, "Name", name_list)
    print(f"{elapsed:.1f} sec required to generate dataframe")
    return df
def generate_fingerprint_df ( infile_name , fp_type = "morgan2" , fp_bits = 1024 ) : fingerprint_generator = FingerprintGenerator ( fp_type , fp_bits ) suppl = molecule_supplier_from_name ( infile_name ) fp_list = [ ] name_list = [ ] smiles_list = [ ] print ( f"Generating {fp_type} fingerprints with {fp_bits} bits" ) for mol in tqdm ( suppl ) : if mol : smiles = Chem . MolToSmiles ( mol ) fp_list . append ( fingerprint_generator . get_numpy_fp ( mol ) ) name_list . append ( mol . GetProp ( "_Name" ) ) smiles_list . append ( smiles ) start = time . time ( ) df = pd . DataFrame ( np . array ( fp_list ) , columns = fingerprint_generator . get_names ( ) ) elapsed = time . time ( ) - start df . insert ( 0 , "SMILES" , smiles_list ) df . insert ( 1 , "Name" , name_list ) print ( f"{elapsed:.1f} sec required to generate dataframe" ) return df
Read an input file and generate fingerprints to infile_name + _parquet.gz
Read an input file and generate fingerprints to infile_name + _parquet . gz
"""
    Read an input file and generate fingerprints to infile_name + _parquet.gz
    :param infile_name: input file name
    :param fp_type: fingerprint file
    :param fp_bits: fingerprint bits
    :return: fingerprint dataframe
    """
None
infile_name
input file name
input file name
fp_type
None
fp_bits
None