code: def detailed_string(self):
          
          lines = []
          # TODO: annoying to always write `groupby_result.items()`,
          # consider makings a GroupBy class which iterates over pairs
          # and also common helper methods like `map_values`.
          for variant, variant_effects in self.groupby_variant().items():
              lines.append("\n%s" % variant)
  
              gene_effects_groups = variant_effects.groupby_gene_id()
              for (gene_id, gene_effects) in gene_effects_groups.items():
                  if gene_id:
                      gene_name = variant.ensembl.gene_name_of_gene_id(gene_id)
                      lines.append("  Gene: %s (%s)" % (gene_name, gene_id))
                  # place transcript effects with more significant impact
                  # on top (e.g. FrameShift should go before NoncodingTranscript)
                  for effect in sorted(
                          gene_effects,
                          key=effect_priority,
                          reverse=True):
                      lines.append("  -- %s" % effect)
  
              # if we only printed one effect for this gene then
              # it's redundant to print it again as the highest priority effect
              if len(variant_effects) > 1:
                  best = variant_effects.top_priority_effect()
                  lines.append("  Highest Priority Effect: %s" % best)
          return "\n".join(lines)
docs: Create a long string with all transcript effects for each mutation,
          grouped by gene (if a mutation affects multiple genes).