The latest test result shows that Picard can handle our whole individual WGS bam file. Because GATK is strict with the head information of bam file and the original bam files lack SM in @RG, I added it using the AddOrReplaceReadGroups function of Picard and succeeded.
Then I also successfully used the reorderSam function of Picard to sort the above new bam file. What is notable is that the CREATE_INDEX=TRUE option was used in that script, but no .bai file was generated.
As the .bai file is necessary before GATK procedure, I tried to use the BuildBamIndex function of Picad to build the bai file but failed. The following is the error message: Exception in thread "main" htsjdk.samtools.SAMException: Input bam file must be sorted by coordinate at picard.sam.BuildBamIndex.doWork(BuildBamIndex.java:144) at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:209) at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:95) at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:105) Thanks for any advice.
It displayed the following line: @HD VN:1.5 SO:unsorted
sort you bam...