|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"""Package for BBB predictions.""" |
|
import argparse |
|
|
|
from .b3clf import b3clf |
|
|
|
try: |
|
from .version import __version__ |
|
except ImportError: |
|
__version__ = "0.0.0.post0" |
|
|
|
|
|
def main(): |
|
|
|
parser = argparse.ArgumentParser( |
|
description="b3clf predicts if molecules can pass blood-brain barrier with resampling " |
|
"strategies.", |
|
) |
|
parser.add_argument("-mol", |
|
default="input.sdf", |
|
type=str, |
|
help="Input file with descriptors.") |
|
parser.add_argument("-sep", |
|
type=str, |
|
default="\s+|\t+", |
|
help="""Separator for input file. Default="\s+|\\t+".""") |
|
parser.add_argument("-clf", |
|
type=str, |
|
default="xgb", |
|
help="Classification algorithm type. Default=xgb.") |
|
parser.add_argument("-sampling", |
|
type=str, |
|
default="classic_ADASYN", |
|
help="Resampling method type. Default=classic_ADASYN.") |
|
parser.add_argument("-output", |
|
type=str, |
|
default="B3clf_output.xlsx", |
|
help="Name of output file, CSV or XLSX format. Default=B3clf_output.xlsx.") |
|
parser.add_argument("-verbose", |
|
type=int, |
|
default=1, |
|
help="If verbose is not zero, B3clf will print out the predictions. " |
|
"Default=1.") |
|
parser.add_argument("-random_seed", |
|
type=int, |
|
default=42, |
|
help="""Romdom seed to control randonness. If set to be "None", """ |
|
"""it will result in a randomness of the predictions. Default=42.""") |
|
parser.add_argument("-time_per_mol", |
|
type=int, |
|
default=-1, |
|
help="""Time per molecule in seconds. If set to be -1, no time limit. """ |
|
"""Default=-1.""") |
|
parser.add_argument("-keep_features", |
|
type=str, |
|
default="no", |
|
help="""To keep computed feature file ("yes") or not ("no"). Default=no.""") |
|
parser.add_argument("-keep_sdf", |
|
type=str, |
|
default="no", |
|
help="""To keep computed molecular geometries ("yes") or not ("no"). Default=no.""") |
|
parser.add_argument("-threshold", |
|
type=str, |
|
default="none", |
|
help="""Threshold used for the classification which can be "none", """ |
|
""""J_threshold" and "F_threshold". "J_threshold" will use """ |
|
"""threshold optimized from Youden’s J statistic. "F_threshold" will """ |
|
"""use threshold optimized from F score. Default="none".""") |
|
args = parser.parse_args() |
|
|
|
_ = b3clf(mol_in=args.mol, |
|
sep=args.sep, |
|
clf=args.clf, |
|
sampling=args.sampling, |
|
output=args.output, |
|
verbose=args.verbose, |
|
random_seed=args.random_seed, |
|
time_per_mol=args.time_per_mol, |
|
keep_features=args.keep_features, |
|
keep_sdf=args.keep_sdf, |
|
threshold=args.threshold, |
|
) |
|
|
|
|
|
if __name__ == "__main__": |
|
"""B3clf command-line interface.""" |
|
main() |
|
|