def handle_compressed_input(inputfq, file_type="<STR_LIT>"):
ut.check_existance(inputfq)<EOL>if inputfq.endswith(('<STR_LIT>', '<STR_LIT>')):<EOL><INDENT>import gzip<EOL>logging.info("<STR_LIT>".format(file_type, inputfq))<EOL>return gzip.open(inputfq, '<STR_LIT>')<EOL><DEDENT>elif inputfq.endswith('<STR_LIT>'):<EOL><INDENT>import bz2<EOL>logging.info("<STR_LIT>".format(file_type, inputfq))<EOL>return bz2.open(inputfq, '<STR_LIT>')<EOL><DEDENT>elif inputfq.endswith(('<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>')):<EOL><INDENT>return open(inputfq, '<STR_LIT:r>')<EOL><DEDENT>else:<EOL><INDENT>logging.error("<STR_LIT>".format(inputfq))<EOL>sys.exit('<STR_LIT>'<EOL>'<STR_LIT>'.format(inputfq))<EOL><DEDENT>
Return handles from compressed files according to extension.

    Check for which fastq input is presented and open a handle accordingly
    Can read from compressed files (gz, bz2, bgz) or uncompressed
    Relies on file extensions to recognize compression