Beispiel #1
0
def test_run():
    """Test run for sample vcf file"""

    print('neoepitope workflow test')
    path = os.path.dirname(os.path.abspath(__file__))
    options = config.baseoptions
    options['base']['predictors'] = 'netmhcpan'  #'mhcflurry'
    options['base']['mhc1_alleles'] = 'HLA-A*02:01'
    options['base']['path'] = 'neo_test'
    #options['base']['mhc2_length'] = 11
    #options['base']['verbose'] = True
    #options['base']['cpus'] = 4
    options['neopredict']['vcf_files'] = os.path.join(path, 'testing',
                                                      'input.vcf')
    options = config.check_options(options)
    #print (options)
    W = NeoEpitopeWorkFlow(options)
    st = W.setup()
    W.run()
Beispiel #2
0
def test_run():
    """Test run for a sample file"""

    path = os.path.dirname(os.path.abspath(__file__))
    options = config.baseoptions
    b=options['base']
    b['sequence_file'] = os.path.join(path, 'testing','zaire-ebolavirus.faa')
    b['mhc1_alleles'] = 'HLA-A*02:01,HLA-A*03:01,HLA-A*23:01'
    b['mhc2_alleles'] = 'human_common_mhc2'
    b['predictors'] = 'tepitope,mhcflurry'
    b['path'] = 'zaire_test'
    b['verbose'] = True
    b['cutoff_method'] = 'score'
    b['cutoffs'] = '5,500'
    #b['compression'] = 'gzip'
    b['overwrite'] = False
    options = config.check_options(options)
    W = WorkFlow(options)
    st = W.setup()
    W.run()
Beispiel #3
0
def test_run():
    """Test run for a sample file."""

    #installed = ','.join(check_installed())
    installed = 'tepitope,mhcflurry,netmhcpan'
    path = os.path.dirname(os.path.abspath(__file__))
    options = config.baseoptions
    b=options['base']
    b['sequence_file'] = os.path.join(path, 'testing','zaire-ebolavirus.faa')
    b['mhc1_alleles'] = 'HLA-A*02:01,HLA-A*03:01,HLA-A*02:06'
    b['mhc2_alleles'] = 'human_common_mhc2'
    b['mhc1_length'] = 9
    b['predictors'] = installed
    b['path'] = 'zaire_test'
    b['verbose'] = True
    b['cutoff_method'] = 'score'
    b['cutoffs'] = '5,500'
    b['overwrite'] = True
    options = config.check_options(options)
    W = WorkFlow(options)
    st = W.setup()
    W.run()
Beispiel #4
0
def main():
    "Run the application"

    import sys, os
    from optparse import OptionParser
    parser = OptionParser()
    parser.add_option("-c", "--config", dest="config",
                        help="Configuration file", metavar="FILE")
    parser.add_option("-r", "--run", dest="run",  action="store_true",
                        default=False, help="Run the predictions")
    parser.add_option("-p", "--presets", dest="presets",  action="store_true",
                        default=False, help="Show preset allele lists")
    parser.add_option("-l", "--list-alleles", dest="list_alleles",  action="store_true",
                        default=False, help="List available alleles")
    parser.add_option("-t", "--test", dest="test",  action="store_true",
                        default=False, help="Do test predictions")
    parser.add_option("-a", "--analysis", dest="analysis",
                        help="Analysis path", metavar="FILE")
    parser.add_option("-n", "--neoepitope", dest="neoepitope", action="store_true",
                        default=False, help="Neo-epitope pipeline")
    parser.add_option("-s", "--server", dest="server",  action="store_true",
                        default=False, help="Run web app")
    parser.add_option("-x", "--port", dest="port", default=8000,
                        help="Port for web app, default 8000")
    parser.add_option("-v", "--version", dest="version", action="store_true",
                        help="Get version")

    opts, remainder = parser.parse_args()

    if opts.config != None:
        cp = config.parse_config(opts.config)
        options = config.get_options(cp)
        options = config.check_options(options)
    else:
        conffile = 'default.conf'
        if not os.path.exists(conffile):
            config.write_config(conffile, defaults=config.baseoptions)
    if opts.presets == True:
        show_preset_alleles()
    elif opts.list_alleles == True:
        list_alleles()
    elif opts.run == True:
        W = WorkFlow(options)
        st = W.setup()
        if st == True:
            W.run()
    elif opts.analysis is not None:
        W = WorkFlow()
        W.analysis(opts.analysis)
    elif opts.neoepitope == True:
        if opts.test == True:
            neo.test_run()
        else:
            W = neo.NeoEpitopeWorkFlow(options)
            st = W.setup()
            if st == True:
                W.run()
    elif opts.server == True:
        #from epitopepredict.server import webapp
        #webapp.run(port=5000, debug=True)
        import epitopepredict.tornado_serve
        epitopepredict.tornado_serve.main(opts.port)
    elif opts.test == True:
        test_run()
    elif opts.version == True:
        from . import __version__
        print ('epitopepredict version %s' %__version__)
    else:
        print_help()