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

Make setting the tdf/wig less restrictive and no default names anymore

parent b2da50cb
Branches
Tags
No related merge requests found
package nl.lumc.sasc.biopet.extensions.igvtools package nl.lumc.sasc.biopet.extensions.igvtools
import java.nio.file.InvalidPathException
import nl.lumc.sasc.biopet.core.config.Configurable import nl.lumc.sasc.biopet.core.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{ Input, Output, Argument } import org.broadinstitute.gatk.utils.commandline.{ Input, Output, Argument }
import java.io.{ FileNotFoundException, File } import java.io.{ FileNotFoundException, File }
...@@ -20,10 +22,10 @@ class IGVToolsCount(val root: Configurable) extends IGVTools { ...@@ -20,10 +22,10 @@ class IGVToolsCount(val root: Configurable) extends IGVTools {
var genomeChromSizes: File = _ var genomeChromSizes: File = _
@Output @Output
protected var tdf: Option[File] = _ var tdf: Option[File] = _
@Output @Output
protected var wig: Option[File] = _ var wig: Option[File] = _
var maxZoom: Option[Int] = config("maxZoom") var maxZoom: Option[Int] = config("maxZoom")
var windowSize: Option[Int] = config("windowSize") var windowSize: Option[Int] = config("windowSize")
...@@ -46,8 +48,8 @@ class IGVToolsCount(val root: Configurable) extends IGVTools { ...@@ -46,8 +48,8 @@ class IGVToolsCount(val root: Configurable) extends IGVTools {
super.afterGraph super.afterGraph
if (!input.exists()) throw new FileNotFoundException("Input bam is required for IGVToolsCount") if (!input.exists()) throw new FileNotFoundException("Input bam is required for IGVToolsCount")
this.tdf = Some(new File(input.getAbsolutePath + ".tdf")) if (!wig.isEmpty && !wig.get.getAbsolutePath.endsWith(".wig")) throw new IllegalArgumentException("Wiggle file should have a .wig file-extension")
this.wig = Some(new File(input.getAbsolutePath.stripSuffix(".bam") + ".wig")) if (!tdf.isEmpty && !tdf.get.getAbsolutePath.endsWith(".tdf")) throw new IllegalArgumentException("TDF file should have a .tdf file-extension")
} }
def cmdLine = { def cmdLine = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment