Renaming ContrastiveRecalibrator --> VariantRecalibrator in preparation for move to core

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5733 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
rpoplin 2011-05-03 18:12:47 +00:00
parent 6323fb8673
commit 4bbce42861
6 changed files with 16 additions and 16 deletions

View File

@ -123,7 +123,7 @@ public class ApplyRecalibration extends RodWalker<Integer, Integer> {
// setup the header fields
final Set<VCFHeaderLine> hInfo = new HashSet<VCFHeaderLine>();
hInfo.addAll(VCFUtils.getHeaderFields(getToolkit(), inputNames));
hInfo.add(new VCFInfoHeaderLine(ContrastiveRecalibrator.VQS_LOD_KEY, 1, VCFHeaderLineType.Float, "log10-scaled probability of variant being true under the trained gaussian mixture model"));
hInfo.add(new VCFInfoHeaderLine(VariantRecalibrator.VQS_LOD_KEY, 1, VCFHeaderLineType.Float, "log10-scaled probability of variant being true under the trained gaussian mixture model"));
final TreeSet<String> samples = new TreeSet<String>();
samples.addAll(SampleUtils.getUniqueSamplesFromRods(getToolkit(), inputNames));
@ -170,12 +170,12 @@ public class ApplyRecalibration extends RodWalker<Integer, Integer> {
for( VariantContext vc : tracker.getVariantContexts(ref, inputNames, null, context.getLocation(), true, false) ) {
if( vc != null ) {
if( ContrastiveRecalibrator.checkRecalibrationMode( vc, MODE ) ) {
if( VariantRecalibrator.checkRecalibrationMode( vc, MODE ) ) {
String filterString = null;
final Map<String, Object> attrs = new HashMap<String, Object>(vc.getAttributes());
final Double lod = (Double) lodMap.get( ref.getLocus().getContig(), ref.getLocus().getStart(), ref.getLocus().getStop() );
if( vc.isNotFiltered() || ignoreInputFilterSet.containsAll(vc.getFilters()) ) {
attrs.put(ContrastiveRecalibrator.VQS_LOD_KEY, String.format("%.4f", lod));
attrs.put(VariantRecalibrator.VQS_LOD_KEY, String.format("%.4f", lod));
for( int i = tranches.size() - 1; i >= 0; i-- ) {
final Tranche tranche = tranches.get(i);
if( lod >= tranche.minVQSLod ) {

View File

@ -48,15 +48,15 @@ import java.io.PrintStream;
import java.util.*;
/**
* Applies calibrated variant cluster parameters to variant calls to produce an accurate and informative variant quality score.
* Takes variant calls as .vcf files, learns a Gaussian mixture model over the variant annotations and evaluates the variant -- assigning an informative lod score
*
* User: rpoplin
* Date: 3/12/11
*
* @help.summary Takes variant calls as .vcf files, learns a Gaussian mixture model over the variant annotations and evaluates the variants
* @help.summary Takes variant calls as .vcf files, learns a Gaussian mixture model over the variant annotations and evaluates the variant -- assigning an informative lod score
*/
public class ContrastiveRecalibrator extends RodWalker<ExpandingArrayList<VariantDatum>, ExpandingArrayList<VariantDatum>> implements TreeReducible<ExpandingArrayList<VariantDatum>> {
public class VariantRecalibrator extends RodWalker<ExpandingArrayList<VariantDatum>, ExpandingArrayList<VariantDatum>> implements TreeReducible<ExpandingArrayList<VariantDatum>> {
public static final String VQS_LOD_KEY = "VQSLOD";

View File

@ -244,7 +244,7 @@ class MethodsDevelopmentCallingPipeline extends QScript {
}
// 3.) Variant Quality Score Recalibration - Generate Recalibration table
class VQSR(t: Target, goldStandard: Boolean) extends ContrastiveRecalibrator with UNIVERSAL_GATK_ARGS {
class VQSR(t: Target, goldStandard: Boolean) extends VariantRecalibrator with UNIVERSAL_GATK_ARGS {
this.memoryLimit = 4
this.reference_sequence = t.reference
this.intervalsString ++= List(t.intervals)

View File

@ -187,7 +187,7 @@ class pbCalling extends QScript {
this.analysisName = t.name + "_VF"
}
class VQSR(t: Target, goldStandard: Boolean) extends ContrastiveRecalibrator {
class VQSR(t: Target, goldStandard: Boolean) extends VariantRecalibrator {
this.memoryLimit = 6
this.intervalsString ++= List(t.intervals)
this.rodBind :+= RodBind("input", "VCF", if ( goldStandard ) { t.goldStandard_VCF } else { t.filteredVCF } )

View File

@ -154,7 +154,7 @@ class Exome_VQSR_FullSearch extends QScript {
val directory = getPath(annotations,recalTogether)
for ( call_thresh <- VQSR_CALL_THRESH ) {
for ( vqsr_rb <- VQSR_RODBINDS.iterator ) {
trait VQSR_Args extends ContrastiveRecalibrator {
trait VQSR_Args extends VariantRecalibrator {
this.allPoly = true
this.analysisName = "VQSR_%s_%s_%.1f".format( annotations.reduceLeft( _ + "." + _), if ( recalTogether ) "true" else "false", call_thresh)
this.commandDirectory = directory
@ -166,17 +166,17 @@ class Exome_VQSR_FullSearch extends QScript {
}
val nameFormat = SCRIPT_BASE_NAME+".%1f.%s.".format(call_thresh,vqsr_rb._1)+"%s."
if ( recalTogether ) {
var vqsr = new ContrastiveRecalibrator with VQSR_Args with ExpandedIntervals with CommandLineGATKArgs
var vqsr = new VariantRecalibrator with VQSR_Args with ExpandedIntervals with CommandLineGATKArgs
vqsr.tranchesFile = new File(nameFormat.format("both")+"tranche")
vqsr.recalFile = new File(nameFormat.format("both")+"recal")
add(vqsr)
addAll(eval(vqsr, ei.outList, "flanks"))
addAll(eval(vqsr, INTS, "exons"))
} else {
var exons = new ContrastiveRecalibrator with VQSR_Args with CommandLineGATKArgs
var exons = new VariantRecalibrator with VQSR_Args with CommandLineGATKArgs
exons.tranchesFile = new File(nameFormat.format("exons")+"tranche")
exons.recalFile = new File(nameFormat.format("exons")+"recal")
var flanks = new ContrastiveRecalibrator with VQSR_Args
var flanks = new VariantRecalibrator with VQSR_Args
flanks.intervals :+= ei.outList.getAbsoluteFile
flanks.jarFile = GATK_JAR
flanks.memoryLimit = Some(8)
@ -194,8 +194,8 @@ class Exome_VQSR_FullSearch extends QScript {
}
// want to apply and eval
def eval(recal: ContrastiveRecalibrator) : List[QFunction] = { eval(recal,null,"") }
def eval(recal: ContrastiveRecalibrator, list: File, ext: String) : List[QFunction] = {
def eval(recal: VariantRecalibrator) : List[QFunction] = { eval(recal,null,"") }
def eval(recal: VariantRecalibrator, list: File, ext: String) : List[QFunction] = {
var functions : List[QFunction] = Nil
trait ImplicitArgs extends CommandLineGATK {
this.jarFile = recal.jarFile
@ -245,4 +245,4 @@ class Exome_VQSR_FullSearch extends QScript {
functions
}
}
}

View File

@ -170,7 +170,7 @@ class WGSpipeline extends QScript {
recombine.jobName = qscript.project + ".recombine"
recombine.jobOutputFile = swapExt(combineVCFs.jobOutputFile, "combine.out", "recombine.out")
val cr = new ContrastiveRecalibrator with CommandLineGATKArgs
val cr = new VariantRecalibrator with CommandLineGATKArgs
cr.rodBind :+= RodBind("hapmap","VCF", qscript.hapmap, "training=true, prior=3.0")
cr.rodBind :+= RodBind("1kg", "VCF", qscript.omni, "training=true, prior=3.0")
cr.rodBind :+= RodBind("input", "VCF", recombine.out)