code: def open_fastq(in_file):
      
      _, ext = os.path.splitext(in_file)
      if ext == ".gz":
          return gzip.open(in_file, 'rb')
      if ext in [".fastq", ".fq", ".fasta", ".fa"]:
          return open(in_file, 'r')
      return ValueError("File needs to be fastq|fasta|fq|fa [.gz]")
docs: open a fastq file, using gzip if it is gzipped
      from bcbio package