def get_sequence_from_seq_dict(bedline, seq_dict, bedtools_format=True):
    """ Extract the sequence of a specific bedline object from a seq_dict.
    The seq dict must contain RNA sequences, i.e. stranded and spliced.
    Args:
        bedline (bedline): bedline for which we have to get the seqeunce
        seq_dict (dict): dictionary of SeqIO objects
        bedtools_format (bool): sequence names are produced by bedtools -nameOnly
    Returns:
        Seq: sequence object
    """
    if bedtools_format:
        name = bedline.name + "(" + bedline.strand + ")"
    else:
        name = bedline.name
    try:
        seq = seq_dict[name].seq
    except KeyError as e:
        raise Exception('The record for '+name+' was not found in the fasta file') from e 

    return(seq)