modification of WGS data with Picard
1
0
Entering edit mode
7.1 years ago
boymin2020 ▴ 80

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.

WGS picard • 1.5k views
ADD COMMENT
1
Entering edit mode
7.1 years ago

your bam file is not sorted on coordinate (or is wrongly sorted)

check

samtools view -H your.bam | head -n 1

you should see something like:

@HD VN:1.5  GO:none SO:coordinate
ADD COMMENT
0
Entering edit mode

It displayed the following line: @HD VN:1.5 SO:unsorted

ADD REPLY
1
Entering edit mode
SO:unsorted

sort you bam...

ADD REPLY

Login before adding your answer.

Traffic: 1356 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6