Check if a target file is in bam and bigWig formats by looking at the file extension
target.type(target, type = "")
target
target file
type
type name