scout/parse/case.py
def parse_individuals(samples):
    """Parse the individual information

        Reformat sample information to proper individuals

        Args:
            samples(list(dict))

        Returns:
            individuals(list(dict))
    """
    individuals = []
    if len(samples) == 0:
        raise PedigreeError("No samples could be found")

    ind_ids = set()
    for sample_info in samples:
        parsed_ind = parse_individual(sample_info)
        individuals.append(parsed_ind)
        ind_ids.add(parsed_ind['individual_id'])

    # Check if relations are correct
    for parsed_ind in individuals:
        father = parsed_ind['father']
        if (father and father != '0'):
            if father not in ind_ids:
                raise PedigreeError('father %s does not exist in family' % father)
        mother = parsed_ind['mother']
        if (mother and mother != '0'):
            if mother not in ind_ids:
                raise PedigreeError('mother %s does not exist in family' % mother)

    return individuals
def parse_individuals(samples):
    """Parse the individual information

        Reformat sample information to proper individuals

        Args:
            samples(list(dict))

        Returns:
            individuals(list(dict))
    """
    individuals = []
    if len(samples) == 0:
        raise PedigreeError("No samples could be found")

    ind_ids = set()
    for sample_info in samples:
        parsed_ind = parse_individual(sample_info)
        individuals.append(parsed_ind)
        ind_ids.add(parsed_ind['individual_id'])

    # Check if relations are correct
    for parsed_ind in individuals:
        father = parsed_ind['father']
        if (father and father != '0'):
            if father not in ind_ids:
                raise PedigreeError('father %s does not exist in family' % father)
        mother = parsed_ind['mother']
        if (mother and mother != '0'):
            if mother not in ind_ids:
                raise PedigreeError('mother %s does not exist in family' % mother)

    return individuals
def parse_individuals ( samples ) : individuals = [ ] if len ( samples ) == 0 : raise PedigreeError ( "No samples could be found" ) ind_ids = set ( ) for sample_info in samples : parsed_ind = parse_individual ( sample_info ) individuals . append ( parsed_ind ) ind_ids . add ( parsed_ind [ 'individual_id' ] ) # Check if relations are correct for parsed_ind in individuals : father = parsed_ind [ 'father' ] if ( father and father != '0' ) : if father not in ind_ids : raise PedigreeError ( 'father %s does not exist in family' % father ) mother = parsed_ind [ 'mother' ] if ( mother and mother != '0' ) : if mother not in ind_ids : raise PedigreeError ( 'mother %s does not exist in family' % mother ) return individuals
Parse the individual information

        Reformat sample information to proper individuals

        Args:
            samples(list(dict))

        Returns:
            individuals(list(dict))
Parse the individual information