def detect_file_type_stream(stream):
    """Read a file and guess if its a fasta or gtf file
    Parameters
    ----------
    stream: file
        name of file object to examine
    Returns
    -------
    str
        fasta, gtf, or unrecognized
    """
    head = stream.read(1024)
    if head[0] == '>':
        return 'fasta'
    elif '\t' in head:
        return 'gtf'
    else:
        return 'unrecognized'