--- ./ClinCNV-1.18.3.orig/trios/helpersTrio.R 2023-09-20 17:10:20.410302000 +0100 +++ ./ClinCNV-1.18.3/trios/helpersTrio.R 2023-09-20 17:11:41.828440000 +0100 @@ -29,8 +29,15 @@ vectorOfGeneNames = c(vectorOfGeneNames, unlist(strsplit(genesThatHasToBeSeparated[i], split=","))) } vectorOfGeneNamesTrimmed = c() - for (elem in vectorOfGeneNames) { - vectorOfGeneNamesTrimmed = c(vectorOfGeneNamesTrimmed,trimws(elem) ) + if (length(vectorOfGeneNames) > 0) { + for (elem in vectorOfGeneNames) { + vectorOfGeneNamesTrimmed = c(vectorOfGeneNamesTrimmed,trimws(elem) ) + } + } + if (length(vectorOfGeneNamesTrimmed) > 0) { + annotationGenes <- paste(unique(vectorOfGeneNamesTrimmed), collapse=",") + } else { + annotationGenes = "na" } annotationGenes <- paste(unique(vectorOfGeneNamesTrimmed), collapse=",") CNVtoOut <- matrix(c(chrom, toyBedFile[found_CNVs[s,2],2], toyBedFile[found_CNVs[s,3],3], @@ -96,4 +103,4 @@ } } return(cnvsToOutput) -} \ No newline at end of file +}