mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 19:18:17 +00:00
luslab-umitools | Rudimentary hash checking of files
This commit is contained in:
parent
3d81018c79
commit
128fd6fc76
14 changed files with 53 additions and 0 deletions
|
@ -49,4 +49,17 @@ workflow {
|
||||||
|
|
||||||
// Collect file names and view output
|
// Collect file names and view output
|
||||||
umitools_dedup.out.dedupBam | view
|
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
|
||||||
}
|
}
|
BIN
tools/umi_tools/test/output/sample1.dedup.bam
Normal file
BIN
tools/umi_tools/test/output/sample1.dedup.bam
Normal file
Binary file not shown.
BIN
tools/umi_tools/test/output/sample1.dedup.bam.bai
Normal file
BIN
tools/umi_tools/test/output/sample1.dedup.bam.bai
Normal file
Binary file not shown.
BIN
tools/umi_tools/test/output/sample2.dedup.bam
Normal file
BIN
tools/umi_tools/test/output/sample2.dedup.bam
Normal file
Binary file not shown.
BIN
tools/umi_tools/test/output/sample2.dedup.bam.bai
Normal file
BIN
tools/umi_tools/test/output/sample2.dedup.bam.bai
Normal file
Binary file not shown.
BIN
tools/umi_tools/test/output/sample3.dedup.bam
Normal file
BIN
tools/umi_tools/test/output/sample3.dedup.bam
Normal file
Binary file not shown.
BIN
tools/umi_tools/test/output/sample3.dedup.bam.bai
Normal file
BIN
tools/umi_tools/test/output/sample3.dedup.bam.bai
Normal file
Binary file not shown.
BIN
tools/umi_tools/test/output/sample4.dedup.bam
Normal file
BIN
tools/umi_tools/test/output/sample4.dedup.bam
Normal file
Binary file not shown.
BIN
tools/umi_tools/test/output/sample4.dedup.bam.bai
Normal file
BIN
tools/umi_tools/test/output/sample4.dedup.bam.bai
Normal file
Binary file not shown.
BIN
tools/umi_tools/test/output/sample5.dedup.bam
Normal file
BIN
tools/umi_tools/test/output/sample5.dedup.bam
Normal file
Binary file not shown.
BIN
tools/umi_tools/test/output/sample5.dedup.bam.bai
Normal file
BIN
tools/umi_tools/test/output/sample5.dedup.bam.bai
Normal file
Binary file not shown.
BIN
tools/umi_tools/test/output/sample6.dedup.bam
Normal file
BIN
tools/umi_tools/test/output/sample6.dedup.bam
Normal file
Binary file not shown.
BIN
tools/umi_tools/test/output/sample6.dedup.bam.bai
Normal file
BIN
tools/umi_tools/test/output/sample6.dedup.bam.bai
Normal file
Binary file not shown.
40
tools/umi_tools/test/verify-checksum.sh
Executable file
40
tools/umi_tools/test/verify-checksum.sh
Executable 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
|
Loading…
Reference in a new issue