Skip to content
Snippets Groups Projects
Commit 622b7500 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Convert more to biopet values

parent e57304d0
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,7 @@ class AnalyzeCovariates(val root: Configurable) extends CommandLineGATK with Sca
/** do not emit warning messages related to suspicious last modification time order of inputs */
@Argument(fullName = "ignoreLastModificationTimes", shortName = "ignoreLMT", doc = "do not emit warning messages related to suspicious last modification time order of inputs", required = false, exclusiveOf = "", validation = "")
var ignoreLastModificationTimes: Boolean = _
var ignoreLastModificationTimes: Boolean = config("ignoreLastModificationTimes", default = false)
/** location of the output report */
@Output(fullName = "plotsReportFile", shortName = "plots", doc = "location of the output report", required = false, exclusiveOf = "", validation = "")
......@@ -41,15 +41,15 @@ class AnalyzeCovariates(val root: Configurable) extends CommandLineGATK with Sca
/** Filter out reads with CIGAR containing the N operator, instead of failing with an error */
@Argument(fullName = "filter_reads_with_N_cigar", shortName = "filterRNC", doc = "Filter out reads with CIGAR containing the N operator, instead of failing with an error", required = false, exclusiveOf = "", validation = "")
var filter_reads_with_N_cigar: Boolean = _
var filter_reads_with_N_cigar: Boolean = config("filter_reads_with_N_cigar", default = false)
/** Filter out reads with mismatching numbers of bases and base qualities, instead of failing with an error */
@Argument(fullName = "filter_mismatching_base_and_quals", shortName = "filterMBQ", doc = "Filter out reads with mismatching numbers of bases and base qualities, instead of failing with an error", required = false, exclusiveOf = "", validation = "")
var filter_mismatching_base_and_quals: Boolean = _
var filter_mismatching_base_and_quals: Boolean = config("filter_mismatching_base_and_quals", default = false)
/** Filter out reads with no stored bases (i.e. '*' where the sequence should be), instead of failing with an error */
@Argument(fullName = "filter_bases_not_stored", shortName = "filterNoBases", doc = "Filter out reads with no stored bases (i.e. '*' where the sequence should be), instead of failing with an error", required = false, exclusiveOf = "", validation = "")
var filter_bases_not_stored: Boolean = _
var filter_bases_not_stored: Boolean = config("filter_bases_not_stored", default = false)
override def cmdLine = super.cmdLine +
optional("-before", beforeReportFile, spaceSeparated = true, escape = true, format = "%s") +
......
......@@ -5,47 +5,6 @@
*/
package nl.lumc.sasc.biopet.extensions.gatk.broad
//import java.io.File
//
//import nl.lumc.sasc.biopet.utils.config.Configurable
//import org.broadinstitute.gatk.queue.extensions.gatk.{CatVariantsGatherer, GATKScatterFunction, LocusScatterFunction, TaggedFile}
//import org.broadinstitute.gatk.queue.function.scattergather.ScatterGatherableFunction
//import org.broadinstitute.gatk.utils.commandline.{Argument, Gather, Input, Output}
//
//class ApplyRecalibration(val root: Configurable) extends org.broadinstitute.gatk.queue.extensions.gatk.ApplyRecalibration with GatkGeneral {
// scatterCount = config("scattercount", default = 0)
//
// override val defaultThreads = 3
//
// override def freezeFieldValues() {
// super.freezeFieldValues()
//
// nt = Option(getThreads)
// memoryLimit = Option(nt.getOrElse(1) * 2)
//
// import org.broadinstitute.gatk.tools.walkers.variantrecalibration.VariantRecalibratorArgumentCollection.Mode
// if (mode == Mode.INDEL) ts_filter_level = config("ts_filter_level", default = 99.0)
// else if (mode == Mode.SNP) ts_filter_level = config("ts_filter_level", default = 99.5)
// ts_filter_level = config("ts_filter_level")
// }
//}
//
//object ApplyRecalibration {
// def apply(root: Configurable, input: File, output: File, recal_file: File, tranches_file: File, indel: Boolean = false): ApplyRecalibration = {
// val ar = if (indel) new ApplyRecalibration(root) {
// mode = org.broadinstitute.gatk.tools.walkers.variantrecalibration.VariantRecalibratorArgumentCollection.Mode.INDEL
// }
// else new ApplyRecalibration(root) {
// mode = org.broadinstitute.gatk.tools.walkers.variantrecalibration.VariantRecalibratorArgumentCollection.Mode.SNP
// }
// ar.input :+= input
// ar.recal_file = recal_file
// ar.tranches_file = tranches_file
// ar.out = output
// ar
// }
//}
import java.io.File
import nl.lumc.sasc.biopet.utils.config.Configurable
......@@ -65,18 +24,10 @@ class ApplyRecalibration(val root: Configurable) extends CommandLineGATK with Sc
@Input(fullName = "input", shortName = "input", doc = "The raw input variants to be recalibrated", required = true, exclusiveOf = "", validation = "")
var input: Seq[File] = Nil
/** Dependencies on any indexes of input */
@Input(fullName = "inputIndexes", shortName = "", doc = "Dependencies on any indexes of input", required = false, exclusiveOf = "", validation = "")
private var inputIndexes: Seq[File] = Nil
/** The input recal file used by ApplyRecalibration */
@Input(fullName = "recal_file", shortName = "recalFile", doc = "The input recal file used by ApplyRecalibration", required = true, exclusiveOf = "", validation = "")
var recal_file: File = _
/** Dependencies on the index of recal_file */
@Input(fullName = "recal_fileIndex", shortName = "", doc = "Dependencies on the index of recal_file", required = false, exclusiveOf = "", validation = "")
private var recal_fileIndex: Seq[File] = Nil
/** The input tranches file describing where to cut the data */
@Input(fullName = "tranches_file", shortName = "tranchesFile", doc = "The input tranches file describing where to cut the data", required = false, exclusiveOf = "", validation = "")
var tranches_file: File = _
......@@ -93,7 +44,7 @@ class ApplyRecalibration(val root: Configurable) extends CommandLineGATK with Sc
/** The truth sensitivity level at which to start filtering */
@Argument(fullName = "ts_filter_level", shortName = "ts_filter_level", doc = "The truth sensitivity level at which to start filtering", required = false, exclusiveOf = "", validation = "")
var ts_filter_level: Option[Double] = None
var ts_filter_level: Option[Double] = config("ts_filter_level")
/** Format string for ts_filter_level */
@Argument(fullName = "ts_filter_levelFormat", shortName = "", doc = "Format string for ts_filter_level", required = false, exclusiveOf = "", validation = "")
......@@ -101,7 +52,7 @@ class ApplyRecalibration(val root: Configurable) extends CommandLineGATK with Sc
/** The VQSLOD score below which to start filtering */
@Argument(fullName = "lodCutoff", shortName = "lodCutoff", doc = "The VQSLOD score below which to start filtering", required = false, exclusiveOf = "", validation = "")
var lodCutoff: Option[Double] = None
var lodCutoff: Option[Double] = config("lodCutoff")
/** Format string for lodCutoff */
@Argument(fullName = "lodCutoffFormat", shortName = "", doc = "Format string for lodCutoff", required = false, exclusiveOf = "", validation = "")
......@@ -109,15 +60,15 @@ class ApplyRecalibration(val root: Configurable) extends CommandLineGATK with Sc
/** If specified, the recalibration will be applied to variants marked as filtered by the specified filter name in the input VCF file */
@Argument(fullName = "ignore_filter", shortName = "ignoreFilter", doc = "If specified, the recalibration will be applied to variants marked as filtered by the specified filter name in the input VCF file", required = false, exclusiveOf = "", validation = "")
var ignore_filter: Seq[String] = Nil
var ignore_filter: List[String] = config("ignore_filter", default = Nil)
/** If specified, the variant recalibrator will ignore all input filters. Useful to rerun the VQSR from a filtered output file. */
@Argument(fullName = "ignore_all_filters", shortName = "ignoreAllFilters", doc = "If specified, the variant recalibrator will ignore all input filters. Useful to rerun the VQSR from a filtered output file.", required = false, exclusiveOf = "", validation = "")
var ignore_all_filters: Boolean = _
var ignore_all_filters: Boolean = config("ignore_all_filters", default = false)
/** Don't output filtered loci after applying the recalibration */
@Argument(fullName = "excludeFiltered", shortName = "ef", doc = "Don't output filtered loci after applying the recalibration", required = false, exclusiveOf = "", validation = "")
var excludeFiltered: Boolean = _
var excludeFiltered: Boolean = config("excludeFiltered", default = false)
/** Recalibration mode to employ: 1.) SNP for recalibrating only SNPs (emitting indels untouched in the output VCF); 2.) INDEL for indels; and 3.) BOTH for recalibrating both SNPs and indels simultaneously. */
@Argument(fullName = "mode", shortName = "mode", doc = "Recalibration mode to employ: 1.) SNP for recalibrating only SNPs (emitting indels untouched in the output VCF); 2.) INDEL for indels; and 3.) BOTH for recalibrating both SNPs and indels simultaneously.", required = false, exclusiveOf = "", validation = "")
......@@ -125,24 +76,25 @@ class ApplyRecalibration(val root: Configurable) extends CommandLineGATK with Sc
/** Filter out reads with CIGAR containing the N operator, instead of failing with an error */
@Argument(fullName = "filter_reads_with_N_cigar", shortName = "filterRNC", doc = "Filter out reads with CIGAR containing the N operator, instead of failing with an error", required = false, exclusiveOf = "", validation = "")
var filter_reads_with_N_cigar: Boolean = _
var filter_reads_with_N_cigar: Boolean = config("filter_reads_with_N_cigar", default = false)
/** Filter out reads with mismatching numbers of bases and base qualities, instead of failing with an error */
@Argument(fullName = "filter_mismatching_base_and_quals", shortName = "filterMBQ", doc = "Filter out reads with mismatching numbers of bases and base qualities, instead of failing with an error", required = false, exclusiveOf = "", validation = "")
var filter_mismatching_base_and_quals: Boolean = _
var filter_mismatching_base_and_quals: Boolean = config("filter_mismatching_base_and_quals", default = false)
/** Filter out reads with no stored bases (i.e. '*' where the sequence should be), instead of failing with an error */
@Argument(fullName = "filter_bases_not_stored", shortName = "filterNoBases", doc = "Filter out reads with no stored bases (i.e. '*' where the sequence should be), instead of failing with an error", required = false, exclusiveOf = "", validation = "")
var filter_bases_not_stored: Boolean = _
var filter_bases_not_stored: Boolean = config("filter_bases_not_stored", default = false)
override def freezeFieldValues() {
super.freezeFieldValues()
inputIndexes ++= input.filter(orig => orig != null && (!orig.getName.endsWith(".list"))).map(orig => new File(orig.getPath + ".idx"))
deps ++= input.filter(orig => orig != null && (!orig.getName.endsWith(".list"))).map(orig => new File(orig.getPath + ".idx"))
if (recal_file != null)
recal_fileIndex :+= new File(recal_file.getPath + ".idx")
deps :+= new File(recal_file.getPath + ".idx")
if (out != null && !org.broadinstitute.gatk.utils.io.IOUtils.isSpecialFile(out))
if (!org.broadinstitute.gatk.utils.commandline.ArgumentTypeDescriptor.isCompressed(out.getPath))
outIndex = new File(out.getPath + ".idx")
num_threads = Option(getThreads)
}
override def cmdLine = super.cmdLine +
......
......@@ -8,9 +8,10 @@ package nl.lumc.sasc.biopet.extensions.gatk.broad
import java.io.File
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.queue.extensions.gatk.{ CatVariantsGatherer, GATKScatterFunction, LocusScatterFunction, TaggedFile }
import org.broadinstitute.gatk.queue.extensions.gatk.{CatVariantsGatherer, GATKScatterFunction, LocusScatterFunction, TaggedFile}
import nl.lumc.sasc.biopet.core.ScatterGatherableFunction
import org.broadinstitute.gatk.utils.commandline.{ Gather, Input, Output, _ }
import nl.lumc.sasc.biopet.utils.VcfUtils
import org.broadinstitute.gatk.utils.commandline.{Gather, Input, Output, _}
class CombineGVCFs(val root: Configurable) extends CommandLineGATK with ScatterGatherableFunction {
def analysis_type = "CombineGVCFs"
......@@ -19,66 +20,52 @@ class CombineGVCFs(val root: Configurable) extends CommandLineGATK with ScatterG
/** One or more specific annotations to recompute. The single value 'none' removes the default annotations */
@Argument(fullName = "annotation", shortName = "A", doc = "One or more specific annotations to recompute. The single value 'none' removes the default annotations", required = false, exclusiveOf = "", validation = "")
var annotation: Seq[String] = Nil
var annotation: List[String] = config("annotation", default = Nil, freeVar = false)
/** One or more classes/groups of annotations to apply to variant calls */
@Argument(fullName = "group", shortName = "G", doc = "One or more classes/groups of annotations to apply to variant calls", required = false, exclusiveOf = "", validation = "")
var group: Seq[String] = Nil
var group: List[String] = config("group", default = Nil)
/** dbSNP file */
@Input(fullName = "dbsnp", shortName = "D", doc = "dbSNP file", required = false, exclusiveOf = "", validation = "")
var dbsnp: File = _
/** Dependencies on the index of dbsnp */
@Input(fullName = "dbsnpIndex", shortName = "", doc = "Dependencies on the index of dbsnp", required = false, exclusiveOf = "", validation = "")
private var dbsnpIndex: Seq[File] = Nil
var dbsnp: Option[File] = config("dbsnp")
/** One or more input gVCF files */
@Input(fullName = "variant", shortName = "V", doc = "One or more input gVCF files", required = true, exclusiveOf = "", validation = "")
var variant: Seq[File] = Nil
/** Dependencies on any indexes of variant */
@Input(fullName = "variantIndexes", shortName = "", doc = "Dependencies on any indexes of variant", required = false, exclusiveOf = "", validation = "")
private var variantIndexes: Seq[File] = Nil
/** File to which the combined gVCF should be written */
@Output(fullName = "out", shortName = "o", doc = "File to which the combined gVCF should be written", required = false, exclusiveOf = "", validation = "")
@Gather(classOf[CatVariantsGatherer])
var out: File = _
/** Automatically generated index for out */
@Output(fullName = "outIndex", shortName = "", doc = "Automatically generated index for out", required = false, exclusiveOf = "", validation = "")
@Gather(enabled = false)
private var outIndex: File = _
/** If specified, convert banded gVCFs to all-sites gVCFs */
@Argument(fullName = "convertToBasePairResolution", shortName = "bpResolution", doc = "If specified, convert banded gVCFs to all-sites gVCFs", required = false, exclusiveOf = "", validation = "")
var convertToBasePairResolution: Boolean = _
var convertToBasePairResolution: Boolean = config("convertToBasePairResolution", default = false)
/** If > 0, reference bands will be broken up at genomic positions that are multiples of this number */
@Argument(fullName = "breakBandsAtMultiplesOf", shortName = "breakBandsAtMultiplesOf", doc = "If > 0, reference bands will be broken up at genomic positions that are multiples of this number", required = false, exclusiveOf = "", validation = "")
var breakBandsAtMultiplesOf: Option[Int] = None
var breakBandsAtMultiplesOf: Option[Int] = config("breakBandsAtMultiplesOf")
/** Filter out reads with CIGAR containing the N operator, instead of failing with an error */
@Argument(fullName = "filter_reads_with_N_cigar", shortName = "filterRNC", doc = "Filter out reads with CIGAR containing the N operator, instead of failing with an error", required = false, exclusiveOf = "", validation = "")
var filter_reads_with_N_cigar: Boolean = _
var filter_reads_with_N_cigar: Boolean = config("filter_reads_with_N_cigar", default = false)
/** Filter out reads with mismatching numbers of bases and base qualities, instead of failing with an error */
@Argument(fullName = "filter_mismatching_base_and_quals", shortName = "filterMBQ", doc = "Filter out reads with mismatching numbers of bases and base qualities, instead of failing with an error", required = false, exclusiveOf = "", validation = "")
var filter_mismatching_base_and_quals: Boolean = _
var filter_mismatching_base_and_quals: Boolean = config("filter_mismatching_base_and_quals", default = false)
/** Filter out reads with no stored bases (i.e. '*' where the sequence should be), instead of failing with an error */
@Argument(fullName = "filter_bases_not_stored", shortName = "filterNoBases", doc = "Filter out reads with no stored bases (i.e. '*' where the sequence should be), instead of failing with an error", required = false, exclusiveOf = "", validation = "")
var filter_bases_not_stored: Boolean = _
var filter_bases_not_stored: Boolean = config("filter_bases_not_stored", default = false)
override def freezeFieldValues() {
super.freezeFieldValues()
if (dbsnp != null)
dbsnpIndex :+= new File(dbsnp.getPath + ".idx")
variantIndexes ++= variant.filter(orig => orig != null && (!orig.getName.endsWith(".list"))).map(orig => new File(orig.getPath + ".idx"))
dbsnp.foreach(x => deps :+= VcfUtils.getVcfIndexFile(x))
deps ++= variant.filter(orig => orig != null && (!orig.getName.endsWith(".list"))).map(orig => VcfUtils.getVcfIndexFile(orig))
if (out != null && !org.broadinstitute.gatk.utils.io.IOUtils.isSpecialFile(out))
if (!org.broadinstitute.gatk.utils.commandline.ArgumentTypeDescriptor.isCompressed(out.getPath))
outIndex = new File(out.getPath + ".idx")
outputFiles :+= VcfUtils.getVcfIndexFile(out)
}
override def cmdLine = super.cmdLine +
......
......@@ -8,9 +8,10 @@ package nl.lumc.sasc.biopet.extensions.gatk.broad
import java.io.File
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.queue.extensions.gatk.{ CatVariantsGatherer, GATKScatterFunction, LocusScatterFunction, TaggedFile }
import org.broadinstitute.gatk.queue.extensions.gatk.{CatVariantsGatherer, GATKScatterFunction, LocusScatterFunction, TaggedFile}
import nl.lumc.sasc.biopet.core.ScatterGatherableFunction
import org.broadinstitute.gatk.utils.commandline.{ Argument, Gather, Output, _ }
import nl.lumc.sasc.biopet.utils.VcfUtils
import org.broadinstitute.gatk.utils.commandline.{Argument, Gather, Output, _}
class CombineVariants(val root: Configurable) extends CommandLineGATK with ScatterGatherableFunction {
def analysis_type = "CombineVariants"
......@@ -21,90 +22,81 @@ class CombineVariants(val root: Configurable) extends CommandLineGATK with Scatt
@Input(fullName = "variant", shortName = "V", doc = "VCF files to merge together", required = true, exclusiveOf = "", validation = "")
var variant: Seq[File] = Nil
/** Dependencies on any indexes of variant */
@Input(fullName = "variantIndexes", shortName = "", doc = "Dependencies on any indexes of variant", required = false, exclusiveOf = "", validation = "")
private var variantIndexes: Seq[File] = Nil
/** File to which variants should be written */
@Output(fullName = "out", shortName = "o", doc = "File to which variants should be written", required = false, exclusiveOf = "", validation = "")
@Gather(classOf[CatVariantsGatherer])
var out: File = _
/** Automatically generated index for out */
@Output(fullName = "outIndex", shortName = "", doc = "Automatically generated index for out", required = false, exclusiveOf = "", validation = "")
@Gather(enabled = false)
private var outIndex: File = _
/** Determines how we should merge genotype records for samples shared across the ROD files */
@Argument(fullName = "genotypemergeoption", shortName = "genotypeMergeOptions", doc = "Determines how we should merge genotype records for samples shared across the ROD files", required = false, exclusiveOf = "", validation = "")
var genotypemergeoption: org.broadinstitute.gatk.utils.variant.GATKVariantContextUtils.GenotypeMergeType = _
var genotypemergeoption: Option[String] = config("genotypemergeoption")
/** Determines how we should handle records seen at the same site in the VCF, but with different FILTER fields */
@Argument(fullName = "filteredrecordsmergetype", shortName = "filteredRecordsMergeType", doc = "Determines how we should handle records seen at the same site in the VCF, but with different FILTER fields", required = false, exclusiveOf = "", validation = "")
var filteredrecordsmergetype: org.broadinstitute.gatk.utils.variant.GATKVariantContextUtils.FilteredRecordMergeType = _
var filteredrecordsmergetype: Option[String] = config("filteredrecordsmergetype")
/** Determines how we should handle records seen at the same site in the VCF, but with different allele types (for example, SNP vs. indel) */
@Argument(fullName = "multipleallelesmergetype", shortName = "multipleAllelesMergeType", doc = "Determines how we should handle records seen at the same site in the VCF, but with different allele types (for example, SNP vs. indel)", required = false, exclusiveOf = "", validation = "")
var multipleallelesmergetype: org.broadinstitute.gatk.utils.variant.GATKVariantContextUtils.MultipleAllelesMergeType = _
var multipleallelesmergetype: Option[String] = config("multipleallelesmergetype")
/** Ordered list specifying priority for merging */
@Argument(fullName = "rod_priority_list", shortName = "priority", doc = "Ordered list specifying priority for merging", required = false, exclusiveOf = "", validation = "")
var rod_priority_list: String = _
var rod_priority_list: Option[String] = config("rod_priority_list")
/** Emit interesting sites requiring complex compatibility merging to file */
@Argument(fullName = "printComplexMerges", shortName = "printComplexMerges", doc = "Emit interesting sites requiring complex compatibility merging to file", required = false, exclusiveOf = "", validation = "")
var printComplexMerges: Boolean = _
var printComplexMerges: Boolean = config("printComplexMerges", default = false)
/** Treat filtered variants as uncalled */
@Argument(fullName = "filteredAreUncalled", shortName = "filteredAreUncalled", doc = "Treat filtered variants as uncalled", required = false, exclusiveOf = "", validation = "")
var filteredAreUncalled: Boolean = _
var filteredAreUncalled: Boolean = config("filteredAreUncalled", default = false)
/** Emit a sites-only file */
@Argument(fullName = "minimalVCF", shortName = "minimalVCF", doc = "Emit a sites-only file", required = false, exclusiveOf = "", validation = "")
var minimalVCF: Boolean = _
var minimalVCF: Boolean = config("minimalVCF", default = false)
/** Exclude sites where no variation is present after merging */
@Argument(fullName = "excludeNonVariants", shortName = "env", doc = "Exclude sites where no variation is present after merging", required = false, exclusiveOf = "", validation = "")
var excludeNonVariants: Boolean = _
var excludeNonVariants: Boolean = config("excludeNonVariants", default = false)
/** Key name for the set attribute */
@Argument(fullName = "setKey", shortName = "setKey", doc = "Key name for the set attribute", required = false, exclusiveOf = "", validation = "")
var setKey: String = _
var setKey: Option[String] = config("set_key")
/** Assume input VCFs have identical sample sets and disjoint calls */
@Argument(fullName = "assumeIdenticalSamples", shortName = "assumeIdenticalSamples", doc = "Assume input VCFs have identical sample sets and disjoint calls", required = false, exclusiveOf = "", validation = "")
var assumeIdenticalSamples: Boolean = _
var assumeIdenticalSamples: Boolean = config("assumeIdenticalSamples", default = false)
/** Minimum number of input files the site must be observed in to be included */
@Argument(fullName = "minimumN", shortName = "minN", doc = "Minimum number of input files the site must be observed in to be included", required = false, exclusiveOf = "", validation = "")
var minimumN: Option[Int] = None
var minimumN: Option[Int] = config("minimumN")
/** Do not output the command line to the header */
@Argument(fullName = "suppressCommandLineHeader", shortName = "suppressCommandLineHeader", doc = "Do not output the command line to the header", required = false, exclusiveOf = "", validation = "")
var suppressCommandLineHeader: Boolean = _
var suppressCommandLineHeader: Boolean = config("suppressCommandLineHeader", default = false)
/** Use the INFO content of the record with the highest AC */
@Argument(fullName = "mergeInfoWithMaxAC", shortName = "mergeInfoWithMaxAC", doc = "Use the INFO content of the record with the highest AC", required = false, exclusiveOf = "", validation = "")
var mergeInfoWithMaxAC: Boolean = _
var mergeInfoWithMaxAC: Boolean = config("mergeInfoWithMaxAC", default = false)
/** Filter out reads with CIGAR containing the N operator, instead of failing with an error */
@Argument(fullName = "filter_reads_with_N_cigar", shortName = "filterRNC", doc = "Filter out reads with CIGAR containing the N operator, instead of failing with an error", required = false, exclusiveOf = "", validation = "")
var filter_reads_with_N_cigar: Boolean = _
var filter_reads_with_N_cigar: Boolean = config("filter_reads_with_N_cigar", default = false)
/** Filter out reads with mismatching numbers of bases and base qualities, instead of failing with an error */
@Argument(fullName = "filter_mismatching_base_and_quals", shortName = "filterMBQ", doc = "Filter out reads with mismatching numbers of bases and base qualities, instead of failing with an error", required = false, exclusiveOf = "", validation = "")
var filter_mismatching_base_and_quals: Boolean = _
var filter_mismatching_base_and_quals: Boolean = config("filter_mismatching_base_and_quals", default = false)
/** Filter out reads with no stored bases (i.e. '*' where the sequence should be), instead of failing with an error */
@Argument(fullName = "filter_bases_not_stored", shortName = "filterNoBases", doc = "Filter out reads with no stored bases (i.e. '*' where the sequence should be), instead of failing with an error", required = false, exclusiveOf = "", validation = "")
var filter_bases_not_stored: Boolean = _
var filter_bases_not_stored: Boolean = config("filter_bases_not_stored", default = false)
override def freezeFieldValues() {
super.freezeFieldValues()
variantIndexes ++= variant.filter(orig => orig != null && (!orig.getName.endsWith(".list"))).map(orig => new File(orig.getPath + ".idx"))
deps ++= variant.filter(orig => orig != null && (!orig.getName.endsWith(".list"))).map(orig => VcfUtils.getVcfIndexFile(orig))
if (out != null && !org.broadinstitute.gatk.utils.io.IOUtils.isSpecialFile(out))
if (!org.broadinstitute.gatk.utils.commandline.ArgumentTypeDescriptor.isCompressed(out.getPath))
outIndex = new File(out.getPath + ".idx")
outputFiles :+= VcfUtils.getVcfIndexFile(out)
}
override def cmdLine = super.cmdLine +
......
......@@ -5,42 +5,13 @@
*/
package nl.lumc.sasc.biopet.extensions.gatk.broad
//import java.io.File
//
//import nl.lumc.sasc.biopet.utils.config.Configurable
//import org.broadinstitute.gatk.utils.commandline.{ Gather, Output }
//
//class GenotypeGVCFs(val root: Configurable) extends org.broadinstitute.gatk.queue.extensions.gatk.GenotypeGVCFs with GatkGeneral {
//
// @Gather(enabled = false)
// @Output(required = false)
// protected var vcfIndex: File = _
//
// annotation ++= config("annotation", default = Seq(), freeVar = false).asStringList
//
// if (config.contains("dbsnp")) dbsnp = config("dbsnp")
// if (config.contains("scattercount", "genotypegvcfs")) scatterCount = config("scattercount")
//
// if (config("inputtype", default = "dna").asString == "rna") {
// stand_call_conf = config("stand_call_conf", default = 20)
// stand_emit_conf = config("stand_emit_conf", default = 0)
// } else {
// stand_call_conf = config("stand_call_conf", default = 30)
// stand_emit_conf = config("stand_emit_conf", default = 0)
// }
//
// override def freezeFieldValues(): Unit = {
// super.freezeFieldValues()
// if (out.getName.endsWith(".vcf.gz")) vcfIndex = new File(out.getAbsolutePath + ".tbi")
// }
//}
import java.io.File
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.queue.extensions.gatk.{ CatVariantsGatherer, GATKScatterFunction, LocusScatterFunction, TaggedFile }
import org.broadinstitute.gatk.queue.extensions.gatk.{CatVariantsGatherer, GATKScatterFunction, LocusScatterFunction, TaggedFile}
import nl.lumc.sasc.biopet.core.ScatterGatherableFunction
import org.broadinstitute.gatk.utils.commandline.{ Argument, Gather, Output, _ }
import nl.lumc.sasc.biopet.utils.VcfUtils
import org.broadinstitute.gatk.utils.commandline.{Argument, Gather, Output, _}
class GenotypeGVCFs(val root: Configurable) extends CommandLineGATK with ScatterGatherableFunction {
def analysis_type = "GenotypeGVCFs"
......@@ -51,35 +22,26 @@ class GenotypeGVCFs(val root: Configurable) extends CommandLineGATK with Scatter
@Input(fullName = "variant", shortName = "V", doc = "One or more input gVCF files", required = true, exclusiveOf = "", validation = "")
var variant: Seq[File] = Nil
/** Dependencies on any indexes of variant */
@Input(fullName = "variantIndexes", shortName = "", doc = "Dependencies on any indexes of variant", required = false, exclusiveOf = "", validation = "")
private var variantIndexes: Seq[File] = Nil
/** File to which variants should be written */
@Output(fullName = "out", shortName = "o", doc = "File to which variants should be written", required = false, exclusiveOf = "", validation = "")
@Gather(classOf[CatVariantsGatherer])
var out: File = _
/** Automatically generated index for out */
@Output(fullName = "outIndex", shortName = "", doc = "Automatically generated index for out", required = false, exclusiveOf = "", validation = "")
@Gather(enabled = false)
private var outIndex: File = _
/** Include loci found to be non-variant after genotyping */
@Argument(fullName = "includeNonVariantSites", shortName = "allSites", doc = "Include loci found to be non-variant after genotyping", required = false, exclusiveOf = "", validation = "")
var includeNonVariantSites: Boolean = _
var includeNonVariantSites: Boolean = config("includeNonVariantSites", default = false)
/** Assume duplicate samples are present and uniquify all names with '.variant' and file number index */
@Argument(fullName = "uniquifySamples", shortName = "uniquifySamples", doc = "Assume duplicate samples are present and uniquify all names with '.variant' and file number index", required = false, exclusiveOf = "", validation = "")
var uniquifySamples: Boolean = _
var uniquifySamples: Boolean = config("uniquifySamples", default = false)
/** If provided, we will annotate records with the number of alternate alleles that were discovered (but not necessarily genotyped) at a given site */
@Argument(fullName = "annotateNDA", shortName = "nda", doc = "If provided, we will annotate records with the number of alternate alleles that were discovered (but not necessarily genotyped) at a given site", required = false, exclusiveOf = "", validation = "")
var annotateNDA: Boolean = _
var annotateNDA: Boolean = config("annotateNDA", default = false)
/** Heterozygosity value used to compute prior likelihoods for any locus */
@Argument(fullName = "heterozygosity", shortName = "hets", doc = "Heterozygosity value used to compute prior likelihoods for any locus", required = false, exclusiveOf = "", validation = "")
var heterozygosity: Option[Double] = None
var heterozygosity: Option[Double] = config("heterozygosity")
/** Format string for heterozygosity */
@Argument(fullName = "heterozygosityFormat", shortName = "", doc = "Format string for heterozygosity", required = false, exclusiveOf = "", validation = "")
......@@ -87,7 +49,7 @@ class GenotypeGVCFs(val root: Configurable) extends CommandLineGATK with Scatter
/** Heterozygosity for indel calling */
@Argument(fullName = "indel_heterozygosity", shortName = "indelHeterozygosity", doc = "Heterozygosity for indel calling", required = false, exclusiveOf = "", validation = "")
var indel_heterozygosity: Option[Double] = None
var indel_heterozygosity: Option[Double] = config("indel_heterozygosity")
/** Format string for indel_heterozygosity */
@Argument(fullName = "indel_heterozygosityFormat", shortName = "", doc = "Format string for indel_heterozygosity", required = false, exclusiveOf = "", validation = "")
......@@ -95,7 +57,7 @@ class GenotypeGVCFs(val root: Configurable) extends CommandLineGATK with Scatter
/** The minimum phred-scaled confidence threshold at which variants should be called */
@Argument(fullName = "standard_min_confidence_threshold_for_calling", shortName = "stand_call_conf", doc = "The minimum phred-scaled confidence threshold at which variants should be called", required = false, exclusiveOf = "", validation = "")
var standard_min_confidence_threshold_for_calling: Option[Double] = None
var standard_min_confidence_threshold_for_calling: Option[Double] = config("stand_call_conf")
/** Format string for standard_min_confidence_threshold_for_calling */
@Argument(fullName = "standard_min_confidence_threshold_for_callingFormat", shortName = "", doc = "Format string for standard_min_confidence_threshold_for_calling", required = false, exclusiveOf = "", validation = "")
......@@ -103,7 +65,7 @@ class GenotypeGVCFs(val root: Configurable) extends CommandLineGATK with Scatter
/** The minimum phred-scaled confidence threshold at which variants should be emitted (and filtered with LowQual if less than the calling threshold) */
@Argument(fullName = "standard_min_confidence_threshold_for_emitting", shortName = "stand_emit_conf", doc = "The minimum phred-scaled confidence threshold at which variants should be emitted (and filtered with LowQual if less than the calling threshold)", required = false, exclusiveOf = "", validation = "")
var standard_min_confidence_threshold_for_emitting: Option[Double] = None
var standard_min_confidence_threshold_for_emitting: Option[Double] = config("stand_emit_conf")
/** Format string for standard_min_confidence_threshold_for_emitting */
@Argument(fullName = "standard_min_confidence_threshold_for_emittingFormat", shortName = "", doc = "Format string for standard_min_confidence_threshold_for_emitting", required = false, exclusiveOf = "", validation = "")
......@@ -111,52 +73,47 @@ class GenotypeGVCFs(val root: Configurable) extends CommandLineGATK with Scatter
/** Maximum number of alternate alleles to genotype */
@Argument(fullName = "max_alternate_alleles", shortName = "maxAltAlleles", doc = "Maximum number of alternate alleles to genotype", required = false, exclusiveOf = "", validation = "")
var max_alternate_alleles: Option[Int] = None
var max_alternate_alleles: Option[Int] = config("max_alternate_alleles")
/** Input prior for calls */
@Argument(fullName = "input_prior", shortName = "inputPrior", doc = "Input prior for calls", required = false, exclusiveOf = "", validation = "")
var input_prior: Seq[Double] = Nil
var input_prior: List[Double] = config("input_prior", default = Nil)
/** Ploidy (number of chromosomes) per sample. For pooled data, set to (Number of samples in each pool * Sample Ploidy). */
@Argument(fullName = "sample_ploidy", shortName = "ploidy", doc = "Ploidy (number of chromosomes) per sample. For pooled data, set to (Number of samples in each pool * Sample Ploidy).", required = false, exclusiveOf = "", validation = "")
var sample_ploidy: Option[Int] = None
var sample_ploidy: Option[Int] = config("sample_ploidy")
/** One or more specific annotations to recompute. The single value 'none' removes the default annotations */
@Argument(fullName = "annotation", shortName = "A", doc = "One or more specific annotations to recompute. The single value 'none' removes the default annotations", required = false, exclusiveOf = "", validation = "")
var annotation: Seq[String] = Nil
var annotation: List[String] = config("annotation", default = Nil, freeVar = false)
/** One or more classes/groups of annotations to apply to variant calls */
@Argument(fullName = "group", shortName = "G", doc = "One or more classes/groups of annotations to apply to variant calls", required = false, exclusiveOf = "", validation = "")
var group: Seq[String] = Nil
var group: List[String] = config("group", default = Nil)
/** dbSNP file */
@Input(fullName = "dbsnp", shortName = "D", doc = "dbSNP file", required = false, exclusiveOf = "", validation = "")
var dbsnp: File = _
/** Dependencies on the index of dbsnp */
@Input(fullName = "dbsnpIndex", shortName = "", doc = "Dependencies on the index of dbsnp", required = false, exclusiveOf = "", validation = "")
private var dbsnpIndex: Seq[File] = Nil
var dbsnp: Option[File] = config("dbsnp")
/** Filter out reads with CIGAR containing the N operator, instead of failing with an error */
@Argument(fullName = "filter_reads_with_N_cigar", shortName = "filterRNC", doc = "Filter out reads with CIGAR containing the N operator, instead of failing with an error", required = false, exclusiveOf = "", validation = "")
var filter_reads_with_N_cigar: Boolean = _
var filter_reads_with_N_cigar: Boolean = config("filter_reads_with_N_cigar", default = false)
/** Filter out reads with mismatching numbers of bases and base qualities, instead of failing with an error */
@Argument(fullName = "filter_mismatching_base_and_quals", shortName = "filterMBQ", doc = "Filter out reads with mismatching numbers of bases and base qualities, instead of failing with an error", required = false, exclusiveOf = "", validation = "")
var filter_mismatching_base_and_quals: Boolean = _
var filter_mismatching_base_and_quals: Boolean = config("filter_mismatching_base_and_quals", default = false)
/** Filter out reads with no stored bases (i.e. '*' where the sequence should be), instead of failing with an error */
@Argument(fullName = "filter_bases_not_stored", shortName = "filterNoBases", doc = "Filter out reads with no stored bases (i.e. '*' where the sequence should be), instead of failing with an error", required = false, exclusiveOf = "", validation = "")
var filter_bases_not_stored: Boolean = _
var filter_bases_not_stored: Boolean = config("filter_bases_not_stored", default = false)
override def freezeFieldValues() {
super.freezeFieldValues()
variantIndexes ++= variant.filter(orig => orig != null && (!orig.getName.endsWith(".list"))).map(orig => new File(orig.getPath + ".idx"))
deps ++= variant.filter(orig => orig != null && (!orig.getName.endsWith(".list"))).map(orig => VcfUtils.getVcfIndexFile(orig))
if (out != null && !org.broadinstitute.gatk.utils.io.IOUtils.isSpecialFile(out))
if (!org.broadinstitute.gatk.utils.commandline.ArgumentTypeDescriptor.isCompressed(out.getPath))
outIndex = new File(out.getPath + ".idx")
if (dbsnp != null)
dbsnpIndex :+= new File(dbsnp.getPath + ".idx")
outputFiles :+= VcfUtils.getVcfIndexFile(out)
dbsnp.foreach(VcfUtils.getVcfIndexFile(_))
}
override def cmdLine = super.cmdLine +
......@@ -185,7 +142,6 @@ object GenotypeGVCFs {
val gg = new GenotypeGVCFs(root)
gg.variant = gvcfFiles
gg.out = output
//if (gg.out.getName.endsWith(".vcf.gz")) gg.vcfIndex = new File(gg.out.getAbsolutePath + ".tbi")
gg
}
}
......@@ -36,7 +36,10 @@ trait ShivaTrait extends MultisampleMappingTrait with Reference with TargetRegio
Some(shiva)
}
override def defaults = Map("haplotypecaller" -> Map("stand_call_conf" -> 30, "stand_emit_conf" -> 0))
override def defaults = Map(
"haplotypecaller" -> Map("stand_call_conf" -> 30, "stand_emit_conf" -> 0),
"genotypegvcfs" -> Map("stand_call_conf" -> 30, "stand_emit_conf" -> 0)
)
/** Method to make the variantcalling namespace of shiva */
def makeVariantcalling(multisample: Boolean = false): ShivaVariantcallingTrait with QScript = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment