From 54c312c010597e45d26350911ce5b436ecb5522d Mon Sep 17 00:00:00 2001 From: Sander Bollen Date: Tue, 28 Mar 2017 16:54:08 +0200 Subject: [PATCH] set vs list --- .../nl/lumc/sasc/biopet/core/PedigreeQscript.scala | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/PedigreeQscript.scala b/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/PedigreeQscript.scala index f23611d09..9cb77d61c 100644 --- a/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/PedigreeQscript.scala +++ b/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/PedigreeQscript.scala @@ -69,17 +69,17 @@ trait PedigreeQscript extends MultiSampleQScript { qscript: QScript => * @return */ def pedSamplesFromConfig(): List[PedSample] = { - val totalSampleIds = samples.values.map(_.sampleId).toList val withFam = samples.values.filter(_.family.isDefined) - val fathers = withFam.filter(_.father.isDefined).flatMap(_.father) - val mothers = withFam.filter(_.mother.isDefined).flatMap(_.mother) + val sampleIds = withFam.map(_.sampleId).toSet + val fathers = withFam.flatMap(_.father) + val mothers = withFam.flatMap(_.mother) fathers.foreach { f => - if (!withFam.map(_.sampleId).toList.contains(f)) { + if (!sampleIds.contains(f)) { Logging.addError(s"Father $f does not exist in samples") } } mothers.foreach { m => - if (!withFam.map(_.sampleId).toList.contains(m)) { + if (!sampleIds.contains(m)) { Logging.addError(s"Mother $m does not exist in samples") } } -- 2.22.0