|
3 | 3 | """ |
4 | 4 | V2.1.4 (Mar. 08, 08:00:00 2023) |
5 | 5 | Update: 2023-06-24 (cleanup for ChemRxiv submission) |
| 6 | +Update: 2024-02-22 (minor cleanup and file renaming) |
6 | 7 |
|
7 | 8 | @author: Alexander Minidis (DocMinus) |
8 | 9 | Purpose: TDs from csv |
@@ -59,20 +60,20 @@ def main(): |
59 | 60 | # Calculate TDs |
60 | 61 | transforms_descriptors = transform_descriptors(cmpd1_smi, cmpd2_smi, prod_smi) |
61 | 62 |
|
62 | | - # for output create table with structures and combine with calculated TDs |
| 63 | + # combination of the three structure list to a df |
63 | 64 | _df = pd.DataFrame( |
64 | 65 | {"Compound 1": cmpd1_smi, "Compound 2": cmpd2_smi, "Product": prod_smi} |
65 | 66 | ) |
66 | | - # In addition: filter when empty structures |
| 67 | + # filter when empty structures |
67 | 68 | _df = _df[~((_df.iloc[:, :3] == "").any(axis=1))] |
68 | | - # The three tables are concatenated to one |
| 69 | + # Final table combines the structure list and the TDs |
69 | 70 | final_table = pd.concat( |
70 | 71 | [in_rct_df["ID"], _df, transforms_descriptors], axis=1, join="inner" |
71 | 72 | ) |
72 | | - # output (optional) |
73 | | - print(final_table.tail()) |
74 | 73 | ############################################################################# |
75 | | - # Write pickle & csv file |
| 74 | + # Output, multiple options |
| 75 | + print(final_table.tail()) |
| 76 | + # Write binary and tsv |
76 | 77 | print("\nWriting to file: ", final_output_pkl) |
77 | 78 | final_table.to_pickle(final_output_pkl) |
78 | 79 | print("\nWriting to file: ", final_output_tsv) |
|
0 commit comments