<commit_before>/*
 * Copyright 2015 MiLaboratory.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.milaboratory.core.alignment;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.milaboratory.core.sequence.*;

import java.io.ObjectStreamException;

/**
 * LinearGapAlignmentScoring - scoring system which uses penalty for gap
 */
public final class LinearGapAlignmentScoring<S extends Sequence<S>> extends AbstractAlignmentScoring<S>
        implements java.io.Serializable {
    /**
     * Penalty for gap, must be < 0
     */
    private final int gapPenalty;

    /**
     * Creates new LinearGapAlignmentScoring. Required for deserialization defaults.
     */
    @SuppressWarnings("unchecked")
    private LinearGapAlignmentScoring() {
        super((Alphabet) NucleotideSequence.ALPHABET, new SubstitutionMatrix(Integer.MIN_VALUE, Integer.MIN_VALUE));
        gapPenalty = Integer.MIN_VALUE;
    }

    @JsonCreator
    public LinearGapAlignmentScoring(
            @JsonProperty("alphabet") Alphabet<S> alphabet,
            @JsonProperty("subsMatrix") SubstitutionMatrix subsMatrix,
            @JsonProperty("gapPenalty") int gapPenalty) {
        super(alphabet, subsMatrix);<commit_msg>JSON backward compatibility for LinearGapAlignmentScoring<commit_after>/*
 * Copyright 2015 MiLaboratory.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.milaboratory.core.alignment;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.milaboratory.core.sequence.*;

import java.io.ObjectStreamException;

/**
 * LinearGapAlignmentScoring - scoring system which uses penalty for gap
 */
@JsonIgnoreProperties({"minimalMatchScore", "maximalMatchScore", "minimalMismatchScore", "maximalMismatchScore"})
public final class LinearGapAlignmentScoring<S extends Sequence<S>> extends AbstractAlignmentScoring<S>
        implements java.io.Serializable {
    /**
     * Penalty for gap, must be < 0
     */
    private final int gapPenalty;

    /**
     * Creates new LinearGapAlignmentScoring. Required for deserialization defaults.
     */
    @SuppressWarnings("unchecked")
    private LinearGapAlignmentScoring() {
        super((Alphabet) NucleotideSequence.ALPHABET, new SubstitutionMatrix(Integer.MIN_VALUE, Integer.MIN_VALUE));
        gapPenalty = Integer.MIN_VALUE;
    }

    @JsonCreator
    public LinearGapAlignmentScoring(
            @JsonProperty("alphabet") Alphabet<S> alphabet,
            @JsonProperty("subsMatrix") SubstitutionMatrix subsMatrix,
            @JsonProperty("gapPenalty") int gapPenalty) {
        super(alphabet, subsMatrix);
{'fraction_non_alphanumeric': 0.08539148712559118, 'fraction_numerical': 0.004729374671571204, 'mean_word_length': 4.015810276679842, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 5}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1697074', 'n_tokens_mistral': 1048, 'n_tokens_neox': 989, 'n_words': 311}