Added an optional tag argument RodBind, similar to the Tag argument on TaggedFile.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5437 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
33c7593218
commit
c18f1aa828
|
|
@ -7,20 +7,26 @@ import java.lang.String
|
||||||
/**
|
/**
|
||||||
* Used to provide -B rodBind arguments to the GATK.
|
* Used to provide -B rodBind arguments to the GATK.
|
||||||
*/
|
*/
|
||||||
class RodBind(var trackName: String, var trackType: String, path: String) extends File(path) with FileExtension {
|
class RodBind(var trackName: String, var trackType: String, path: String, val tag: String) extends File(path) with FileExtension {
|
||||||
|
def this(trackName: String, trackType: String, path: String) =
|
||||||
|
this(trackName, trackType, path, null)
|
||||||
|
def this(trackName: String, trackType: String, file: File, tag: String) =
|
||||||
|
this(trackName, trackType, file.getPath, tag)
|
||||||
def this(trackName: String, trackType: String, file: File) =
|
def this(trackName: String, trackType: String, file: File) =
|
||||||
this(trackName, trackType, file.getPath)
|
this(trackName, trackType, file.getPath, null)
|
||||||
require(trackName != null, "RodBind trackName cannot be null")
|
require(trackName != null, "RodBind trackName cannot be null")
|
||||||
require(trackType != null, "RodBind trackType cannot be null")
|
require(trackType != null, "RodBind trackType cannot be null")
|
||||||
def withPath(newPath: String) = new RodBind(trackName, trackType, newPath)
|
def withPath(newPath: String) = new RodBind(trackName, trackType, newPath, tag)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to provide -B rodBind arguments to the GATK.
|
* Used to provide -B rodBind arguments to the GATK.
|
||||||
*/
|
*/
|
||||||
object RodBind {
|
object RodBind {
|
||||||
def apply(trackName: String, trackType: String, path: String) = new RodBind(trackName, trackType, path)
|
def apply(trackName: String, trackType: String, path: String, tag: String) = new RodBind(trackName, trackType, path, tag)
|
||||||
def apply(trackName: String, trackType: String, file: File) = new RodBind(trackName, trackType, file)
|
def apply(trackName: String, trackType: String, path: String) = new RodBind(trackName, trackType, path, null)
|
||||||
|
def apply(trackName: String, trackType: String, file: File, tag: String) = new RodBind(trackName, trackType, file, tag)
|
||||||
|
def apply(trackName: String, trackType: String, file: File) = new RodBind(trackName, trackType, file, null)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Formats the rod binding on the command line.
|
* Formats the rod binding on the command line.
|
||||||
|
|
@ -33,6 +39,8 @@ object RodBind {
|
||||||
*/
|
*/
|
||||||
def formatCommandLine(cmdLineParam: String)(prefix: String, value: Any, suffix: String) = {
|
def formatCommandLine(cmdLineParam: String)(prefix: String, value: Any, suffix: String) = {
|
||||||
value match {
|
value match {
|
||||||
|
case rodBind: RodBind if (rodBind.tag != null) =>
|
||||||
|
" %s:%s,%s,%s %s".format(cmdLineParam, rodBind.trackName, rodBind.trackType, rodBind.getPath, rodBind.tag)
|
||||||
case rodBind: RodBind =>
|
case rodBind: RodBind =>
|
||||||
" %s:%s,%s %s".format(cmdLineParam, rodBind.trackName, rodBind.trackType, rodBind.getPath)
|
" %s:%s,%s %s".format(cmdLineParam, rodBind.trackName, rodBind.trackType, rodBind.getPath)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue