#!/bin/python import pandas as pd import numpy as np from rdkit import Chem from rdkit.Chem import Descriptors from utils import * raw_data = pd.read_csv('raw/PDB-query_rawdata.csv') print(f'length of data before processing: {len(raw_data)}') # fill rows (containing different ligands) corresponding with the same crystal df_filled = fill_nans_iteratively(raw_data) print(f'length of data after filling NaN values (length should be the same): {len(df_filled)}') # filter by molecular weight of ligands to remove cofactors, crystallization agents, and ions df_filtered = filter_by_molecular_weight(df_filled) print(f'length of data after removing cofactors, crystallization factors, or ions: {len(df_filtered)}') df_filtered.to_csv('processed/processed_data.csv') print(f'data cleaning successful, resulting csv written to: processed/processed_data.csv')