Skip to content

Commit d6990b1

Browse files
authored
Merge pull request #48 from maize-genetics/merge-gvcfs-method-filenames
Added method mergeGVCFs that takes a list of input files. Existing me…
2 parents f53cda8 + 29a3045 commit d6990b1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/main/kotlin/biokotlin/util/MergeGVCFUtils.kt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ private val myLogger = LogManager.getLogger("biokotlin.util.MergeGVCFUtils")
2525
*/
2626
object MergeGVCFUtils {
2727

28-
fun mergeGVCFs(inputDir: String, outputFile: String, bedfile: String? = null) {
28+
fun mergeGVCFs(inputDir: String, outputFile: String, bedFile: String? = null) {
29+
mergeGVCFs(getGVCFFiles(inputDir), outputFile, bedFile)
30+
}
2931

30-
runBlocking {
32+
fun mergeGVCFs(inputFiles: List<String>, outputFile: String, bedFile: String? = null) {
3133

32-
val inputFiles = getGVCFFiles(inputDir)
34+
runBlocking {
3335

3436
require(validateVCFs(inputFiles).valid) { "Some GVCF files are invalid." }
3537

@@ -70,12 +72,12 @@ object MergeGVCFUtils {
7072

7173
}
7274

73-
val theBedfile = bedfile?.trim()
75+
val theBedfile = bedFile?.trim()
7476
if (theBedfile.isNullOrEmpty()) {
7577
myLogger.info("Writing output: $outputFile")
7678
writeOutputVCF(outputFile, samples, variantContextChannel)
7779
} else {
78-
myLogger.info("Writing output files with base name: $outputFile and bedfile: $bedfile")
80+
myLogger.info("Writing output files with base name: $outputFile and bedfile: $bedFile")
7981
writeOutputVCF(outputFile, theBedfile, samples, variantContextChannel)
8082
}
8183

0 commit comments

Comments
 (0)