# Removal of spaces from fasta file

**URL:** <https://help.galaxyproject.org/t/removal-of-spaces-from-fasta-file/305>\
**Category:** Uncategorized\
**Tags:** fasta-manipulation, custom-genome\
**Created:** [December 30, 2018, 4:00pm UTC](https://help.galaxyproject.org/t/removal-of-spaces-from-fasta-file/305 "2018-12-30T16:00:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![humaira](https://avatars.discourse-cdn.com/v4/letter/h/278dde/32.png) [@humaira](https://help.galaxyproject.org/u/humaira)\
**Post date:** [December 30, 2018, 4:00pm UTC](https://help.galaxyproject.org/t/removal-of-spaces-from-fasta-file/305/1 "2018-12-30T16:00:50Z")

</div>

I have large fasta file, which look like this after removal of few sequences.  
JE116607\_g1\_i1 len=581 path=[559:0-580]

ATAAATATGATGAAAAGAGCTGTCTACATTAGGAAAACAAGGGAAATAGGATCCCTCTTC

TAAGCCATAATTGGTAAACAGTCATAAGAAATGAATCATAATCTTGTGGAGATGCATTCC

AGTGTCTTCTCACTAGACCCAGATTTGCAAGAAAGCTTGCATACATTTCCTCAG

AAATAGAAAGCAAGATTGCCTTGAGGTTTTGAACATCATTGTGGCTTATAACAATTGAGA

ATTTACTCCAATCCAAAACATTGGCAAAGGGTAGATCATAGTAATCAGAAATGATAACGG

GAACACAACCAAAATGAATAGCATCTGAGATCCTAGCTGTATTCACTTCATAGCCTTTAA

CATGTAGACAATACTTGCTTTTTGTCAAGCCTTCACGTGAATCATGAAATTTTCCAGAGA

TAAGCATTGAAGTATCATTCTCCCACATTAGTCGCTCACGAATTCTGGAATTCT

TCTCTCGCCCAGCAAAAAACGTGGTCCTTTCACTTGGAGGAACTAAACTTGTTT

CTGGCAGCCGAGGCCATACTTGCGGCAAGGCTACATCTTTA

I want to remove spaces at the end of lines.i am window user.

---

<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:** [December 31, 2018, 3:33am UTC](https://help.galaxyproject.org/t/removal-of-spaces-from-fasta-file/305/2 "2018-12-31T03:33:23Z")

</div>

Run the fasta dataset through the tool `NormalizeFasta`.

Tips:

- Fasta datasets have **fasta identifier lines** that start with a `>` character, otherwise tools will not recognize the format/datatype. _Do this before loading the data into Galaxy and using_ the tool `NormalizeFasta`.

- Some tools can handle unwrapped **fasta data lines** and some cannot. Wrapping at 80 bases is a common choice and most likely to work well with most tools. Any consistent length between 40-80 will work with many. And some tools do not care about wrapping but these are mostly mapping tools – so you’ll have trouble with unwrapped fasta data with the downstream tools used. It is a good idea to wrap the formatting at the beginning of an analysis, especially if you plan to use the fasta as a Custom Genome or as another input to a tool. `NormalizeFasta` can do the wrapping operation.

- Also, trimming the **fasta identifier lines** at the first whitespace is often important, and required if using the data as a Custom Genome. All the identifiers in any single fasta dataset must be unique, so check that this would be true in your data before doing that and make adjustments, if needed, _before loading the data into Galaxy_. `NormalizeFasta` can do the trimming operation.

- Not formatting fasta data correctly can lead to tool errors, whether working in Galaxy or otherwise.

FAQs: [https://galaxyproject.org/support/](https://galaxyproject.org/support/)

- [Common datatypes explained](https://galaxyproject.org/learn/datatypes/)
- [Preparing and using a Custom Reference Genome or Build](https://galaxyproject.org/learn/custom-genomes/)

---

<div class="post-metadata">

**Author:** ![humaira](https://avatars.discourse-cdn.com/v4/letter/h/278dde/32.png) [@humaira](https://help.galaxyproject.org/u/humaira)\
**Post date:** [December 31, 2018, 5:58pm UTC](https://help.galaxyproject.org/t/removal-of-spaces-from-fasta-file/305/3 "2018-12-31T17:58:00Z")

</div>

Dear Jennifer

Thx alot for your reply. I am window user and normalizefasta tool is not run on window. Kindly suggest tool which can be run on window. Thx

---

<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 2, 2019, 5:46pm UTC](https://help.galaxyproject.org/t/removal-of-spaces-from-fasta-file/305/4 "2019-01-02T17:46:59Z")

</div>

Hi - This forum is for help with the Galaxy platform. It runs through a browser window at publicly hosted sites.

- Galaxy Main [https://usegalaxy.org](https://usegalaxy.org)
- Galaxy EU [https://usegalaxy.eu](https://usegalaxy.eu)
- Galaxy AU [https://usegalaxy.org.au](https://usegalaxy.org.au)

These and more choices are listed here: [https://galaxyproject.org/use/](https://galaxyproject.org/use/)

For help with line-command bioinformatics, try forums such as [https://www.biostars.org/](https://www.biostars.org/) and [https://bioinformatics.stackexchange.com/](https://bioinformatics.stackexchange.com/).

Hope that helps to clarify.

---

<div class="post-metadata">

**Author:** ![wm75](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/wm75/32/56_2.png) [@wm75](https://help.galaxyproject.org/u/wm75)\
**Post date:** [January 2, 2019, 7:17pm UTC](https://help.galaxyproject.org/t/removal-of-spaces-from-fasta-file/305/5 "2019-01-02T19:17:28Z")

</div>

I guess the confusion here may come from this sentence you wrote earlier, @jennaj:

> [@jennaj](#):
>
> _Do this before loading the data into Galaxy and using_ the tool `NormalizeFasta` .

@humaira what this was supposed to say (I guess you read it differently) was that you should add the `>` symbol in front of each sequence title that doesn’t have it yet before uploading your data to the server. Then, as a next step, use the `NormalizeFasta` tool _on_ the server to fix the remaining issues with your input.
