Merged bug fix from Stable into Unstable
This commit is contained in:
commit
4f8230c750
|
|
@ -3,6 +3,7 @@ package org.broadinstitute.sting.queue.qscripts
|
||||||
import org.broadinstitute.sting.queue.QScript
|
import org.broadinstitute.sting.queue.QScript
|
||||||
import org.broadinstitute.sting.queue.extensions.gatk._
|
import org.broadinstitute.sting.queue.extensions.gatk._
|
||||||
import net.sf.samtools.SAMFileReader
|
import net.sf.samtools.SAMFileReader
|
||||||
|
import io.Source._
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by IntelliJ IDEA.
|
* Created by IntelliJ IDEA.
|
||||||
|
|
@ -37,21 +38,35 @@ class RecalibrateBaseQualities extends QScript {
|
||||||
return samReader.getFileHeader.getSequenceDictionary.getSequences.size()
|
return samReader.getFileHeader.getSequenceDictionary.getSequences.size()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reads a BAM LIST file and creates a scala list with all the files
|
||||||
|
def createListFromFile(in: File):List[File] = {
|
||||||
|
if (in.toString.endsWith("bam"))
|
||||||
|
return List(in)
|
||||||
|
var l: List[File] = List()
|
||||||
|
for (bam <- fromFile(in).getLines)
|
||||||
|
l :+= new File(bam)
|
||||||
|
return l
|
||||||
|
}
|
||||||
|
|
||||||
def script = {
|
def script = {
|
||||||
|
|
||||||
nContigs = getNumberOfContigs(input)
|
val bamList = createListFromFile(input)
|
||||||
|
nContigs = getNumberOfContigs(bamList(0))
|
||||||
|
|
||||||
val recalFile1: File = swapExt(input, ".bam", ".recal1.csv")
|
for (bam <- bamList) {
|
||||||
val recalFile2: File = swapExt(input, ".bam", ".recal2.csv")
|
|
||||||
val recalBam: File = swapExt(input, ".bam", ".recal.bam")
|
|
||||||
val path1: String = input + "before"
|
|
||||||
val path2: String = input + "after"
|
|
||||||
|
|
||||||
add(cov(input, recalFile1),
|
val recalFile1: File = swapExt(bam, ".bam", ".recal1.csv")
|
||||||
recal(input, recalFile1, recalBam),
|
val recalFile2: File = swapExt(bam, ".bam", ".recal2.csv")
|
||||||
cov(recalBam, recalFile2),
|
val recalBam: File = swapExt(bam, ".bam", ".recal.bam")
|
||||||
analyzeCovariates(recalFile1, path1),
|
val path1: String = bam + "before"
|
||||||
analyzeCovariates(recalFile2, path2))
|
val path2: String = bam + "after"
|
||||||
|
|
||||||
|
add(cov(bam, recalFile1),
|
||||||
|
recal(bam, recalFile1, recalBam),
|
||||||
|
cov(recalBam, recalFile2),
|
||||||
|
analyzeCovariates(recalFile1, path1),
|
||||||
|
analyzeCovariates(recalFile2, path2))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
trait CommandLineGATKArgs extends CommandLineGATK {
|
trait CommandLineGATKArgs extends CommandLineGATK {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue