** annotate_peaks_and_find_motifs.sh *** self explanatory ***

#!/bin/sh
#$ -cwd

module load EBModules GCC/7.3.0-2.30  OpenMPI/3.1.1 SAMtools/1.9


# Loop through all .bw files in the current directory
for file in *.bw; do
    # Extract filename without extension
    base_name="${file%.bw}"
    # Convert to bedGraph using bigWigToBedGraph
    bigWigToBedGraph "$file" "${base_name}.bg"
    echo "Converted $file to ${base_name}.bg"
done

