<commit_before><commit_msg>Create cp-bam-files.sh<commit_after>#!/usr/bin/env bash
set -Eeuo pipefail

# Copy BAM and BAI (index) files to a destination.

# Source directory.
source_dir="$1"
source_dir="$( realpath $source_dir )"
if [[ ! -d "$source_dir" ]]
then
    printf "\nDoes not exist:\n$source_dir\n\n"
    exit 1
fi

# Destination directory.
dest_dir="$2"
dest_dir="$( realpath $dest_dir )"
if [[ ! -d "$dest_dir" ]]
then
    printf "\nDoes not exist:\n$dest_dir\n\n"
    exit 1
fi

printf "\n"
printf "Source:\n$source_dir\n"
printf "\n"
printf "Destination:\n$dest_dir\n"
printf "\n"

# Note that we're allowing symlinks in the search path.
# -L  follow symbolic links

find -L "$source_dir" \
    -maxdepth 1 \
    -name "*.bam" -print0 -o -name "*.bam.bai" \
    -print0 | xargs -0 -I {} \
    cp -irv {} "$dest_dir"

{'fraction_non_alphanumeric': 0.1674698795180723, 'fraction_numerical': 0.00963855421686747, 'mean_word_length': 3.239795918367347, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2314022', 'n_tokens_mistral': 334, 'n_tokens_neox': 324, 'n_words': 90}