scout/commands/update/phenotype_groups.py
def groups(context, institute_id, phenotype_group, group_abbreviation, group_file, add):
    """
    Update the phenotype for a institute.
    If --add the groups will be added to the default groups. Else the groups will be replaced.
    """
    adapter = context.obj['adapter']
    LOG.info("Running scout update institute")
    if group_file:
        phenotype_group = []
        group_abbreviation = []
        for line in group_file:
            if line.startswith('#'):
                continue
            if len(line) < 7:
                continue
            line = line.rstrip().split('\t')
            phenotype_group.append(line[0])
            if line[1]:
                group_abbreviation.append(line[1])
    
    if not phenotype_group:
        LOG.info("Please provide some groups")
        return

    if (phenotype_group and group_abbreviation):
        if not len(phenotype_group) == len(group_abbreviation):
            LOG.warning("Specify same number of groups and abbreviations")
            return

    # try:
    adapter.update_institute(
        internal_id=institute_id, 
        phenotype_groups=phenotype_group,
        group_abbreviations=group_abbreviation,
        add_groups = add,
        )
def groups(context, institute_id, phenotype_group, group_abbreviation, group_file, add):
    """
    Update the phenotype for a institute.
    If --add the groups will be added to the default groups. Else the groups will be replaced.
    """
    adapter = context.obj['adapter']
    LOG.info("Running scout update institute")
    if group_file:
        phenotype_group = []
        group_abbreviation = []
        for line in group_file:
            if line.startswith('#'):
                continue
            if len(line) < 7:
                continue
            line = line.rstrip().split('\t')
            phenotype_group.append(line[0])
            if line[1]:
                group_abbreviation.append(line[1])
    
    if not phenotype_group:
        LOG.info("Please provide some groups")
        return

    if (phenotype_group and group_abbreviation):
        if not len(phenotype_group) == len(group_abbreviation):
            LOG.warning("Specify same number of groups and abbreviations")
            return

    # try:
    adapter.update_institute(
        internal_id=institute_id, 
        phenotype_groups=phenotype_group,
        group_abbreviations=group_abbreviation,
        add_groups = add,
        )
Update the phenotype for a institute.
    If --add the groups will be added to the default groups. Else the groups will be replaced.