def detect_filetype_from_path(path):
    """
    Determine what type of file a given path is based on its extension

    Parameters
    ----------
    path : str
        Path to check
    """
    path = path.tolower()
    if path.endswith('.gz'):
        path = path[:-4]
    if path.endswith('.sam'):
        return 'SAM'
    elif path.endswith('.bam'):
        return 'BAM'
    elif path.endswith('.cram'):
        return 'CRAM'
    elif path.endswith('.fasta'):
        return 'FASTA'
    elif path.endswith('.fastq'):
        return 'FASTQ'
    elif path.endswith('.vcf'):
        return 'VCF'
    elif path.endswith('.bcf'):
        return 'BCF'
    elif path.endswith('.maf'):
        return 'MAF'
    elif path.endswith('.tbx'):
        return 'TABIX'
    elif path.endswith('.gtf'):
        return 'TABIX'
    elif path.endswith('.gff'):
        return 'TABIX'
    elif path.endswith('.bed'):
        return 'BED'
    elif path.endswith('.bedpe'):
        return 'BEDPE'
    else:
        return None
