# BWA-MEM results in "An error occurred setting metadata for this dataset"

**URL:** <https://help.galaxyproject.org/t/bwa-mem-results-in-an-error-occurred-setting-metadata-for-this-dataset/449>\
**Category:** usegalaxy.org support\
**Tags:** metadata, mapping\
**Created:** [January 15, 2019, 5:13am UTC](https://help.galaxyproject.org/t/bwa-mem-results-in-an-error-occurred-setting-metadata-for-this-dataset/449 "2019-01-15T05:13:34Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![raoof\_14](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@raoof\_14](https://help.galaxyproject.org/u/raoof_14)\
**Post date:** [January 15, 2019, 5:13am UTC](https://help.galaxyproject.org/t/bwa-mem-results-in-an-error-occurred-setting-metadata-for-this-dataset/449/1 "2019-01-15T05:13:34Z")

</div>

i was running wheat genome reference to create BAM file using BWA\_MEM . it was running smoothly  
but out file was 34.3 MB and the finaly error message was surfaced reading as:  
**An error occurred setting the metadata for this dataset Set it manually or retry auto-detection**

---

<div class="post-metadata">

**Author:** ![jennaj](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/jennaj/32/27_2.png) [@jennaj](https://help.galaxyproject.org/u/jennaj)\
**Post date:** [January 15, 2019, 3:50pm UTC](https://help.galaxyproject.org/t/bwa-mem-results-in-an-error-occurred-setting-metadata-for-this-dataset/449/2 "2019-01-15T15:50:33Z")

</div>

A few more details would help, thanks!

1. Where are you using Galaxy? public URL? your own server (version)?
2. If your own server, is this the first time you have run BWA-MEM?
3. Is the wheat genome already indexed or are you using it as a custom genome?
4. If a custom genome, this the first time you have executed BWA-MEM with it?

---

<div class="post-metadata">

**Author:** ![jennaj](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/jennaj/32/27_2.png) [@jennaj](https://help.galaxyproject.org/u/jennaj)\
**Post date:** [January 16, 2019, 12:41am UTC](https://help.galaxyproject.org/t/bwa-mem-results-in-an-error-occurred-setting-metadata-for-this-dataset/449/3 "2019-01-16T00:41:48Z")

</div>

How to troubleshoot this type of problem in general

1. Click on the link inside the dataset to re-detect [metadata](https://galaxyproject.org/support/metadata/). In many cases, this will clear up the problem.

2. Check if the results are empty. Example: BAM results that have no data lines, only header lines.

- Double check that the intended target genome was actually mapped against. Use the rerun or job details buttons to review the original genome selected, modify if incorrect, and rerun.
- If using a [custom genome](https://galaxyproject.org/learn/custom-genomes/), is it formatted correctly?
- Review [quality metrics for fastq inputs](https://galaxyproject.org/tutorials/ngs/) with the tool `FastQC` and address content issues.
- Review the tool settings and online manuals. Does your data meet the minimum mapping criteria set by the parameters used? Is the tool appropriate for your datatype (spliced versus unspliced)? Adjust as needed. Most tool form options for most Galaxy tools are the same as when using a tool line-command.

1. Test for server-side problems.

- Try at least one re-run to see if that resolves the problem (transient server/cluster issues).
- Is the tool marked as deprecated (public Galaxy server)? If so, choose an alternative tool that is not. See the [Galaxy Tutorials](https://galaxyproject.github.io/training-material/) if you are not sure of alternatives.
- Low memory resources (server/cluster that runs the jobs, different from account quota disk space) and related technical issues are possible.
  - When running your own Galaxy, review the admin logs, disk space where you write outputs, etc.
  - When using a public Galaxy server, contact the admins by email or through a bug report. Contact information is usually on the home page of a public server and often also here: [https://galaxyproject.org/use](https://galaxyproject.org/use)
  - Problems at a usegalaxy.\* server can be reported at this forum. Specify which server by URL with your question.

Full help: [Troubleshooting resources for errors or unexpected results](https://help.galaxyproject.org/t/troubleshooting-resources-for-errors-or-unexpected-results/42)

---

<div class="post-metadata">

**Author:** ![raoof\_14](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@raoof\_14](https://help.galaxyproject.org/u/raoof_14)\
**Post date:** [January 16, 2019, 5:13am UTC](https://help.galaxyproject.org/t/bwa-mem-results-in-an-error-occurred-setting-metadata-for-this-dataset/449/4 "2019-01-16T05:13:01Z")

</div>

I am using public URL ,custom wheat genome and and i am usinf BWA MEM first time.  
thanks…for ur response

---

<div class="post-metadata">

**Author:** ![jennaj](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/jennaj/32/27_2.png) [@jennaj](https://help.galaxyproject.org/u/jennaj)\
**Post date:** [January 16, 2019, 3:48pm UTC](https://help.galaxyproject.org/t/bwa-mem-results-in-an-error-occurred-setting-metadata-for-this-dataset/449/5 "2019-01-16T15:48:00Z")

</div>

Could you share the exact URL for the public server? Thanks!

---

<div class="post-metadata">

**Author:** ![raoof\_14](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@raoof\_14](https://help.galaxyproject.org/u/raoof_14)\
**Post date:** [January 16, 2019, 6:23pm UTC](https://help.galaxyproject.org/t/bwa-mem-results-in-an-error-occurred-setting-metadata-for-this-dataset/449/6 "2019-01-16T18:23:46Z")

</div>

[https://usegalaxy.org](https://usegalaxy.org)

---

<div class="post-metadata">

**Author:** ![jennaj](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/jennaj/32/27_2.png) [@jennaj](https://help.galaxyproject.org/u/jennaj)\
**Post date:** [January 16, 2019, 9:04pm UTC](https://help.galaxyproject.org/t/bwa-mem-results-in-an-error-occurred-setting-metadata-for-this-dataset/449/7 "2019-01-16T21:04:04Z")

</div>

Thanks for clarifying.

I reviewed the datasets with a metadata problem and all looks Ok technically.

**Did you try clicking on the link to re-autodetect the metadata?** That should be enough to resolve the problem.

That said, I see Stringtie jobs in your history. If the reads are RNA-seq, then you’ll want to use a spliced mapper like HISAT2 (instead of BWA). The custom reference genome also should be reformatted before using it with downstream tools – it contains description line content on the title lines ("\>" lines) that will cause problems when using it along with the matched reference annotation. Please see the Tutorial and FAQ links above for the how-to for all of this.

---

<div class="post-metadata">

**Author:** ![raoof\_14](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@raoof\_14](https://help.galaxyproject.org/u/raoof_14)\
**Post date:** [January 17, 2019, 5:03am UTC](https://help.galaxyproject.org/t/bwa-mem-results-in-an-error-occurred-setting-metadata-for-this-dataset/449/8 "2019-01-17T05:03:19Z")

</div>

Thanks sir. i will try it and update you sir accordingly.

---

<div class="post-metadata">

**Author:** ![raoof\_14](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@raoof\_14](https://help.galaxyproject.org/u/raoof_14)\
**Post date:** [January 17, 2019, 5:05am UTC](https://help.galaxyproject.org/t/bwa-mem-results-in-an-error-occurred-setting-metadata-for-this-dataset/449/9 "2019-01-17T05:05:06Z")

</div>

I think as the reference genome of wheat is large genome,so there is memory allocation problem…is any solution to handle wheat genome.

---

<div class="post-metadata">

**Author:** ![frederikcoppens](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/frederikcoppens/32/168_2.png) [@frederikcoppens](https://help.galaxyproject.org/u/frederikcoppens)\
**Post date:** [January 21, 2019, 2:12pm UTC](https://help.galaxyproject.org/t/bwa-mem-results-in-an-error-occurred-setting-metadata-for-this-dataset/449/10 "2019-01-21T14:12:39Z")

</div>

I assume this is similar to a problem we’ve recently had: pysam is not able to handle the large chromosomes of wheat. To index the BAM file, it can only handle contigs (chromosomes) of max 512MB. The solution provided by the wheat consortium is that they split the large chromosomes.

---

<div class="post-metadata">

**Author:** ![jennaj](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/jennaj/32/27_2.png) [@jennaj](https://help.galaxyproject.org/u/jennaj)\
**Post date:** [January 21, 2019, 4:21pm UTC](https://help.galaxyproject.org/t/bwa-mem-results-in-an-error-occurred-setting-metadata-for-this-dataset/449/11 "2019-01-21T16:21:10Z")

</div>

> [@frederikcoppens](#):
>
> To index the BAM file, it can only handle contigs (chromosomes) of max 512MB.

Agree, the problem is rooted in memory/resource issues.
