code: def get_gtf_db(gtf, in_memory=False):
      
      db_file = gtf + ".db"
      if file_exists(db_file):
          return gffutils.FeatureDB(db_file)
      if not os.access(os.path.dirname(db_file), os.W_OK | os.X_OK):
          in_memory = True
      db_file = ":memory:" if in_memory else db_file
      if in_memory or not file_exists(db_file):
          infer_extent = guess_infer_extent(gtf)
          disable_extent = not infer_extent
          db = gffutils.create_db(gtf, dbfn=db_file,
                                  disable_infer_genes=disable_extent,
                                  disable_infer_transcripts=disable_extent)
      if in_memory:
          return db
      else:
          return gffutils.FeatureDB(db_file)
docs: create a gffutils DB, in memory if we don't have write permissions