# Prokka error "Please rename your contigs" - "contig id must \<=37 chars long"

**URL:** <https://help.galaxyproject.org/t/prokka-error-please-rename-your-contigs-contig-id-must-37-chars-long/5203>\
**Category:** usegalaxy.eu support\
**Created:** [January 17, 2021, 5:53pm UTC](https://help.galaxyproject.org/t/prokka-error-please-rename-your-contigs-contig-id-must-37-chars-long/5203 "2021-01-17T17:53:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![stelluna](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@stelluna](https://help.galaxyproject.org/u/stelluna)\
**Post date:** [January 17, 2021, 5:53pm UTC](https://help.galaxyproject.org/t/prokka-error-please-rename-your-contigs-contig-id-must-37-chars-long/5203/1 "2021-01-17T17:53:11Z")

</div>

Dear [usegalaxy.eu](http://usegalaxy.eu) community,

Prokka would not accept a draft genome assembly (which I would like to annotate) because the headers of the sequences are too long:  
“Please rename your contigs”  
“contig id must \<=37 chars long”

Could I kindly ask for any suggestions how to shorten the headers of all sequences in the respective draft genome assembly?

The draft genome assembly (containing over 100 sequences) looks like this:

> lcl|NODE\_1\_length\_269672\_cov\_95.829929 Escherichia sp. A1234  
> TTGAGAAGGGAGAGATAAAACACGAGGCAAGACGAGTTGAACTTTGGAGTAATAAGTCAGTTGTCCT…  
> …  
> lcl|NODE\_2\_length\_176203\_cov\_83.720917 Escherichia sp. A1234  
> AAAGGCAATTCCGAAAGGATATCTATGCTATTTAAGTTTTACCGGACAGCAATAAAAGTAAATAAAAAAA…  
> …

Thank you very much already in advance for your thoughts on this (basic) question!

Best,  
Michael

P.S.:  
I had mistakenly thought that ‚Relabel List Identifiers from contents of a file‘ (Galaxy Version 1.0.0) could be used for renaming the headers from e.g.:

> lcl|NODE\_1\_length\_269672\_cov\_95.829929 Escherichia sp. A1234  
> …  
> lcl|NODE\_2\_length\_176203\_cov\_83.720917 Escherichia sp. A1234  
> …

to:

> NODE\_1\_A1234  
> …  
> NODE\_2\_A1234  
> …

and I have already prepared a separate file which looks like this:

> NODE\_1\_A1234  
> NODE\_2\_A1234  
> …

but only afterwards I came to notice that this would not work in my case, unfortunately.

---

<div class="post-metadata">

**Author:** ![bjoern.gruening](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/bjoern.gruening/32/10_2.png) [@bjoern.gruening](https://help.galaxyproject.org/u/bjoern.gruening)\
**Post date:** [January 17, 2021, 7:40pm UTC](https://help.galaxyproject.org/t/prokka-error-please-rename-your-contigs-contig-id-must-37-chars-long/5203/2 "2021-01-17T19:40:01Z")

</div>

Hi,

there is a very basic trick to convert your FASTA file to tabular with [Galaxy | Europe](https://usegalaxy.eu/root?tool_id=toolshed.g2.bx.psu.edu/repos/devteam/fasta_to_tabular/fasta2tab)

This will enable you to use all Galaxy tabular tools to manipulate that name column as you like. If you are finished you can use [Galaxy | Europe](https://usegalaxy.eu/root?tool_id=toolshed.g2.bx.psu.edu/repos/devteam/tabular_to_fasta/tab2fasta) to convert it back to FASTA 🙂

You could also try to use [Galaxy | Europe](https://usegalaxy.eu/root?tool_id=toolshed.g2.bx.psu.edu/repos/devteam/picard/picard_NormalizeFasta) and use “Truncate sequence names at first whitespace”.

Hope that helps,  
Bjoern

---

<div class="post-metadata">

**Author:** ![gallardoalba](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/gallardoalba/32/1903_2.png) [@gallardoalba](https://help.galaxyproject.org/u/gallardoalba)\
**Post date:** [January 17, 2021, 7:55pm UTC](https://help.galaxyproject.org/t/prokka-error-please-rename-your-contigs-contig-id-must-37-chars-long/5203/3 "2021-01-17T19:55:00Z")

</div>

Another alternative is to use **Text transformation with sed** tool with this expression:  
`s/(^lcl.{n}).*/\1/`, where _n_ is the length of the header.

Regards

---

<div class="post-metadata">

**Author:** ![stelluna](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@stelluna](https://help.galaxyproject.org/u/stelluna)\
**Post date:** [January 17, 2021, 9:27pm UTC](https://help.galaxyproject.org/t/prokka-error-please-rename-your-contigs-contig-id-must-37-chars-long/5203/4 "2021-01-17T21:27:56Z")

</div>

Hi bjoern.gruening,  
Hi gallardoalba,

Thank you both very much for your quick replies with the helpful suggestions to my very basic question - great to have the choice of different approaches doing the trick in shortening the headers of my input data.

Best,  
Michael
