Question: modification of WGS data with Picard
gravatar for boymin2020
2.8 years ago by
boymin202020 wrote:

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( at picard.cmdline.CommandLineProgram.instanceMain( at picard.cmdline.PicardCommandLine.instanceMain( at picard.cmdline.PicardCommandLine.main( Thanks for any advice.

picard wgs • 843 views
ADD COMMENTlink modified 2.8 years ago by Pierre Lindenbaum124k • written 2.8 years ago by boymin202020
gravatar for Pierre Lindenbaum
2.8 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum124k wrote:

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


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

you should see something like:

@HD VN:1.5  GO:none SO:coordinate
ADD COMMENTlink written 2.8 years ago by Pierre Lindenbaum124k

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

ADD REPLYlink written 2.8 years ago by boymin202020

sort you bam...

ADD REPLYlink modified 2.8 years ago • written 2.8 years ago by Pierre Lindenbaum124k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1162 users visited in the last hour