Map with BWA-MEM problem - An error occurred with this dataset: bam format

Hello everyone. I am trying to map a pair of sequences from whole genome sequencing to a custom reference genome, which I uploaded in fna (fasta) format. When I run Map with BWA-MEM, it stops while building the bwa-index, on the following step: [bwa_index] Construct SA from BWT and Occ…0.27. It says: “An error occurred with this dataset: bam format, dataset”

Any ideas on where the problem may be originating from?

Thanks!

Welcome, @clommar

It seems BWA-MEM had trouble writing out the final BAM result. It is hard to guess more … but maybe the issue is with the custom reference genome?

We have a guide that explains some general guidelines for the format, and how it is used. Please see → https://training.galaxyproject.org/training-material/faqs/galaxy/reference_genomes_custom_genomes.html

If after checking, you cannot figure out what is going wrong, we can certainly try to help here more! We would be interested in the details under the i icon. BWA-MEM will sometimes report another message here.

We can help to “decode” the message. We will need some details – please see the banner at this forum, or here directly for how to share your work in context. → How to get faster help with your question

Please let us know how this works out, even if you solve it yourself! :scientist:

Hi Jenna,

Thanks for your answer, I finally got to run BWA-MEM succesfully! The problem I could identify was that I was trying to align a pair of sequences which had not the same length, as I had trimmered the R2 in the quality step. Once I ran the alignment with the sequences processed just to remove sequencing adapters but not applying any trimmering it finished with no errors.

1 Like

Hi @clommar

The problem was likely that you were missing one of the ends of a read pair after doing more QA. Some of the options will require that both ends are present. Next time, you can decide to filter out both ends of a pair if one of the ends fails the extra QA (such as trimming) or becomes too short to map. Some of the QA tools can do this while trimming, or you can do this after as a separate step.

The result of “properly paired mapped reads” would probably be the same either way, and you could test that to confirm.

Anyway, I’m glad to know you were able to get this to work! :slight_smile: :scientist: :rocket: