mkdir -p bigwig
mkdir -p logs

find ../01-rnaseq/star_salmon/ -name "*.sorted.bam" | while read bam
do

    sample=$(basename ${bam} .sorted.bam)

    echo "srun --partition middle_idx --cpus-per-task 8 --mem 48G --time 2-00:00:00 --chdir ${scratch_dir} --output logs/RNABWCOVERAGE.${sample}.%j.log --job-name RNABWCOVERAGE singularity exec -B ${scratch_dir}/../../../ /data/ucct/bi/pipelines/singularity-images/deeptools_3.5.6.sif bamCoverage -b ${scratch_dir}/${bam#../} -o ${scratch_dir}/bigwig/${sample}_rna.bw --binSize 10 --normalizeUsing CPM --ignoreDuplicates --numberOfProcessors 8"

done > _01_rnaBigwigCoverage.sh
