Skip to content
Snippets Groups Projects
Commit ab220766 authored by Wai Yi Leung's avatar Wai Yi Leung
Browse files

Adding IGVTools for creation of TDF files (Wiggle for IGV)

parent 5937fdc6
No related branches found
No related tags found
No related merge requests found
/**
* Created by wyleung on 5-1-15.
*/
package nl.lumc.sasc.biopet.extensions.igvtools
import nl.lumc.sasc.biopet.core.BiopetCommandLineFunction
abstract class IGVTools extends BiopetCommandLineFunction {
executable = config("exe", default = "igvtools", submodule = "igvtools", freeVar = false)
override def versionCommand = executable + " version"
override val versionRegex = """IGV Version: ([\d\.]) .*""".r
override val versionExitcode = List(0)
}
\ No newline at end of file
package nl.lumc.sasc.biopet.extensions.igvtools
import nl.lumc.sasc.biopet.core.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{ Input, Output, Argument }
import java.io.File
class IGVToolsCount(val root: Configurable) extends IGVTools {
@Input(doc = "Bam File")
var input: File = _
@Argument(doc = "Genome name")
var genomename: String = _
@Output(doc = "output File")
var output: File = _
def cmdLine = required(executable) + required("count") + required(input) + required(output) + required(genomename)
}
object IGVToolsCount {
def apply(root: Configurable, input: File, output: File, genomename: String): IGVToolsCount = {
val counting = new IGVToolsCount(root)
counting.input = input
counting.output = output
counting.genomename = genomename
return counting
}
def apply(root: Configurable, input: File, genomename: String): IGVToolsCount = {
return apply(root, input, new File(swapExtension(input.getCanonicalPath)), genomename)
}
private def swapExtension(inputFile: String) = inputFile + ".tdf"
}
\ No newline at end of file
......@@ -24,6 +24,7 @@ import nl.lumc.sasc.biopet.core.MultiSampleQScript
import nl.lumc.sasc.biopet.core.PipelineCommand
import nl.lumc.sasc.biopet.extensions.Ln
import nl.lumc.sasc.biopet.extensions.igvtools.IGVToolsCount
import nl.lumc.sasc.biopet.extensions.sambamba.{ SambambaIndex, SambambaMerge, SambambaMarkdup }
import nl.lumc.sasc.biopet.extensions.svcallers.pindel.Pindel
import nl.lumc.sasc.biopet.extensions.svcallers.{ Breakdancer, Delly, CleverCaller }
......@@ -91,21 +92,25 @@ class Yamsvp(val root: Configurable) extends QScript with MultiSampleQScript {
val bamFile: File =
if (libraryBamfiles.size == 1) {
// When the sample has only 1 run, make a link in the main alignment directory
val alignmentlink = Ln(root, libraryBamfiles.head,
val alignmentlink = Ln(this, libraryBamfiles.head,
alignmentDir + sampleID + ".merged.bam", true)
add(alignmentlink, isIntermediate = true)
alignmentlink.out
} else if (libraryBamfiles.size > 1) {
val mergeSamFiles = new SambambaMerge(root)
val mergeSamFiles = new SambambaMerge(this)
mergeSamFiles.input = libraryBamfiles
mergeSamFiles.output = alignmentDir + sampleID + ".merged.bam"
add(mergeSamFiles, isIntermediate = true)
mergeSamFiles.output
} else null
val bamMarkDup = SambambaMarkdup(root, bamFile)
val bamMarkDup = SambambaMarkdup(this, bamFile)
add(bamMarkDup)
// create an IGV TDF file
val tdfCount = IGVToolsCount(this, bamMarkDup.output, config("genomename", default = "hg19"))
add(tdfCount)
/// bamfile will be used as input for the SV callers. First run Clever
// val cleverVCF : File = sampleDir + "/" + sampleID + ".clever.vcf"
......
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