Question: Issue of using freebayes to do the variant calling
0
gravatar for jz6002
4.6 years ago by
jz600210
Canada
jz600210 wrote:

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 • 3.2k views
ADD COMMENTlink written 4.6 years ago by jz600210

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

ADD REPLYlink modified 4.6 years ago • written 4.6 years ago by Adrian Pelin2.3k

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

 

ADD REPLYlink written 4.6 years ago by jz600210

Sorry, I shouldnt have omitted it, typo. I corrected answer.

ADD REPLYlink written 4.6 years ago by Adrian Pelin2.3k

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 REPLYlink modified 4.6 years ago • written 4.6 years ago by jz600210
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: 1686 users visited in the last hour