package com.github.sparkcaller.variantdiscovery;

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

import java.io.File;

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;
    }
}

@@ -171,16 +171,272 @@
 .File;%0A%0A
+/*%0A * Applies the recalibration targets generated by VQSRTarget generator.%0A *%0A * See:%0A * https://software.broadinstitute.org/gatk/gatkdocs/org_broadinstitute_gatk_tools_walkers_variantrecalibration_ApplyRecalibration.php%0A *%0A * For more documentation.%0A */%0A%0A
 public c

Add a breif explaination of what the class does.