# Mapping failed because of application errors

**URL:** <https://community.brain-map.org/t/mapping-failed-because-of-application-errors/2657>\
**Category:** MapMyCells\
**Created:** [October 20, 2023, 4:54am UTC](https://community.brain-map.org/t/mapping-failed-because-of-application-errors/2657 "2023-10-20T04:54:22Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![alleny](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@alleny](https://community.brain-map.org/u/alleny)\
**Post date:** [October 20, 2023, 4:54am UTC](https://community.brain-map.org/t/mapping-failed-because-of-application-errors/2657/1 "2023-10-20T04:54:22Z")

</div>

Hi! I am really excited to use this tool but have been encountering issues at the last stage of the analysis and receiving a “Mapping Failed. Mapping algorithm failed because of application errors.”  
Here is the requested info:

- Operating system and web browser: Windows 11 and Chrome
- Run ID: 1697776005895-695f859a-5df9-4a1e-8fab-97eb3aab835e
- Information on the data: This is mouse snRNAseq data generated using a combinatorial indexing approach (sciRNAseq). The minimal h5ad was generated in R with just the cell-by-gene table. Column names are ENSEMBL IDs (e.g. ENSMUSG00000051951) and row names are cell barcodes. The AnnData object n\_obs x n\_vars = 50000 x 22004 with a total size of 327.4MB.
- Instructions on how to reproduce the issue: I uploaded the h5ad to the site and am using the 10x Whole Mouse Brain as the reference taxonomy and hierarchical mapping as the mapping algorithm. The job proceeds through ‘input file validation’ and ‘algorithm run’, but errors during the ‘Mapping completed’ step.  
Any suggestions would be greatly appreciated! Thanks.

---

<div class="post-metadata">

**Author:** ![danielsf](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/danielsf/32/209_2.png) [@danielsf](https://community.brain-map.org/u/danielsf)\
**Post date:** [October 20, 2023, 3:35pm UTC](https://community.brain-map.org/t/mapping-failed-because-of-application-errors/2657/2 "2023-10-20T15:35:53Z")

</div>

Hi,

It looks like your h5ad file contains negative gene expression values (minimum value is -7). This is a problem for our algorithm as we assume that the inputs are raw counts which we then convert to log2(counts per million + 1). Obviously, the log2 is not going to handle -7 very well.

Hope this isn’t an absolute show stopper for you.

Cheers,

Scott Daniel

---

<div class="post-metadata">

**Author:** ![alleny](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@alleny](https://community.brain-map.org/u/alleny)\
**Post date:** [October 20, 2023, 10:35pm UTC](https://community.brain-map.org/t/mapping-failed-because-of-application-errors/2657/3 "2023-10-20T22:35:35Z")

</div>

Thanks for catching that. I fixed it and got it work, thanks for your help!

---

<div class="post-metadata">

**Author:** ![Sumira83](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/sumira83/32/2017_2.png) [@Sumira83](https://community.brain-map.org/u/Sumira83)\
**Post date:** [November 18, 2024, 12:03am UTC](https://community.brain-map.org/t/mapping-failed-because-of-application-errors/2657/4 "2024-11-18T00:03:26Z")

</div>

I am also very excited about using this tool but seem to be experiencing a similar issue. The Run ID is 1731885286215-b912ca5e-bfd3-475d-9c70-eba3fddf5fa2. Does anyone have any advice/suggestions? Thanks in advance for any help!

---

<div class="post-metadata">

**Author:** ![danielsf](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/danielsf/32/209_2.png) [@danielsf](https://community.brain-map.org/u/danielsf)\
**Post date:** [November 18, 2024, 4:22pm UTC](https://community.brain-map.org/t/mapping-failed-because-of-application-errors/2657/5 "2024-11-18T16:22:55Z")

</div>

@Sumira83

Your job failed for a different reason. I am going to open a new thread where we can discuss it specifically. This should make it easier for people with errors like yours to find our conversation. I will post a link to the new conversation here shortly.

---

<div class="post-metadata">

**Author:** ![danielsf](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/danielsf/32/209_2.png) [@danielsf](https://community.brain-map.org/u/danielsf)\
**Post date:** [November 18, 2024, 4:25pm UTC](https://community.brain-map.org/t/mapping-failed-because-of-application-errors/2657/6 "2024-11-18T16:25:28Z")

</div>

@Sumira83

Here is where I have moved the conversation surrounding the error you encountered.

> [@Malformed input h5ad file](https://community.brain-map.org/t/malformed-input-h5ad-file/3863):
>
> @Sumira83 The error message associated with your failed run is “The ‘X’ field in this h5ad file lacks the ‘encoding-type’ metadata field. That field is necessary for this software to determine if this data is stored as a sparse or dense matrix. Please see the anndata specification here\n[On-disk format — anndata 0.11.1.dev11+g2602e5b documentation](https://anndata.readthedocs.io/en/latest/fileformat-prose.html)” May I ask: with what library/piece of software did you create your h5ad file? If the answer is the python anndata library, what version of anndata …

---

<div class="post-metadata">

**Author:** ![RebecaO](https://avatars.discourse-cdn.com/v4/letter/r/f6c823/32.png) [@RebecaO](https://community.brain-map.org/u/RebecaO)\
**Post date:** [November 18, 2024, 9:56pm UTC](https://community.brain-map.org/t/mapping-failed-because-of-application-errors/2657/7 "2024-11-18T21:56:08Z")

</div>

Hi! I am experiencing some issues too, I am not sure what I have to check. Any advice or guidance is highly appreciated! Thanks!  
This is the Run ID: 1731966422975-f370b2ca-fb7c-49ca-8b2b-dc4712a238bd

---

<div class="post-metadata">

**Author:** ![danielsf](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/danielsf/32/209_2.png) [@danielsf](https://community.brain-map.org/u/danielsf)\
**Post date:** [November 18, 2024, 10:27pm UTC](https://community.brain-map.org/t/mapping-failed-because-of-application-errors/2657/8 "2024-11-18T22:27:10Z")

</div>

@RebecaO

You have the same error that Sumira83 has. Your h5ad file is missing a metadata field that, according to the anndata documentation, is supposed to be present in all h5ad files.

What software/tool did you use to create your h5ad file?

---

<div class="post-metadata">

**Author:** ![danielsf](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/danielsf/32/209_2.png) [@danielsf](https://community.brain-map.org/u/danielsf)\
**Post date:** [November 18, 2024, 10:49pm UTC](https://community.brain-map.org/t/mapping-failed-because-of-application-errors/2657/9 "2024-11-18T22:49:41Z")

</div>

For anyone else who finds this thread, I just want to call out [this post](https://community.brain-map.org/t/mapmycells-troubleshooting-guide/2639/2), which shows how to download the failure log from a failed MapMyCells job. That wouldn’t have helped much in the cases above (the error is still pretty in-the-weeds), but for more anodyne errors, it might help get users unstuck without having to wait for a back-and-forth on this forum.

---

<div class="post-metadata">

**Author:** ![RebecaO](https://avatars.discourse-cdn.com/v4/letter/r/f6c823/32.png) [@RebecaO](https://community.brain-map.org/u/RebecaO)\
**Post date:** [November 22, 2024, 10:23pm UTC](https://community.brain-map.org/t/mapping-failed-because-of-application-errors/2657/10 "2024-11-22T22:23:54Z")

</div>

I am working on R, but I’ll work on that! Thanks for letting me know how to download the failure log.

---

<div class="post-metadata">

**Author:** ![danielsf](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/danielsf/32/209_2.png) [@danielsf](https://community.brain-map.org/u/danielsf)\
**Post date:** [November 25, 2024, 6:00pm UTC](https://community.brain-map.org/t/mapping-failed-because-of-application-errors/2657/11 "2024-11-25T18:00:53Z")

</div>

@RebecaO  
If I ask “what library in R did you use to create the `.h5ad` file?” is there a succinct answer? Again: just curious

---

<div class="post-metadata">

**Author:** ![RebecaO](https://avatars.discourse-cdn.com/v4/letter/r/f6c823/32.png) [@RebecaO](https://community.brain-map.org/u/RebecaO)\
**Post date:** [December 4, 2024, 12:38am UTC](https://community.brain-map.org/t/mapping-failed-because-of-application-errors/2657/12 "2024-12-04T00:38:08Z")

</div>

Hi Daniel, the function in the code I used is `writeH5AD()` from the `zellkonverter` package.

---

<div class="post-metadata">

**Author:** ![danielsf](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/danielsf/32/209_2.png) [@danielsf](https://community.brain-map.org/u/danielsf)\
**Post date:** [February 26, 2025, 11:04pm UTC](https://community.brain-map.org/t/mapping-failed-because-of-application-errors/2657/13 "2025-02-26T23:04:11Z")

</div>

In case anyone is still following this thread: we have pushed an update to the MapMyCells code that will allow it to infer the missing metadata fields from the data in the file itself. The failed mappings reported by @Sumira83 and @RebecaO should pass now. Sorry this took so long.
