Make dict mapping each donor to the location of all acceptors it splices
    to or each acceptor to all donors it splices from.

    Parameters
    ----------
    df : pandas.DataFrame 
        Dataframe with splice junction information from external database
        containing columns 'gene', 'chrom', 'start', 'end', 'strand',
        'chrom:start', 'chrom:end', 'donor', 'acceptor', 'intron'.

    feature : string
        Either 'donor' or 'acceptor'.

    strand : string
        Either '+' or '-'.

    Returns
    -------
    d : dict
        If feature='donor', dict whose keys are all distinct donors in df and
        whose values are the distinct locations (integers) of the acceptors that
        donor splices to in a numpy array. If feature='acceptor', dict whose
        keys are all distinct acceptors in df and whose values are the distinct
        locations (integers) of the donors that acceptor splices from in a numpy
        array.

def _make_splice_targets_dict(df, feature, strand):
    """Make dict mapping each donor to the location of all acceptors it splices
    to or each acceptor to all donors it splices from.

    Parameters
    ----------
    df : pandas.DataFrame 
        Dataframe with splice junction information from external database
        containing columns 'gene', 'chrom', 'start', 'end', 'strand',
        'chrom:start', 'chrom:end', 'donor', 'acceptor', 'intron'.

    feature : string
        Either 'donor' or 'acceptor'.

    strand : string
        Either '+' or '-'.

    Returns
    -------
    d : dict
        If feature='donor', dict whose keys are all distinct donors in df and
        whose values are the distinct locations (integers) of the acceptors that
        donor splices to in a numpy array. If feature='acceptor', dict whose
        keys are all distinct acceptors in df and whose values are the distinct
        locations (integers) of the donors that acceptor splices from in a numpy
        array.
    
    """
    g = df[df.strand == strand].groupby(feature)
    d = dict()
    if strand == '+':
        if feature == 'donor':
            target = 'end'
        if feature == 'acceptor':
            target = 'start'
    if strand == '-':
        if feature == 'donor':
            target = 'start'
        if feature == 'acceptor':
            target = 'end'

    for k in g.groups.keys():
        d[k] = np.array(list(set(df.ix[g.groups[k], target])))
        d[k].sort()
    return d