# bam filter losing metadata

**URL:** https://help.galaxyproject.org/t/bam-filter-losing-metadata/1065
**Category:** usegalaxy.org support
**Tags:** workflow
**Created:** [April 11, 2019, 4:26pm UTC](https://help.galaxyproject.org/t/bam-filter-losing-metadata/1065 "2019-04-11T16:26:12Z")
**Posts on this page:** 1
**Showing post:** 2

<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: [April 15, 2019, 11:45pm UTC](https://help.galaxyproject.org/t/bam-filter-losing-metadata/1065/2 "2019-04-15T23:45:29Z")

</div>

Welcome @bobloblog!

The tool `Map with BWA for Illumina (Galaxy Version 1.2.3)` is deprecated and only outputs `SAM` data (that is not coordinate sorted). However, the next step of your workflow has the option for `BAM` input set (coordinate sorting is required for this datatype to be assigned). The mismatched datatype/sort order is likely where the problem comes up.

Try swapping out the older/deprecated version of the tool for the latest version in your workflow: `Map with BWA - map short reads (< 100 bp) against reference genome (Galaxy Version 0.7.17.4)`. It will output `BAM` data that will work better, and avoid errors, with most other tools. This output format will also consume much less space in your account.

_Alternative_: The following is not recommended but is an option, if you really need to use the older BWA tool for some reason: Add in another one or two steps to your workflow, after mapping, and before downstream tools, to create proper inputs. Just using `SAM-to-BAM` might work, or you might need to run both `SortSam` (with default settings for a coordinate sort) then `SAM-to-BAM`.

ps: Next time you want to feedback for a workflow, please generate a share link and post that back (instead of screenshots). This is how: [Sharing and Publishing your work](https://galaxyproject.org/learn/share/). Including the exact error message presented in the interface in your post will also help if you want troubleshooting assistance from the community (error resulting from a workflow or not).

If you haven’t seen the troubleshooting help yet, please see: [Troubleshooting resources for errors or unexpected results](https://help.galaxyproject.org/t/troubleshooting-resources-for-errors-or-unexpected-results/42)

Thanks!

---

_[View the full topic](https://help.galaxyproject.org/t/bam-filter-losing-metadata/1065)._
