<commit_before>package de.charite.compbio.exomiser.core.filter;

import de.charite.compbio.exomiser.core.model.VariantEvaluation;
import jannovar.common.VariantType;
import java.util.EnumSet;
import java.util.Objects;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * VariantFilter variants according to whether they are on target (i.e., located
 * within an exon or splice junction) or not. This runFilter also has the side
 * effect of calculating the counts of the various variant classes. The class
 * uses the annotations made by classes from the {@code jannovar.annotation}
 * package etc.
 * <P>
 * Note that this class does not require a corresponding
 * {@link exomizer.filter.Triage Triage} object, because variants that do not
 * pass the runFilter are simply removed.
 *
 * @author <NAME>
 * @version 0.16 (20 December, 2013)
 */
public class TargetFilter implements VariantFilter {

    private static final Logger logger = LoggerFactory.getLogger(TargetFilter.class);

    private static final FilterType filterType = FilterType.TARGET_FILTER;

    //add a token pass/failed score - this is essentially a boolean pass/fail, where 1 = pass and 0 = fail
    private final FilterResult passedFilterResult = new TargetFilterResult(1f, FilterResultStatus.PASS);
    private final FilterResult failedFilterResult = new TargetFilterResult(0f, FilterResultStatus.FAIL);

    /**
     * A set of off-target variant types such as Intergenic that we will
     * runFilter out from further consideration.
     */
    private final EnumSet<VariantType> offTargetVariantTypes;

    /**
     * The constructor initializes the set of off-target
     * {@link jannovar.common.VariantType VariantType} constants, e.g.,
     * INTERGENIC, that we will runFilter out using this class.
     */
    public TargetFilter() {
        offTargetVariantTypes = EnumSet.of(VariantType.DOWNSTREAM,
                VariantType.INTERGENIC, VariantType.INTRONIC,
                VariantType.ncRNA_INTRONIC, VariantType.SYNONYMOUS,
                VariantType.UPSTREAM, VariantType.ERROR);
    }<commit_msg>Changed EnumSet to use Set interface in declaration of offTargetVariantTypes variable in TargetFilter.<commit_after>package de.charite.compbio.exomiser.core.filter;

import de.charite.compbio.exomiser.core.model.VariantEvaluation;
import jannovar.common.VariantType;
import java.util.EnumSet;
import java.util.Objects;
import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * VariantFilter variants according to whether they are on target (i.e., located
 * within an exon or splice junction) or not. This runFilter also has the side
 * effect of calculating the counts of the various variant classes. The class
 * uses the annotations made by classes from the {@code jannovar.annotation}
 * package etc.
 * <P>
 * Note that this class does not require a corresponding
 * {@link exomizer.filter.Triage Triage} object, because variants that do not
 * pass the runFilter are simply removed.
 *
 * @author <NAME>
 * @version 0.16 (20 December, 2013)
 */
public class TargetFilter implements VariantFilter {

    private static final Logger logger = LoggerFactory.getLogger(TargetFilter.class);

    private static final FilterType filterType = FilterType.TARGET_FILTER;

    //add a token pass/failed score - this is essentially a boolean pass/fail, where 1 = pass and 0 = fail
    private final FilterResult passedFilterResult = new TargetFilterResult(1f, FilterResultStatus.PASS);
    private final FilterResult failedFilterResult = new TargetFilterResult(0f, FilterResultStatus.FAIL);

    /**
     * A set of off-target variant types such as Intergenic that we will
     * runFilter out from further consideration.
     */
    private final Set<VariantType> offTargetVariantTypes;

    /**
     * The constructor initializes the set of off-target
     * {@link jannovar.common.VariantType VariantType} constants, e.g.,
     * INTERGENIC, that we will runFilter out using this class.
     */
    public TargetFilter() {
        offTargetVariantTypes = EnumSet.of(VariantType.DOWNSTREAM,
                VariantType.INTERGENIC, VariantType.INTRONIC,
                VariantType.ncRNA_INTRONIC, VariantType.SYNONYMOUS,
                VariantType.UPSTREAM, VariantType.ERROR);
    }
{'fraction_non_alphanumeric': 0.07562050568313616, 'fraction_numerical': 0.006958942240779402, 'mean_word_length': 3.7804878048780486, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '3144801', 'n_tokens_mistral': 1217, 'n_tokens_neox': 1147, 'n_words': 404}