Error when using Bedtools fisher on sorted bed files
1
1
Entering edit mode
8.9 years ago
AB ▴ 360

Hi Everyone,

I am doing a ChIP-Seq analysis on a small dataset of 6 samples (Wild-type and knockout having 3 replicates each). I wanted to run a Fisher exact test using bedtools. My bed files are all sorted. But I am getting this error.

Error: Sorted input specified, but the file /Users/xxx/narrowPeak/531-sorted.bed has the following record with a different sort order than the genomeFile /Applications/bedtools2/genomes/mouse.mm9.genome

What does this mean and how do I fix this ?

Thank you

ChIP-Seq bedtools fisher test • 5.5k views
ADD COMMENT
1
Entering edit mode

check that the order of the chromosome names and the order of your sort is the same as in the genome.

ADD REPLY
1
Entering edit mode
4.0 years ago

I too have had this problem- but what has helped me is to sort the mm9.genome file with the same code as in the case of the actual bed files:

sort -k1,1 mouse.mm9.genome > sorted_mouse.mm9.genome
sort -k1,1 -k2,2n a.bed > a_sorted.bed
sort -k1,1 -k2,2n b.bed > b_sorted.bed
bedtools fisher -a a_sorted.bed -b b_sorted.bed -g sorted_mouse.mm9.genome
ADD COMMENT

Login before adding your answer.

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