Skip to content

Added method mergeGVCFs that takes a list of input files. Existing me… #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/main/kotlin/biokotlin/util/MergeGVCFUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ private val myLogger = LogManager.getLogger("biokotlin.util.MergeGVCFUtils")
*/
object MergeGVCFUtils {

fun mergeGVCFs(inputDir: String, outputFile: String, bedfile: String? = null) {
fun mergeGVCFs(inputDir: String, outputFile: String, bedFile: String? = null) {
mergeGVCFs(getGVCFFiles(inputDir), outputFile, bedFile)
}

runBlocking {
fun mergeGVCFs(inputFiles: List<String>, outputFile: String, bedFile: String? = null) {

val inputFiles = getGVCFFiles(inputDir)
runBlocking {
Copy link
Preview

Copilot AI May 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using runBlocking within the mergeGVCFs function may block the calling thread; consider making the function suspend to enable non-blocking asynchronous operations if applicable.

Copilot uses AI. Check for mistakes.


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

Expand Down Expand Up @@ -70,12 +72,12 @@ object MergeGVCFUtils {

}

val theBedfile = bedfile?.trim()
val theBedfile = bedFile?.trim()
if (theBedfile.isNullOrEmpty()) {
myLogger.info("Writing output: $outputFile")
writeOutputVCF(outputFile, samples, variantContextChannel)
} else {
myLogger.info("Writing output files with base name: $outputFile and bedfile: $bedfile")
myLogger.info("Writing output files with base name: $outputFile and bedfile: $bedFile")
writeOutputVCF(outputFile, theBedfile, samples, variantContextChannel)
}

Expand Down