Parse the result line of a phenomizer request.
    
    Arguments:
        line (str): A raw output line from phenomizer
    
    Returns:
         result (dict): A dictionary with the phenomizer info:
             {
                'p_value': float,
                'gene_symbols': list(str),
                'disease_nr': int,
                'disease_source': str,
                'description': str,
                'raw_line': str
             }

def parse_result(line):
    """
    Parse the result line of a phenomizer request.
    
    Arguments:
        line (str): A raw output line from phenomizer
    
    Returns:
         result (dict): A dictionary with the phenomizer info:
             {
                'p_value': float,
                'gene_symbols': list(str),
                'disease_nr': int,
                'disease_source': str,
                'description': str,
                'raw_line': str
             }
             
    """
    
    if line.startswith("Problem"):
        raise RuntimeError("Login credentials seems to be wrong")

    result = {
        'p_value': None,
        'gene_symbols': [],
        'disease_nr': None,
        'disease_source': None,
        'description': None,
        'raw_line': line
    }
    
    result['raw_line'] = line.rstrip()
    result_line = line.rstrip().split('\t')
    
    try:
        result['p_value'] = float(result_line[0])
    except ValueError:
        pass

    try:
        medical_litterature = result_line[2].split(':')
        result['disease_source'] = medical_litterature[0]
        result['disease_nr'] = int(medical_litterature[1])
    except IndexError:
        pass

    try:
        description = result_line[3]
        result['description'] = description
    except IndexError:
        pass

    if len(result_line) > 4:
        for gene_symbol in result_line[4].split(','):
            result['gene_symbols'].append(gene_symbol.strip())

    return result