code: def interval_offset_on_transcript(start, end, transcript):
      
      # ensure that start_pos:end_pos overlap with transcript positions
      if start > end:
          raise ValueError(
              "start_pos %d shouldn't be greater than end_pos %d" % (
                  start, end))
      if start > transcript.end:
          raise ValueError(
              "Range %d:%d starts after transcript %s (%d:%d)" % (
                  start,
                  end,
                  transcript,
                  transcript.start,
                  transcript.end))
      if end < transcript.start:
          raise ValueError(
              "Range %d:%d ends before transcript %s (%d:%d)" % (
                  start,
                  end,
                  transcript,
                  transcript.start,
                  transcript.end))
      # trim the start position to the beginning of the transcript
      if start < transcript.start:
          start = transcript.start
      # trim the end position to the end of the transcript
      if end > transcript.end:
          end = transcript.end
      # return earliest offset into the spliced transcript
      return min(
          transcript.spliced_offset(start),
          transcript.spliced_offset(end))
docs: Given an interval [start:end] and a particular transcript,
      return the start offset of the interval relative to the
      chromosomal positions of the transcript.