Scripts for adding read groups

These are what I'm using to add read groups to my bam files.

I'm finding that it works on some of the files but fails inexplicably on others. So far, it's managed about 25 out of 100. So the second script goes through checking for incomplete files and moves them out of the way to a trash folder.

I think it's helpful that each main script checks whether the target exists already or not. If so, it exits. I want to suggest that maybe we should do this routinely for all scripts? This means that if there are some failures (whether writing bam, gvcf or vcf) we can remove the failures and then run everything again. Otherwise, we need some other method for tracking which ones need redoing.
Yes, that's what I was thinking of to check for truncated BAM files.
I can't fork a new copy of the pipelines. I'm going to delete the repository I forked before and then try again. I hope that won't break anything.