Skip to content

Instantly share code, notes, and snippets.

@danielecook
Last active February 11, 2020 11:06
Show Gist options
  • Save danielecook/1602d4e90cf6d94ff763209c3a8f9bfb to your computer and use it in GitHub Desktop.
Save danielecook/1602d4e90cf6d94ff763209c3a8f9bfb to your computer and use it in GitHub Desktop.
List bams with missing indices / index
function check_file {
if [ ! -s "$1" ]
then
echo "$1 not found"
fi
}
export -f check_file
# List bams with a missing bai index
ls -1 *.bam | parallel check_file {}.bai
# List bai's with a missing bam
ls -1 *.bai | sed 's/.bai//' | parallel check_file {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment