Question: modification of WGS data with Picard
0
gravatar for boymin2020
2.1 years ago by
boymin202020
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(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.

picard wgs • 689 views
ADD COMMENTlink modified 2.1 years ago by Pierre Lindenbaum118k • written 2.1 years ago by boymin202020
1
gravatar for Pierre Lindenbaum
2.1 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum118k wrote:

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 COMMENTlink written 2.1 years ago by Pierre Lindenbaum118k

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

ADD REPLYlink written 2.1 years ago by boymin202020
1
SO:unsorted

sort you bam...

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

Help
Access

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