# Custom genome help and troubleshooting plus where to find HISAT2 alignment statistics

**URL:** <https://help.galaxyproject.org/t/custom-genome-help-and-troubleshooting-plus-where-to-find-hisat2-alignment-statistics/2390>\
**Category:** Uncategorized\
**Tags:** custom-genome, custom-build\
**Created:** [October 29, 2019, 9:36pm UTC](https://help.galaxyproject.org/t/custom-genome-help-and-troubleshooting-plus-where-to-find-hisat2-alignment-statistics/2390 "2019-10-29T21:36:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhwdong9](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/zhwdong9/32/1031_2.png) [@zhwdong9](https://help.galaxyproject.org/u/zhwdong9)\
**Post date:** [October 29, 2019, 9:36pm UTC](https://help.galaxyproject.org/t/custom-genome-help-and-troubleshooting-plus-where-to-find-hisat2-alignment-statistics/2390/1 "2019-10-29T21:36:30Z")

</div>

I have put the download papAnu.fa to history as my reference genome, but why it does not work when I do hisat2 for alignment with other fastq files

---

<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:** [October 30, 2019, 6:45pm UTC](https://help.galaxyproject.org/t/custom-genome-help-and-troubleshooting-plus-where-to-find-hisat2-alignment-statistics/2390/2 "2019-10-30T18:45:22Z")

</div>

Welcome @zhwdong9

Are you sourcing the `papAnu2` or `papAnu4` genome from UCSC?

[http://hgdownload.soe.ucsc.edu/downloads.html#baboon](http://hgdownload.soe.ucsc.edu/downloads.html#baboon)

Make certain that you get the fasta version of the genome. For `papAnu4`, this would be: [Index of /goldenPath/papAnu4/bigZips](http://hgdownload.soe.ucsc.edu/goldenPath/papAnu4/bigZips/) \>\> papAnu4.fa.gz (soft-masked version, but the hard-masked is also available).

This particular data does not need to be reformatted through `NormalizeFasta` as in the first FAQ listed below states (will already be formatted correctly from this source). But you should load it in the `Upload` tool without setting a “datatype”. Allow Galaxy to uncompress the data and assign the final datatype (will be “fasta”).

FAQs: [Galaxy Support - Galaxy Community Hub](https://galaxyproject.org/support)

- [Preparing and using a Custom Reference Genome or Build](https://galaxyproject.org/learn/custom-genomes/)
- [Mismatched Chromosome identifiers (and how to avoid them)](https://galaxyproject.org/support/chrom-identifiers/)
- [Extended Help for Differential Expression Analysis Tools](https://galaxyproject.org/support/diff-expression/)

Also, click on the tags I added for more help/prior Q&A for various related issues end users have had when first learning how to work with Custom Genomes/Builds. Some of these may inform you about how to resolve your problem.

However, if none of that helps, please share more information:

1. Try at least one rerun to eliminate transient server/cluster issues. Let us know if the job fails again (and how/why) – and if you confirmed that the genome fasta is intact (fully loaded) and has the correct datatype assigned.
2. Where are you working? Public Galaxy (URL)? Your own Galaxy?
3. How does the job fail?
  - Review the contents of the “bug” icon report (it does not need to be submitted, but if you do, include a link to this post for context).
  - Click into the “i” icon for job details and review the `stderr` and `stdout` reports. These often explain exactly what the problem is.

For reference, many Galaxy Tutorials from the GTN include the tool `HISAT2`. Start with those in the group “Transcriptomics”:

> [@Troubleshooting resources for errors or unexpected results](https://help.galaxyproject.org/t/troubleshooting-resources-for-errors-or-unexpected-results/42/1):
>
> [Galaxy Training Network Tutorials](https://training.galaxyproject.org): Some [GTN](https://galaxyproject.org/teach/gtn/) tutorials are appropriate for [Galaxy Main](https://usegalaxy.org) and some are not. Where you can run each is noted per tutorial – click on the _Galaxy instances_ gear icon ![galaxyserversGTN](https://us1.discourse-cdn.com/flex020/uploads/galaxy/original/1X/1287f50cfcdaa1aad750fe323f96995260ac4947.png) to review the [Public Galaxy](https://galaxyproject.org/use/) server choices. If a tutorial is supported by a pre-configured [Galaxy Docker](https://hub.docker.com/r/bgruening/galaxy-stable/) training image, instructions for how to get it will be listed below the tutorial listings, per category.

Thanks!

---

<div class="post-metadata">

**Author:** ![zhwdong9](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/zhwdong9/32/1031_2.png) [@zhwdong9](https://help.galaxyproject.org/u/zhwdong9)\
**Post date:** [October 30, 2019, 9:02pm UTC](https://help.galaxyproject.org/t/custom-genome-help-and-troubleshooting-plus-where-to-find-hisat2-alignment-statistics/2390/3 "2019-10-30T21:02:10Z")

</div>

Thank you, I will try it again

---

<div class="post-metadata">

**Author:** ![zhwdong9](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/zhwdong9/32/1031_2.png) [@zhwdong9](https://help.galaxyproject.org/u/zhwdong9)\
**Post date:** [October 30, 2019, 11:26pm UTC](https://help.galaxyproject.org/t/custom-genome-help-and-troubleshooting-plus-where-to-find-hisat2-alignment-statistics/2390/4 "2019-10-30T23:26:59Z")

</div>

I did it like jennaj ever mentioned, but why the result did not show how many reads and the alignment rate. If I used the build-in genome (papAnu2) then ran hisat 2, I can get all the information.

---

<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:** [October 31, 2019, 1:17am UTC](https://help.galaxyproject.org/t/custom-genome-help-and-troubleshooting-plus-where-to-find-hisat2-alignment-statistics/2390/5 "2019-10-31T01:17:37Z")

</div>

Hi @zhwdong9

The statistics are there, for every `HISAT2` run by default. But if for some reason there were many “warnings” or processing details, the statistic report will be after those lines, and you won’t see it in the expanded dataset view. Only the first few lines of `stderr` are captured here, as a “peek” view.

Technically, the underlying `HISAT2` tool reports the alignment statistics in a part of the job output named `stderr`. That’s just how this particular tool works, and it doesn’t necessarily indicate that there was an actual error/problem even though the name of that output includes “err” (abbreviation for “error”) in it. All tools have a `stdout` and `stderr` output by default, although not all tool authors report meaningful data in those places. The Galaxy wrapper around a tool can capture and (sometimes) reformat or add more information to the default `stdout` and/or `stderr` to provide more details. And some tool wrappers, like this one, have an option to report the interesting parts of those metadata as a distinct dataset in your history (just the statistics).

**How to review the full `stderr` message (any tool).**

For `HISAT2`, this is where the alignment statistics are captured (at the end, any content above it is worth reviewing but doesn’t necessarily mean that anything went wrong. In my example, the warnings are simply informing that there were some very short reads in my `fastqsanger` inputs. Too short for the tool to map. A few of these kinds of warnings not unusual – but if my reads didn’t map well overall, could explain one reason why (perhaps QA was too aggressive or the data was not of high quality originally).

A job’s `stdout` can also be reviewed this way. Plus, this is a method to review the tool parameters originally set/submitted in a simplified format (scroll further into the report than what is shown in the graphics below to find this information). This is a very useful report to learn how to review, and not only when something goes wrong (error or unexpected results).

1. Expand the result bam dataset and click on the “View details” icon. This example happens to have too many warnings to show the statistics, and is probably similar to one of your jobs.

 ![hisat2-review-alignments-in-stderr-1](https://us1.discourse-cdn.com/flex020/uploads/galaxy/original/2X/9/907f5a05e7ad036c0870727ea11c0f2c7e40278d.png)

1. The “Job details” report will display in the center pane. Locate and click on the link to the `stderr` output.

 ![hisat2-review-alignments-in-stderr-2](https://us1.discourse-cdn.com/flex020/uploads/galaxy/original/2X/6/6c25da7e586c3666fb8b2e71d6a7f0886c7307d8.png)

1. On the `stdout` report, scroll down past the warnings to find the statistics at the end. In this example, all of my warnings except for the last one before the actual statistics were not captured in the screenshot, on purpose, to keep the graphic smaller. The last line is from the wrapper and is just a processing detail that can be ignored.

 ![hisat2-review-alignments-in-stderr-3](https://us1.discourse-cdn.com/flex020/uploads/galaxy/original/2X/c/c80f5bba52d810c070e55755d576d061b2c483a8.png)

**How to capture only the `HISAT2` alignment statistics from the full `stderr` message into a distinct dataset report into the history.**

On the `HISAT2` tool form, expand the section “Summary Options” to access the parameter to “Print alignment summary to a file.” It happens to be set to “No” by default. In the graphic, I changed the option to be “Yes”, and the extra output dataset was created during job execution. It contains just the alignment statistics – in a cleaned-up format (no “warnings” or technical run details). The statistics content is exactly the same as those found at the end of the `stderr` output above.

 ![hisat2-print-alignments-to-a-dataset](https://us1.discourse-cdn.com/flex020/uploads/galaxy/original/2X/d/d5bafd5c864440cfaedf706509674bece4caf2db.png)

Hope that helps!

---

<div class="post-metadata">

**Author:** ![zhwdong9](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/zhwdong9/32/1031_2.png) [@zhwdong9](https://help.galaxyproject.org/u/zhwdong9)\
**Post date:** [October 31, 2019, 3:26am UTC](https://help.galaxyproject.org/t/custom-genome-help-and-troubleshooting-plus-where-to-find-hisat2-alignment-statistics/2390/6 "2019-10-31T03:26:14Z")

</div>

hi, Jenn: I am very appreciate! based on your second suggestion, the problem is really resolved! Truly thanks
