Commit 3fb6b5f8 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Fixed error message in bamutils

parent defe2788
...@@ -25,7 +25,8 @@ object BamUtils { ...@@ -25,7 +25,8 @@ object BamUtils {
val inputSam = SamReaderFactory.makeDefault.open(file) val inputSam = SamReaderFactory.makeDefault.open(file)
val samples = inputSam.getFileHeader.getReadGroups.map(_.getSample).distinct val samples = inputSam.getFileHeader.getReadGroups.map(_.getSample).distinct
if (samples.size == 1) samples.head -> file if (samples.size == 1) samples.head -> file
else throw new IllegalArgumentException("Bam contains multiple sample IDs: " + file) else if (samples.size > 1) throw new IllegalArgumentException("Bam contains multiple sample IDs: " + file)
else throw new IllegalArgumentException("Bam does not contain sample ID or have no readgroups defined: " + file)
} }
if (temp.map(_._1).distinct.size != temp.size) throw new IllegalArgumentException("Samples has been found twice") if (temp.map(_._1).distinct.size != temp.size) throw new IllegalArgumentException("Samples has been found twice")
temp.toMap temp.toMap
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment