ersilia-os / eos9taz

MoLeR developed by MSR for molecule generation
GNU General Public License v3.0
0 stars 0 forks source link

Clean UP & Dockerization eos9taz #3

Closed GemmaTuron closed 1 year ago

ZakiaYahya commented 1 year ago

I have made the following changes in the model and open PR on it.

(1). Deleted all .dvc folders and files (2) Update LICENSE file to GNU (3) Modify src/service.py from predict torunapi and change python {0}/main.py {0}/MODEL_DIR {1} {2} to bash {0}/run.sh {0} {1} {2} (4) Move MODEL_DIR that contains model file to checkpoints folder (5) Move molecule_generation folder and main.py to code folder (6) Add run.sh in framework folder (7) Initially the number of molecules it is showing in the output is 99 due to this

        with open(output_file, 'w') as f:
        df['smiles'].iloc[0:99].to_csv(output_file, sep='\t', index=False)

So, i changed it to df['smiles'].iloc[0:100].to_csv(output_file, sep='\t', index=False) in main.py so it returns 100 samples of generated molecules in the output file (8) I have modified main.py as it is taking arguments directly as an input using argument parser and not using run.sh before, it is using def get_argparser() -> argparse.ArgumentParser: and def run_from_args(args: argparse.Namespace) -> None: functions to take arguments as an input and then parse it.

To omit arguments and the parser in the code and provide model_dir as an absolute path and input_file & output_file as an argument directly in the script, i modified the main() function and remove the argument parser. In this modified version, the argument parser has been removed i.e. def get_argparser() and def run_from_args(args: argparse.Namespace) from main.py and simply replaced by

    ROOT = os.path.dirname(os.path.abspath(__file__))
    model_directory = os.path.abspath(os.path.join(ROOT,"..","..","checkpoints","MODEL_DIR"))

    input_file = sys.argv[1]
    output_file = sys.argv[2]

Thanks