def _annotate_genome(meth, genome, out_genome):
    """Annotate a Genome object with structural and functional gene annotations.
    The annotation job may run for an hour or longer. When the annotation job finishes,
    the annotated Genome object will be stored in your workspace. [4]
    
    :param genome: Source genome ID [4.1]
    :type genome: kbtypes.KBaseGenomes.Genome
    :ui_name genome: Genome ID
    :param out_genome: Annotated output genome ID. If empty, annotation will be added into original genome object. [4.2]
    :type out_genome: kbtypes.KBaseGenomes.Genome
    :ui_name out_genome: Output Genome ID
    :return: Annotated output genome ID
    :rtype: kbtypes.KBaseGenomes.Genome
    :output_widget: GenomeAnnotation
    """
    meth.stages = 1  # for reporting progress
    token = os.environ['KB_AUTH_TOKEN']
    workspace = os.environ['KB_WORKSPACE_ID']
    if not out_genome:
        out_genome = genome
    cmpClient = GenomeComparison(url = service.URLS.genomeCmp, token = token)
    annotate_genome_params = {
        'in_genome_ws': workspace, 
        'in_genome_id': genome, 
        'out_genome_ws': workspace, 
        'out_genome_id': out_genome, 
    }
    job_id = cmpClient.annotate_genome(annotate_genome_params)
    return json.dumps({'ws_name': workspace, 'ws_id': out_genome, 'job_id': job_id})
def _add_kbase_annotation(meth, genome, out_genome):
    """Add KBase annotations to a genome.  This function will start a job that might run for an hour or longer.
    When the job finishes, the Genome with KBase annotations will be stored in your workspace. [21]
    
    :param genome: Source genome ID [21.1]
    :type genome: kbtypes.KBaseGenomes.Genome
    :ui_name genome: Genome ID
    :param out_genome: Annotated output genome ID. If empty, annotation will be added into original genome object. [21.2]
    :type out_genome: kbtypes.KBaseGenomes.Genome
    :ui_name out_genome: Output Genome ID
    :return: Annotated output genome ID
    :rtype: kbtypes.Genome
    :output_widget: GenomeAnnotation
    """
    meth.stages = 1  # for reporting progress
    token = os.environ['KB_AUTH_TOKEN']
    workspace = os.environ['KB_WORKSPACE_ID']
    if not out_genome:
        out_genome = genome
    cmpClient = GenomeComparison(url = service.URLS.genomeCmp, token = token)
    annotate_genome_params = {
        'in_genome_ws': workspace, 
        'in_genome_id': genome, 
        'out_genome_ws': workspace, 
        'out_genome_id': out_genome,
        'seed_annotation_only' : 1,
    }
    job_id = cmpClient.annotate_genome(annotate_genome_params)
    return json.dumps({'ws_name': workspace, 'ws_id': out_genome, 'job_id': job_id})