<commit_before>package com.github.sparkcaller.variantdiscovery;

import com.github.sparkcaller.BaseGATKProgram;
import com.github.sparkcaller.Utils;
import scala.Tuple2;

import java.io.File;

/*
 * Applies the recalibration targets generated by VQSRTarget generator.
 *
 * See:
 * https://software.broadinstitute.org/gatk/gatkdocs/org_broadinstitute_gatk_tools_walkers_variantrecalibration_ApplyRecalibration.php
 *
 * For more documentation.
 */

public class VQSRRecalibrationApplier extends BaseGATKProgram {
    public VQSRRecalibrationApplier(String pathToReference, String extraArgs, String coresPerNode) {
        super("ApplyRecalibration", extraArgs);
        setReference(pathToReference);
        addArgument("-nt", coresPerNode);
    }

    public static String constructRecalFilename(String vcfToRecalibrate, String mode) {
        return Utils.removeExtenstion(vcfToRecalibrate, "vcf") + "-recalib-" + mode + ".vcf";
    }

    public File applyRecalibration(File vcfToRecalibrate, Tuple2<File, File> recalibrationFiles, String mode) {
        File recalibrationFile = recalibrationFiles._1;
        File tranchesFile = recalibrationFiles._2;

        changeArgument("-mode", mode);
        changeArgument("-input", vcfToRecalibrate.getPath());

        changeArgument("-tranchesFile", tranchesFile.getPath());
        changeArgument("-recalFile", recalibrationFile.getPath());

        File recalibratedOutput = new File(constructRecalFilename(vcfToRecalibrate.getPath(), mode));
        setOutputFile(recalibratedOutput.getPath());
        return recalibratedOutput;
    }
}<commit_msg>[Genomics]: Make sure that the TargetApplier program is actually being run.<commit_after>package com.github.sparkcaller.variantdiscovery;

import com.github.sparkcaller.BaseGATKProgram;
import com.github.sparkcaller.Utils;
import scala.Tuple2;

import java.io.File;

/*
 * Applies the recalibration targets generated by VQSRTarget generator.
 *
 * See:
 * https://software.broadinstitute.org/gatk/gatkdocs/org_broadinstitute_gatk_tools_walkers_variantrecalibration_ApplyRecalibration.php
 *
 * For more documentation.
 */

public class VQSRRecalibrationApplier extends BaseGATKProgram {
    public VQSRRecalibrationApplier(String pathToReference, String extraArgs, String coresPerNode) {
        super("ApplyRecalibration", extraArgs);
        setReference(pathToReference);
        addArgument("-nt", coresPerNode);
    }

    public static String constructRecalFilename(String vcfToRecalibrate, String mode) {
        return Utils.removeExtenstion(vcfToRecalibrate, "vcf") + "-recalib-" + mode + ".vcf";
    }

    public File applyRecalibration(File vcfToRecalibrate, Tuple2<File, File> recalibrationFiles, String mode) throws Exception {
        File recalibrationFile = recalibrationFiles._1;
        File tranchesFile = recalibrationFiles._2;

        changeArgument("-mode", mode);
        changeArgument("-input", vcfToRecalibrate.getPath());

        changeArgument("-tranchesFile", tranchesFile.getPath());
        changeArgument("-recalFile", recalibrationFile.getPath());

        File recalibratedOutput = new File(constructRecalFilename(vcfToRecalibrate.getPath(), mode));
        setOutputFile(recalibratedOutput.getPath());

        executeProgram();
        return recalibratedOutput;
    }
}
{'fraction_non_alphanumeric': 0.09692028985507246, 'fraction_numerical': 0.0024154589371980675, 'mean_word_length': 4.503322259136213, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '146102', 'n_tokens_mistral': 1003, 'n_tokens_neox': 956, 'n_words': 181}