예제 #1
0
    
    # Create input parameters for annotate() function.
    input = dict()
    input['genome'] = args.genome
    input['probanno'] = args.probanno
    if args.genomews is None:
        input['genome_workspace'] = user_workspace()
    else:
        input['genome_workspace'] = args.genomews
    if args.probannows is None:
        input['probanno_workspace'] = user_workspace()
    else:
        input['probanno_workspace'] = args.probannows
                
    # Create a probabilistic annotation client.
    if args.url is None:
        args.url = get_url()
    paClient = ProbabilisticAnnotation(url=args.url)

    # Submit a job to annotate the specified genome.
    try:
        jobid = paClient.annotate(input)
        print 'Probabilistic annotation job '+jobid+' successfully submitted'
    except Exception as e:
        print 'Error starting job: %s' %(e.message)
        if args.showError:
            traceback.print_exc(file=sys.stdout)
        exit(1)

    exit(0)
예제 #2
0
      
SEE ALSO
      pa-gendata

AUTHORS
      Matt Benedict, Mike Mundy 
'''

# Main script function
if __name__ == "__main__":

    # Parse arguments.
    parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter, prog='pa-savedata', epilog=desc3)
    parser.add_argument('configFilePath', help='path to configuration file', action='store', default=None)
    usage = parser.format_usage()
    parser.description = desc1 + '      ' + usage + desc2
    parser.usage = argparse.SUPPRESS
    args = parser.parse_args()

    # Get the probabilistic_annotation section from the configuration file.
    config = get_config(args.configFilePath)

    # Create a DataParser object for working with the static database files.
    dataParser = DataParser(config)

    # Store the static database files in Shock.
    paClient = ProbabilisticAnnotation(url=get_url())
    dataParser.storeDatabaseFiles(paClient._headers['AUTHORIZATION'])

    exit(0)
예제 #3
0
'''

# Main script function
if __name__ == "__main__":

    # Parse arguments.
    parser = argparse.ArgumentParser(
        formatter_class=argparse.RawDescriptionHelpFormatter,
        prog='pa-savedata',
        epilog=desc3)
    parser.add_argument('configFilePath',
                        help='path to configuration file',
                        action='store',
                        default=None)
    usage = parser.format_usage()
    parser.description = desc1 + '      ' + usage + desc2
    parser.usage = argparse.SUPPRESS
    args = parser.parse_args()

    # Get the probabilistic_annotation section from the configuration file.
    config = get_config(args.configFilePath)

    # Create a DataParser object for working with the static database files.
    dataParser = DataParser(config)

    # Store the static database files in Shock.
    paClient = ProbabilisticAnnotation(url=get_url())
    dataParser.storeDatabaseFiles(paClient._headers['AUTHORIZATION'])

    exit(0)
예제 #4
0
    parser.add_argument('newurl',
                        nargs='?',
                        default=None,
                        help='New URL endpoint')
    parser.add_argument('--no-check',
                        help='do not check for a valid URL',
                        action='store_true',
                        dest='noCheck',
                        default=False)
    usage = parser.format_usage()
    parser.description = desc1 + '      ' + usage + desc2
    parser.usage = argparse.SUPPRESS
    args = parser.parse_args()

    if args.newurl == None:
        url = get_url()
        print "Current URL: " + url
    else:
        url = set_url(args.newurl)
        if args.noCheck:
            print 'New URL set to: ' + url
            exit(0)
    try:
        paClient = ProbabilisticAnnotation(url=url)
        serverInfo = paClient.version()
        if serverInfo[0] != 'probabilistic_annotation':
            print url + ' is not a probabilistic annotation server'
            exit(1)
        print url + ' is valid and running %s v%s' % (serverInfo[0],
                                                      serverInfo[1])
    except ProbAnnoServerError as e:
예제 #5
0
      Matt Benedict, Mike Mundy
"""

if __name__ == "__main__":
    parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter, prog="pa_url", epilog=desc3)
    parser.add_argument("newurl", nargs="?", default=None, help="New URL endpoint")
    parser.add_argument(
        "--no-check", help="do not check for a valid URL", action="store_true", dest="noCheck", default=False
    )
    usage = parser.format_usage()
    parser.description = desc1 + "      " + usage + desc2
    parser.usage = argparse.SUPPRESS
    args = parser.parse_args()

    if args.newurl == None:
        url = get_url()
        print "Current URL: " + url
    else:
        url = set_url(args.newurl)
        if args.noCheck:
            print "New URL set to: " + url
            exit(0)
    try:
        paClient = ProbabilisticAnnotation(url=url)
        serverInfo = paClient.version()
        if serverInfo[0] != "probabilistic_annotation":
            print url + " is not a probabilistic annotation server"
            exit(1)
        print url + " is valid and running %s v%s" % (serverInfo[0], serverInfo[1])
    except ProbAnnoServerError as e:
        print "Endpoint at %s returned error: %s" % (url, e)