Skip to content
Snippets Groups Projects
Commit 285e2e4d authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Added implicit List[File]

parent dbccba19
No related branches found
No related tags found
No related merge requests found
...@@ -21,5 +21,5 @@ trait GatkGeneral extends CommandLineGATK with BiopetJavaCommandLineFunction { ...@@ -21,5 +21,5 @@ trait GatkGeneral extends CommandLineGATK with BiopetJavaCommandLineFunction {
if (config.contains("exclude_intervals")) excludeIntervals = config("exclude_intervals").asFileList if (config.contains("exclude_intervals")) excludeIntervals = config("exclude_intervals").asFileList
reference_sequence = config("reference") reference_sequence = config("reference")
if (config.contains("gatk_key")) gatk_key = config("gatk_key") if (config.contains("gatk_key")) gatk_key = config("gatk_key")
if (config.contains("pedigree")) pedigree = config("pedigree").asFileList if (config.contains("pedigree")) pedigree = config("pedigree")
} }
...@@ -313,6 +313,16 @@ object ConfigUtils extends Logging { ...@@ -313,6 +313,16 @@ object ConfigUtils extends Logging {
any2list(any).map(_.toString) any2list(any).map(_.toString)
} }
/**
* Convert Any to List[File]
* @param any Input Any value
* @return
*/
def any2fileList(any: Any): List[File] = {
if (any == null) return null
any2list(any).map(x => new File(x.toString))
}
/** /**
* Convert Any to Map[String, Any] * Convert Any to Map[String, Any]
* @param any Input Any value * @param any Input Any value
...@@ -505,6 +515,16 @@ object ConfigUtils extends Logging { ...@@ -505,6 +515,16 @@ object ConfigUtils extends Logging {
else Nil else Nil
} }
/**
* Convert ConfigValue to List[File]
* @param value Input ConfigValue
* @return
*/
implicit def configValue2fileList(value: ConfigValue): List[File] = {
if (requiredValue(value)) any2fileList(value.value)
else Nil
}
/** /**
* Convert ConfigValue to Set[String] * Convert ConfigValue to Set[String]
* @param value Input ConfigValue * @param value Input ConfigValue
......
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