luslab-umitools | Rudimentary hash checking of files

This commit is contained in:
Chris Cheshire 2020-06-26 11:24:05 +01:00
parent 3d81018c79
commit 128fd6fc76
14 changed files with 53 additions and 0 deletions

View file

@ -49,4 +49,17 @@ workflow {
// Collect file names and view output
umitools_dedup.out.dedupBam | view
}
workflow.onComplete {
def proc = "$baseDir/verify-checksum.sh $baseDir/../../../results/umitools/dedup/*.bai $baseDir/output/*.bai".execute()
def b = new StringBuffer()
proc.consumeProcessErrorStream(b)
log.info proc.text
errorString = b.toString()
if(errorString != '')
log.error errorString
exit 1
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,40 @@
#!/bin/sh
if [ -z "$1" ]
then
echo "No check pattern argument supplied" >&2
exit 1
fi
if [ -z "$2" ]
then
echo "No verify pattern argument supplied" >&2
exit 1
fi
checkfiles=$1
infiles=$2
#echo $checkfiles
#echo $infiles
echo '\nCalculating check file hashes...'
md5sum $checkfiles
echo '\nCalculating input file hashes...'
md5sum $infiles
echo '\nComparing hash of file of hashes...'
checkver=$(md5sum $checkfiles | awk '{print $1}' | md5sum | awk '{print $1}')
echo $checkver
inver=$(md5sum $infiles | awk '{print $1}' | md5sum | awk '{print $1}')
echo $inver
if [ "$checkver" == "$inver" ]
then
echo "Hashes match"
exit 0
else
echo "Hashes do not match" >&2
exit 1
fi