Issue of using freebayes to do the variant calling
0
0
Entering edit mode
9.2 years ago
jz6002 ▴ 10

Hi, this is my first time to use freebayes. I met a problem when I tried to use it to do the variant calling for 2 samples together.

I just use the command

freebayes -f ref.fasta a.bam b.bam > c.vcf.

Then, I got the error msg as : mismatched sort order in b.bam, expected unsorted, but found coordinate. Does this mean it expected b.bam to be unsorted?

I followed the manual , all the bam files have been sorted, marked duplicates, added read groups, reordered and indexed.

The way I used to get the bam files for freebayes are:

  1. use TMAP to get the .sam file
  2. use samtools to convert sam file to bam file
  3. use samtools to sort the bam file
  4. use samtools to remove duplicates
  5. use bamaddrg to add read group
  6. use picard to reorder the bam file
  7. use samtools to sort the reordered bam file
  8. use samtools to index the sorted reordered bam file

Then, I use the freebayes to do the calling for two files and got the above error.

Can anyone give me some suggestions?

Thank you

freebayes • 5.2k views
ADD COMMENT
0
Entering edit mode

Try 1, 2 3, 5, 4, 8 and freebayes.

ADD REPLY
0
Entering edit mode

But in the manual of freebayes, they suggested to remove the duplicates. Why skip this step? Thank you.

ADD REPLY
0
Entering edit mode

Sorry, I shouldn't have omitted it, typo. I corrected answer.

ADD REPLY
0
Entering edit mode

I have followed your suggested steps, got the same error:

ERROR(freebayes): Could not open input BAM files
BamMultiReader::Open: unable to open inconsistent files:
BamMultiReader::ValidateReaders: mismatched sort order in b.bam, expected unsorted, but found coordinate.

Is freebayes able to analysis bam files of different samples together?

ADD REPLY

Login before adding your answer.

Traffic: 2849 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