code: public Allele rightHardClip(final String pattern) throws IllegalSymbolException, IndexOutOfBoundsException, IllegalAlphabetException, AlleleException {
          int end = this.getEnd();
  
          // System.out.println("end before = " + end);
  
          SymbolList copy = DNATools.createDNA(sequence.seqString());
          while (copy.seqString().endsWith(pattern)) {
              copy.edit(new Edit(copy.length() - pattern.length() + 1, pattern.length(), SymbolList.EMPTY_LIST));
  
              end -= pattern.length();
  
              // System.out.println("end during " + end);
              // System.out.println("editing copy " + copy.seqString());
          }
  
          // System.out.println("end after = " + end);
          // System.out.println("edited copy = " + copy.seqString());
  
          return builder()
              .withContig(this.getContig())
              .withStart(this.getStart())
              .withEnd(end)
              .withSequence(copy)
              .withLesion(this.lesion)
              .build();
      }
docs: A method to simulate hard clipping (removal) of rightmost sequence, for example synthesized sequence representing molecular barcodes or target capture probes (primers)
  @param pattern sequence (will be strictly matched, no regular expressions)
  @return new Allele with clipped sequence
  @throws IllegalAlphabetException
  @throws AlleleException
  @throws IllegalSymbolException