Hmm, your log file is definitely interesting. At the end of the log file, it is supposed to print the number of records that were successfully written to each RG specific file.
Here is the log file from my testcase
more ~/code/bamUtil/test/results/splitBam.log
Input BAM file : testFiles/splitBam.bam
Output BAM prefix : results/splitBam
Output log file : results/splitBam.log
Verbose mode : Off
BGFZ EOF indicator : On
The following ReadGroup IDs are identified. Splitting into 2 BAM files..
1: RG1
2: RG2
Successfully wrote 10 record for readGroup RG1
Successfully wrote 10 record for readGroup RG2
As you can see on the bottom of the log it says how many successfully wrote.
It appears that your run did not complete successfully.
Unfortunately the log does not indicate an error. I'm assuming you didn't see one on the command-line either, is that correct?
I'm guessing that something happened that caused it to stop running. That would explain why it never wrote those end of file markers - it never hit that part of the code.
That would also explain why your log is missing the number of records in each read group.
Since it appears to me that splitBam did not finish running, I would guess that your per RG bams are incomplete - missing records. Also, based on the validation failures - it appears that they did not end on a record boundary - only parts of records were written.
If they were valid BAMs, you could run bam convert --in New.Ob137.bam --out New1.Ob137.bam --noeof
That would add an EOF block to the end. You can try it, but I would expect that it would fail on reading the last record due to it being truncated.
So unfortunately, I think at this point I would have to recommend to rerun. You can delete your old RG specific BAMs.
Hopefully this time splitBam completes successfully or reports an error on the command-line or in the log to explain what happened.
I'm sorry for the troubles that this has caused. It shouldn't silently fail like that unless maybe it got killed and was unable to report anything.
If you are unable to rerun, and don't mind that you may be missing records, you can run recovery on your per RG bams. That should truncate them at the last valid BGZF block, preserving as much of the BAM as it can figure out. This tool was written to help us recover some of our BAM files that were corrupted by our filesystem in the past.
But as I said, using recover will leave your BAMs missing records. I think the "best" thing to do is rerun.
Mary Kate