Skip to content

Instantly share code, notes, and snippets.

@danielecook
Last active February 21, 2019 00:18
Show Gist options
  • Save danielecook/e9e0a9c4a8295b08e3fda04e1217145c to your computer and use it in GitHub Desktop.
Save danielecook/e9e0a9c4a8295b08e3fda04e1217145c to your computer and use it in GitHub Desktop.
Compare hashes of bam files
function samtools_md5() {
md5=`samtools view ${1} | tr '\t' '\n' | sort | md5sum`
echo -e "${md5}\t${1}"
}
export -f samtools_md5
parallel --verbose -j 10 samtools_md5 {} ::: `ls *.bam` > hashes.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment