def _setup_genome_annotations(g, args, ann_groups):
    """Configure genome annotations to install based on datatarget.
    """
    available_anns = g.get("annotations", []) + g.pop("annotations_available", [])
    anns = []
    for orig_target in args.datatarget:
        if orig_target in ann_groups:
            targets = ann_groups[orig_target]
        else:
            targets = [orig_target]
        for target in targets:
            if target in available_anns:
                anns.append(target)
    g["annotations"] = anns
    if "variation" not in args.datatarget and "validation" in g:
        del g["validation"]
    return g
def _setup_genome_annotations ( g , args , ann_groups ) : available_anns = g . get ( "annotations" , [ ] ) + g . pop ( "annotations_available" , [ ] ) anns = [ ] for orig_target in args . datatarget : if orig_target in ann_groups : targets = ann_groups [ orig_target ] else : targets = [ orig_target ] for target in targets : if target in available_anns : anns . append ( target ) g [ "annotations" ] = anns if "variation" not in args . datatarget and "validation" in g : del g [ "validation" ] return g
Configure genome annotations to install based on datatarget.