code: def predicted_effects_for_variant(
          variant,
          transcript_id_whitelist=None,
          only_coding_changes=True):
      effects = []
      for transcript in variant.transcripts:
          if only_coding_changes and not transcript.complete:
              logger.info(
                  "Skipping transcript %s for variant %s because it's incomplete",
                  transcript.name,
                  variant)
              continue
          if transcript_id_whitelist and transcript.id not in transcript_id_whitelist:
              logger.info(
                  "Skipping transcript %s for variant %s because it's not one of %d allowed",
                  transcript.name,
                  variant,
                  len(transcript_id_whitelist))
              continue
          effects.append(variant.effect_on_transcript(transcript))
      effects = EffectCollection(effects)
      n_total_effects = len(effects)
      logger.info("Predicted total %d effects for variant %s" % (
          n_total_effects,
          variant))
      if not only_coding_changes:
          return effects
      else:
          nonsynonymous_coding_effects = effects.drop_silent_and_noncoding()
          logger.info(
              "Keeping %d/%d effects which affect protein coding sequence for %s: %s",
              len(nonsynonymous_coding_effects),
              n_total_effects,
              variant,
              nonsynonymous_coding_effects)
          usable_effects = [
              effect
              for effect in nonsynonymous_coding_effects
              if effect.mutant_protein_sequence is not None
          ]
          logger.info(
              "Keeping %d effects with predictable AA sequences for %s: %s",
              len(usable_effects),
              variant,
              usable_effects)
          return usable_effects