fixed a bug when the pipeline was used on a single bam.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5708 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
b7334dcc1e
commit
f04cc4321f
|
|
@ -153,9 +153,8 @@ class dataProcessingV2 extends QScript {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Checks how many contigs are in the dataset. Uses the BAM file header information.
|
// Checks how many contigs are in the dataset. Uses the BAM file header information.
|
||||||
def getNumberOfContigs(): Int = {
|
def getNumberOfContigs(bamFile: File): Int = {
|
||||||
val bam = fromFile(input).getLines.next
|
val samReader = new SAMFileReader(new File(bamFile))
|
||||||
val samReader = new SAMFileReader(new File(bam))
|
|
||||||
return samReader.getFileHeader.getSequenceDictionary.getSequences.size()
|
return samReader.getFileHeader.getSequenceDictionary.getSequences.size()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -190,8 +189,8 @@ class dataProcessingV2 extends QScript {
|
||||||
// Generate a BAM file per sample joining all per lane files if necessary
|
// Generate a BAM file per sample joining all per lane files if necessary
|
||||||
val sampleBamFiles = createSampleFiles(perLaneAlignedBamFiles)
|
val sampleBamFiles = createSampleFiles(perLaneAlignedBamFiles)
|
||||||
|
|
||||||
// keep a record of the number of contigs in this bam file (they should all be the same
|
// keep a record of the number of contigs in the first bam file in the list
|
||||||
nContigs = getNumberOfContigs()
|
nContigs = getNumberOfContigs(perLaneAlignedBamFiles(0))
|
||||||
|
|
||||||
// Final output list of processed bam files
|
// Final output list of processed bam files
|
||||||
var cohortList: List[File] = List()
|
var cohortList: List[File] = List()
|
||||||
|
|
@ -288,19 +287,16 @@ class dataProcessingV2 extends QScript {
|
||||||
this.jobName = queueLogDir + outBam + ".clean"
|
this.jobName = queueLogDir + outBam + ".clean"
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo -- add scatter gather capability (waiting for khalid's modifications to the queue base
|
|
||||||
case class cov (inBam: File, outRecalFile: File) extends CountCovariates with CommandLineGATKArgs {
|
case class cov (inBam: File, outRecalFile: File) extends CountCovariates with CommandLineGATKArgs {
|
||||||
this.rodBind :+= RodBind("dbsnp", "VCF", dbSNP)
|
this.rodBind :+= RodBind("dbsnp", "VCF", dbSNP)
|
||||||
this.covariate ++= List("ReadGroupCovariate", "QualityScoreCovariate", "CycleCovariate", "DinucCovariate")
|
this.covariate ++= List("ReadGroupCovariate", "QualityScoreCovariate", "CycleCovariate", "DinucCovariate")
|
||||||
this.input_file :+= inBam
|
this.input_file :+= inBam
|
||||||
this.recal_file = outRecalFile
|
this.recal_file = outRecalFile
|
||||||
this.scatterCount = nContigs
|
this.scatterCount = nContigs
|
||||||
this.jobQueue = "gsa" // should take this out once scatter gather is available.
|
|
||||||
this.analysisName = queueLogDir + outRecalFile + ".covariates"
|
this.analysisName = queueLogDir + outRecalFile + ".covariates"
|
||||||
this.jobName = queueLogDir + outRecalFile + ".covariates"
|
this.jobName = queueLogDir + outRecalFile + ".covariates"
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo -- add scatter gather capability (waiting for khalid's modifications to the queue base
|
|
||||||
case class recal (inBam: File, inRecalFile: File, outBam: File) extends TableRecalibration with CommandLineGATKArgs {
|
case class recal (inBam: File, inRecalFile: File, outBam: File) extends TableRecalibration with CommandLineGATKArgs {
|
||||||
this.input_file :+= inBam
|
this.input_file :+= inBam
|
||||||
this.recal_file = inRecalFile
|
this.recal_file = inRecalFile
|
||||||
|
|
@ -309,10 +305,9 @@ class dataProcessingV2 extends QScript {
|
||||||
if (!qscript.intervalString.isEmpty()) this.intervalsString ++= List(qscript.intervalString)
|
if (!qscript.intervalString.isEmpty()) this.intervalsString ++= List(qscript.intervalString)
|
||||||
else if (qscript.intervals != null) this.intervals :+= qscript.intervals
|
else if (qscript.intervals != null) this.intervals :+= qscript.intervals
|
||||||
this.U = org.broadinstitute.sting.gatk.arguments.ValidationExclusion.TYPE.NO_READ_ORDER_VERIFICATION // todo -- update this with the last consensus between Tim, Matt and Eric. This is ugly!
|
this.U = org.broadinstitute.sting.gatk.arguments.ValidationExclusion.TYPE.NO_READ_ORDER_VERIFICATION // todo -- update this with the last consensus between Tim, Matt and Eric. This is ugly!
|
||||||
this.index_output_bam_on_the_fly = true // todo -- implemente @gather for BAM index
|
// this.index_output_bam_on_the_fly = true
|
||||||
// this.scatterCount = nContigs
|
this.scatterCount = nContigs
|
||||||
this.isIntermediate = false
|
this.isIntermediate = false
|
||||||
this.jobQueue = "gsa" // should take this out once scatter gather is available.
|
|
||||||
this.analysisName = queueLogDir + outBam + ".recalibration"
|
this.analysisName = queueLogDir + outBam + ".recalibration"
|
||||||
this.jobName = queueLogDir + outBam + ".recalibration"
|
this.jobName = queueLogDir + outBam + ".recalibration"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue