ProGENI_simplified.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:ProGENI 作者: KnowEnG 项目源码 文件源码
def parse_args():
    """
    Parse the arguments.
    Parse the command line arguments/options using the argparse module
    and return the parsed arguments (as an argparse.Namespace object,
    as returned by argparse.parse_args()).
    Returns:
        argparse.Namespace: the parsed arguments
    """
    parser = argparse.ArgumentParser()
    parser.add_argument('input_expression', type=str,
                        help='name of the file containg expression data')
    parser.add_argument('input_response', type=str,
                        help='name of the file containg response data')
    parser.add_argument('input_network', type=str,
                        help='name of the file containg network data')
    parser.add_argument('-s', '--seed', type=int, default=1011,
                        help='seed used for random generator')
    parser.add_argument('-pt', '--prob_restart_trans', type=float, default=0.5,
                        help='restart probability of RWR to network-transform expression')
    parser.add_argument('-t', '--tolerance', type=float, default=1e-8,
                        help='tolerance used to determine convergence of RWR')
    parser.add_argument('-mi', '--max_iteration', type=int, default=100,
                        help='maximum number of iterations used in RWR')
    parser.add_argument('-nb', '--num_bootstrap', type=int, default=1,
                        help='number of bootstrap samplings')
    parser.add_argument('-pb', '--percent_bootstrap', type=int, default=100,
                        help='percent of samples for bootstrap samplinga (between 0-100)')
    parser.add_argument('-de', '--directory_expression', type=str,
                        default='./',
                        help='directory containing expression data')
    parser.add_argument('-dr', '--directory_response', type=str,
                        default='./',
                        help='directory containing response data')
    parser.add_argument('-dn', '--directory_network', type=str,
                        default='./',
                        help='directory containing network data')
    parser.add_argument('-do', '--directory_out', type=str,
                        default='./',
                        help='directory for the results')
    parser.add_argument('-o', '--output', type=str,
                        default='results.csv',
                        help='name of the file containg the results')
    args = parser.parse_args()
    return args


###############################################################################
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号