-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.py
35 lines (26 loc) · 1.33 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import pandas as pd
import enraqsar as enq
import os
import typer
from rich import print
from rich.console import Console
from rich.table import Table
def main(input: str = typer.Option("example.xlsx", help="Input file name for example example.xlsx"),
output: str = typer.Option("output.csv", help="Output file name for example output.csv")):
typer.secho('This software calculate the skin irritation using cytotoxicity value (pIC50 and IC50) of chemical against keratinocyte HaCaT cell from Chemical SMILES', fg=typer.colors.WHITE, bold=True)
typer.secho('Please wait for a while', fg=typer.colors.WHITE, bold=True)
test = pd.read_excel(os.path.join('input',input), index_col='LigandID')
result = enq.enraqsar(test)
result.to_csv(os.path.join('output', output))
console = Console()
table = Table(show_header=True, header_style="bold green")
table.add_column("LigandID")
for column in result.columns:
table.add_column(column)
for index, row in result.iterrows():
table.add_row(index, *row.round(2).astype(str).tolist())
console.print(table)
typer.secho('The result has been saved in output folder', fg=typer.colors.WHITE, bold=True)
typer.secho('Thank you for using this software', fg=typer.colors.WHITE, bold=True)
if __name__ == '__main__':
typer.run(main)