Question: BED to BAM tool error
1
gravatar for jm.keith
21 months ago by
jm.keith60
jm.keith60 wrote:

Hi, I'm trying to convert from BED to BAM using Galaxy, but though the tool runs fine, I get an error which makes the file unusable. I am using sorted BED files.

First 6 lines of my bed file:

Chrom   Start   End         Name                                  Score Strand  
chr1    12634845    12634885    HWI-ST1365:57:C1V5AACXX:1:2105:13323:121743 255 -
chr1    12634846    12634886    HWI-ST1365:57:C1V5AACXX:1:2102:3391:61106   255 +
chr1    12634846    12634886    HWI-ST1365:57:C1V5AACXX:1:2302:7595:70795   255 -
chr1    12634847    12634887    HWI-ST1365:57:C1V5AACXX:1:2301:5626:107512  255 -
chr1    12634850    12634890    HWI-ST1365:57:C1V5AACXX:1:1303:5150:55453   255 -
chr1    12634852    12634892    HWI-ST1365:57:C1V5AACXX:1:1306:7619:104639  255 -

This is the error:

 [bam_index_core] the alignment is not sorted (HWI-ST1365:57:C1V5AACXX:2:2301:15601:133048): 55116-th chr > 3056-th chr [bam_index_build2] fail to index the BAM file.

I would appreciate any suggestions on how to fix this as I need BAM file format to continue.

bedtools bam • 780 views
ADD COMMENTlink modified 21 months ago • written 21 months ago by jm.keith60
2

It seems like something is wrong with your BED file. The error suggests that there are > 55000 chromosomes, which is incredibly unlikely. My guess is that the name and chrom columns of your BED file are swapped in Galaxy.

As an aside, your BED file was made from a BAM file, so why not just use the original file?

ADD REPLYlink written 21 months ago by Devon Ryan1.9k
1

Agree, checking the metadata for datasets is a good idea when errors come up (I checked and your data is correct).

The genome input file will still need to be correct - as explained in my other reply below. Even if you use the original BAM input instead.

ADD REPLYlink modified 21 months ago • written 21 months ago by Jennifer Hillman Jackson25k
1
gravatar for Jennifer Hillman Jackson
21 months ago by
United States
Jennifer Hillman Jackson25k wrote:

Hello,

Sort order is not the root problem. The error is produced due to an unexpected input file format (the genome file).

The genome file to use is a tabular file of two columns: chromosome-name and chromosome-length. For mm9, this can be obtained from the UCSC Table browser (Get Data -> UCSC Main). The file to get is named chromInfo. Specifically, on the Table browser form, set the genome to be mm9, then set to view "all tables". The chromInfo file will be in the list and can be directly sent to Galaxy.

Also discussed here: https://groups.google.com/forum/#!topic/bedtools-discuss/1SRVMJcBuTk

Hope this helps! Jen, Galaxy team

ADD COMMENTlink written 21 months ago by Jennifer Hillman Jackson25k
0
gravatar for jm.keith
21 months ago by
jm.keith60
jm.keith60 wrote:

Hello to both, Thanks for the assist. I tried to rerun with the correct genome file (thanks), but I still get the same error. This file is a bed file of filtered reads that I'm trying to use to build a heatmap. Thus the reason I can't use the original BAM file.

Any other suggestions are appreciated.

Many thanks, julia

ADD COMMENTlink written 21 months ago by jm.keith60

Hi Julia, Did you try re-sorting the inputs? This is how: https://github.com/jennaj/support-prior-qa/wiki/Sort-your-inputs

ADD REPLYlink modified 21 months ago • written 21 months ago by Jennifer Hillman Jackson25k
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 16.09
Traffic: 175 users visited in the last hour