Skip to content
Snippets Groups Projects
Commit b21fac92 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Change name

parent 4875e508
No related branches found
No related tags found
No related merge requests found
......@@ -11,26 +11,26 @@ import org.broadinstitute.gatk.utils.commandline.{ Argument, Input }
*
* Created by pjvanthof on 16/08/15.
*/
class CheckMd5 extends InProcessFunction {
class CheckChecksum extends InProcessFunction {
@Input(required = true)
var inputFile: File = _
@Input(required = true)
var md5file: File = _
var checksumFile: File = _
@Argument(required = true)
var md5sum: String = _
var checksum: String = _
override def freezeFieldValues(): Unit = {
super.freezeFieldValues()
jobOutputFile = new File(md5file.getParentFile, md5file.getName + ".check.out")
jobOutputFile = new File(checksumFile.getParentFile, checksumFile.getName + ".check.out")
}
/** Exits whenever the input md5sum is not the same as the output md5sum */
def run: Unit = {
val outputMd5sum = WriteSummary.parseChecksum(md5file).toLowerCase
val outputChecksum = WriteSummary.parseChecksum(checksumFile).toLowerCase
if (outputMd5sum != md5sum.toLowerCase) {
if (outputChecksum != checksum.toLowerCase) {
logger.error(s"Input file: '$inputFile' md5sum is not as expected, aborting pipeline")
System.exit(1)
}
......
......@@ -18,7 +18,7 @@ package nl.lumc.sasc.biopet.core.summary
import java.io.File
import nl.lumc.sasc.biopet.core._
import nl.lumc.sasc.biopet.core.extensions.{ CheckMd5, Md5sum }
import nl.lumc.sasc.biopet.core.extensions.{ CheckChecksum, Md5sum }
import scala.collection.mutable
......@@ -119,11 +119,11 @@ trait SummaryQScript extends BiopetQScript { qscript =>
for (inputFile <- inputFiles) {
inputFile.md5 match {
case Some(checksum) => {
val checkMd5 = new CheckMd5
val checkMd5 = new CheckChecksum
checkMd5.inputFile = inputFile.file
require(SummaryQScript.md5sumCache.contains(inputFile.file), "Md5 job is not executed, checksum file can't be found")
checkMd5.md5file = SummaryQScript.md5sumCache(inputFile.file)
checkMd5.md5sum = checksum
checkMd5.checksumFile = SummaryQScript.md5sumCache(inputFile.file)
checkMd5.checksum = checksum
add(checkMd5)
}
case _ =>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment