scout/parse/peddy.py
def parse_peddy_ped(lines):
    """Parse a peddy.ped file
    
    Args:
        lines(iterable(str))
    
    Returns:
        peddy_ped(list(dict))
    """
    peddy_ped = []
    header = []
    for i,line in enumerate(lines):
        line = line.rstrip()
        if i == 0:
            # Header line
            header = line.lstrip('#').split('\t')
        else:
            ind_info = dict(zip(header, line.split('\t')))
            
            # PC1/PC2/PC3/PC4: the first 4 values after this sample was 
            # projected onto the thousand genomes principle components.
            ind_info['PC1'] = convert_number(ind_info['PC1'])
            ind_info['PC2'] = convert_number(ind_info['PC2'])
            ind_info['PC3'] = convert_number(ind_info['PC3'])
            # ancestry-prediction one of AFR AMR EAS EUR SAS UNKNOWN

            ind_info['het_call_rate'] = convert_number(ind_info['het_call_rate'])

            # idr_baf: inter-decile range (90th percentile - 10th percentile) 
            # of b-allele frequency. We make a distribution of all sites of 
            # alts / (ref + alts) and then report the difference between the
            # 90th and the 10th percentile. 
            # Large values indicated likely sample contamination.
            ind_info['het_idr_baf'] = convert_number(ind_info['het_idr_baf'])

            ind_info['het_mean_depth'] = convert_number(ind_info['het_mean_depth'])
            
            peddy_ped.append(ind_info)
    return peddy_ped
def parse_peddy_ped(lines):
    """Parse a peddy.ped file
    
    Args:
        lines(iterable(str))
    
    Returns:
        peddy_ped(list(dict))
    """
    peddy_ped = []
    header = []
    for i,line in enumerate(lines):
        line = line.rstrip()
        if i == 0:
            # Header line
            header = line.lstrip('#').split('\t')
        else:
            ind_info = dict(zip(header, line.split('\t')))
            
            # PC1/PC2/PC3/PC4: the first 4 values after this sample was 
            # projected onto the thousand genomes principle components.
            ind_info['PC1'] = convert_number(ind_info['PC1'])
            ind_info['PC2'] = convert_number(ind_info['PC2'])
            ind_info['PC3'] = convert_number(ind_info['PC3'])
            # ancestry-prediction one of AFR AMR EAS EUR SAS UNKNOWN

            ind_info['het_call_rate'] = convert_number(ind_info['het_call_rate'])

            # idr_baf: inter-decile range (90th percentile - 10th percentile) 
            # of b-allele frequency. We make a distribution of all sites of 
            # alts / (ref + alts) and then report the difference between the
            # 90th and the 10th percentile. 
            # Large values indicated likely sample contamination.
            ind_info['het_idr_baf'] = convert_number(ind_info['het_idr_baf'])

            ind_info['het_mean_depth'] = convert_number(ind_info['het_mean_depth'])
            
            peddy_ped.append(ind_info)
    return peddy_ped
Parse a peddy.ped file
    
    Args:
        lines(iterable(str))
    
    Returns:
        peddy_ped(list(dict))