code: def to_dataframe(self):
          
          # list of properties to extract from Variant objects if they're
          # not None
          variant_properties = [
              "contig",
              "start",
              "ref",
              "alt",
              "is_snv",
              "is_transversion",
              "is_transition"
          ]
  
          def row_from_effect(effect):
              row = OrderedDict()
  
              row['variant'] = str(effect.variant.short_description)
              for field_name in variant_properties:
                  # if effect.variant is None then this column value will be None
                  row[field_name] = getattr(effect.variant, field_name, None)
              row['gene_id'] = effect.gene_id
              row['gene_name'] = effect.gene_name
              row['transcript_id'] = effect.transcript_id
              row['transcript_name'] = effect.transcript_name
  
              row['effect_type'] = effect.__class__.__name__
              row['effect'] = effect.short_description
              return row
          return pd.DataFrame.from_records([row_from_effect(effect) for effect in self])
docs: Build a dataframe from the effect collection