code: public static <S extends Sequence<S>> int calculateScore(S seq1, Range seq1Range, Mutations<S> mutations,
                                                               AlignmentScoring<S> scoring) {
          if (scoring instanceof LinearGapAlignmentScoring)
              return calculateScore(seq1, seq1Range, mutations, (LinearGapAlignmentScoring<S>) scoring);
          else if (scoring instanceof AffineGapAlignmentScoring)
              return calculateScore(seq1, seq1Range, mutations, (AffineGapAlignmentScoring<S>) scoring);
          else
              throw new IllegalArgumentException("Unknown scoring type");
      }
docs: Calculates score of alignment
  
  @param seq1      target sequence
  @param seq1Range aligned range
  @param mutations mutations (alignment)
  @param scoring   scoring
  @param <S>       sequence type
  @return score