code: def tx2genefile(gtf, out_file=None, data=None, tsv=True, keep_version=False):
      
      if tsv:
          extension = ".tsv"
          sep = "\t"
      else:
          extension = ".csv"
          sep = ","
      if file_exists(out_file):
          return out_file
      with file_transaction(data, out_file) as tx_out_file:
          with open(tx_out_file, "w") as out_handle:
              for k, v in tx2genedict(gtf, keep_version).items():
                  out_handle.write(sep.join([k, v]) + "\n")
      logger.info("tx2gene file %s created from %s." % (out_file, gtf))
      return out_file
docs: write out a file of transcript->gene mappings.