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:
parent
6323fb8673
commit
4bbce42861
|
|
@ -123,7 +123,7 @@ public class ApplyRecalibration extends RodWalker<Integer, Integer> {
|
||||||
// setup the header fields
|
// setup the header fields
|
||||||
final Set<VCFHeaderLine> hInfo = new HashSet<VCFHeaderLine>();
|
final Set<VCFHeaderLine> hInfo = new HashSet<VCFHeaderLine>();
|
||||||
hInfo.addAll(VCFUtils.getHeaderFields(getToolkit(), inputNames));
|
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>();
|
final TreeSet<String> samples = new TreeSet<String>();
|
||||||
samples.addAll(SampleUtils.getUniqueSamplesFromRods(getToolkit(), inputNames));
|
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) ) {
|
for( VariantContext vc : tracker.getVariantContexts(ref, inputNames, null, context.getLocation(), true, false) ) {
|
||||||
if( vc != null ) {
|
if( vc != null ) {
|
||||||
if( ContrastiveRecalibrator.checkRecalibrationMode( vc, MODE ) ) {
|
if( VariantRecalibrator.checkRecalibrationMode( vc, MODE ) ) {
|
||||||
String filterString = null;
|
String filterString = null;
|
||||||
final Map<String, Object> attrs = new HashMap<String, Object>(vc.getAttributes());
|
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() );
|
final Double lod = (Double) lodMap.get( ref.getLocus().getContig(), ref.getLocus().getStart(), ref.getLocus().getStop() );
|
||||||
if( vc.isNotFiltered() || ignoreInputFilterSet.containsAll(vc.getFilters()) ) {
|
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-- ) {
|
for( int i = tranches.size() - 1; i >= 0; i-- ) {
|
||||||
final Tranche tranche = tranches.get(i);
|
final Tranche tranche = tranches.get(i);
|
||||||
if( lod >= tranche.minVQSLod ) {
|
if( lod >= tranche.minVQSLod ) {
|
||||||
|
|
|
||||||
|
|
@ -48,15 +48,15 @@ import java.io.PrintStream;
|
||||||
import java.util.*;
|
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
|
* User: rpoplin
|
||||||
* Date: 3/12/11
|
* 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";
|
public static final String VQS_LOD_KEY = "VQSLOD";
|
||||||
|
|
||||||
|
|
@ -244,7 +244,7 @@ class MethodsDevelopmentCallingPipeline extends QScript {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3.) Variant Quality Score Recalibration - Generate Recalibration table
|
// 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.memoryLimit = 4
|
||||||
this.reference_sequence = t.reference
|
this.reference_sequence = t.reference
|
||||||
this.intervalsString ++= List(t.intervals)
|
this.intervalsString ++= List(t.intervals)
|
||||||
|
|
|
||||||
|
|
@ -187,7 +187,7 @@ class pbCalling extends QScript {
|
||||||
this.analysisName = t.name + "_VF"
|
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.memoryLimit = 6
|
||||||
this.intervalsString ++= List(t.intervals)
|
this.intervalsString ++= List(t.intervals)
|
||||||
this.rodBind :+= RodBind("input", "VCF", if ( goldStandard ) { t.goldStandard_VCF } else { t.filteredVCF } )
|
this.rodBind :+= RodBind("input", "VCF", if ( goldStandard ) { t.goldStandard_VCF } else { t.filteredVCF } )
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,7 @@ class Exome_VQSR_FullSearch extends QScript {
|
||||||
val directory = getPath(annotations,recalTogether)
|
val directory = getPath(annotations,recalTogether)
|
||||||
for ( call_thresh <- VQSR_CALL_THRESH ) {
|
for ( call_thresh <- VQSR_CALL_THRESH ) {
|
||||||
for ( vqsr_rb <- VQSR_RODBINDS.iterator ) {
|
for ( vqsr_rb <- VQSR_RODBINDS.iterator ) {
|
||||||
trait VQSR_Args extends ContrastiveRecalibrator {
|
trait VQSR_Args extends VariantRecalibrator {
|
||||||
this.allPoly = true
|
this.allPoly = true
|
||||||
this.analysisName = "VQSR_%s_%s_%.1f".format( annotations.reduceLeft( _ + "." + _), if ( recalTogether ) "true" else "false", call_thresh)
|
this.analysisName = "VQSR_%s_%s_%.1f".format( annotations.reduceLeft( _ + "." + _), if ( recalTogether ) "true" else "false", call_thresh)
|
||||||
this.commandDirectory = directory
|
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."
|
val nameFormat = SCRIPT_BASE_NAME+".%1f.%s.".format(call_thresh,vqsr_rb._1)+"%s."
|
||||||
if ( recalTogether ) {
|
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.tranchesFile = new File(nameFormat.format("both")+"tranche")
|
||||||
vqsr.recalFile = new File(nameFormat.format("both")+"recal")
|
vqsr.recalFile = new File(nameFormat.format("both")+"recal")
|
||||||
add(vqsr)
|
add(vqsr)
|
||||||
addAll(eval(vqsr, ei.outList, "flanks"))
|
addAll(eval(vqsr, ei.outList, "flanks"))
|
||||||
addAll(eval(vqsr, INTS, "exons"))
|
addAll(eval(vqsr, INTS, "exons"))
|
||||||
} else {
|
} 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.tranchesFile = new File(nameFormat.format("exons")+"tranche")
|
||||||
exons.recalFile = new File(nameFormat.format("exons")+"recal")
|
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.intervals :+= ei.outList.getAbsoluteFile
|
||||||
flanks.jarFile = GATK_JAR
|
flanks.jarFile = GATK_JAR
|
||||||
flanks.memoryLimit = Some(8)
|
flanks.memoryLimit = Some(8)
|
||||||
|
|
@ -194,8 +194,8 @@ class Exome_VQSR_FullSearch extends QScript {
|
||||||
}
|
}
|
||||||
|
|
||||||
// want to apply and eval
|
// want to apply and eval
|
||||||
def eval(recal: ContrastiveRecalibrator) : List[QFunction] = { eval(recal,null,"") }
|
def eval(recal: VariantRecalibrator) : List[QFunction] = { eval(recal,null,"") }
|
||||||
def eval(recal: ContrastiveRecalibrator, list: File, ext: String) : List[QFunction] = {
|
def eval(recal: VariantRecalibrator, list: File, ext: String) : List[QFunction] = {
|
||||||
var functions : List[QFunction] = Nil
|
var functions : List[QFunction] = Nil
|
||||||
trait ImplicitArgs extends CommandLineGATK {
|
trait ImplicitArgs extends CommandLineGATK {
|
||||||
this.jarFile = recal.jarFile
|
this.jarFile = recal.jarFile
|
||||||
|
|
@ -245,4 +245,4 @@ class Exome_VQSR_FullSearch extends QScript {
|
||||||
|
|
||||||
functions
|
functions
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -170,7 +170,7 @@ class WGSpipeline extends QScript {
|
||||||
recombine.jobName = qscript.project + ".recombine"
|
recombine.jobName = qscript.project + ".recombine"
|
||||||
recombine.jobOutputFile = swapExt(combineVCFs.jobOutputFile, "combine.out", "recombine.out")
|
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("hapmap","VCF", qscript.hapmap, "training=true, prior=3.0")
|
||||||
cr.rodBind :+= RodBind("1kg", "VCF", qscript.omni, "training=true, prior=3.0")
|
cr.rodBind :+= RodBind("1kg", "VCF", qscript.omni, "training=true, prior=3.0")
|
||||||
cr.rodBind :+= RodBind("input", "VCF", recombine.out)
|
cr.rodBind :+= RodBind("input", "VCF", recombine.out)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue