code: def trunc(qstart, qend, sstart, send, qlen, slen):
          
          ssum2 = (send + sstart) / 2.0
          sabs2 = np.abs(send - sstart) / 2.0
          smax = ssum2 + sabs2
          smin = ssum2 - sabs2
          q_match_len = np.abs(qstart - qend) + 1
          return (q_match_len < qlen) & ((smax >= slen) |  (smin <= 1))
docs: Check if a query sequence is truncated by the end of a subject sequence
  
          Args:
              qstart (int pandas.Series): Query sequence start index
              qend (int pandas.Series): Query sequence end index
              sstart (int pandas.Series): Subject sequence start index
              send (int pandas.Series): Subject sequence end index
              qlen (int pandas.Series): Query sequence length
              slen (int pandas.Series): Subject sequence length
  
          Returns:
              Boolean pandas.Series: Result truncated by subject sequence end?