def querydict(querypath, splitdelim='\t'):
    """ querydict
        
        Read edirect query results file into a dictionary object.
        
        Arguments:
        * querypath (str) : Filepath of edirect results (format: 1 GSE per 
            newline).
        
        Returns:
        * query (dictionary) : Dictionary (format : keys = GSEs, vals = GSM 
            lists)
    """
    querylines = [line.rstrip('\n') for line in open(querypath)]
    querylist = []
    querydict = {}
    for line in querylines:
        querylist.append(line.split(splitdelim))
    for idlist in querylist:
        gsekey = list(filter(lambda x:'GSE' in x, idlist))[0]
        gsmlist = list(filter(lambda x:'GSM' in x, idlist))
        querydict[gsekey] = gsmlist
    return querydict