<p>This could be a bug in the fasta file reader component of fai_build_core. The fasta file format is very relaxed, and allows some odd constructions, for example:</p>
<pre><code>&gt;cb3c6a5f-17dd-4cd6-a9ca-02124d2a32de
AAGAAATTGACCTCCGTAACCCCAAAGGAGACAAAAAGAATGCTGGCTTTACTCCC
CAGGAGCGCCAGGTTTTGGGGAACTGCCTACAAGCTGTACCATTGGCTGACAGCTT
TTAGGGCATCTACCCCCAACACTGCTTACACTTACACTTTCTGGACTTACATG
ATGAATGCCCGCTCTAAGAATGTTGGTTGGCGCCTTGATTACTTTTTGCTTTCC
CACTCTCTTTTTACCTGCATTGTGACAGCAAGATCCGGTCAAGGCTCTTG
GCAGTACACTGTCCCATCACCGCTACCTGTGATACCCCTCCCTGCAGTAGCTT
CCTGCCTGGGAGATGGCTCTCTCTGCAGAAGTCTGGTGTTTTAGCC
TTCAGGTGTTTGGTTTGTATGTGCTCCCTCATTTAAACATTAAACCAAACTT
CTGGTTTCCTTTAGACAATCCAAGAGAAATAAAAGGCCCTAC
TTTCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
</code></pre>
<p>A few programs will complain about fasta files that look like this, because it usually means that data has been corrupted. These programs only accept fasta files that have sequences with identical line lengths for all but the last line:</p>
<pre><code>&gt;cb3c6a5f-17dd-4cd6-a9ca-02124d2a32de
AAGAAATTGACCTCCGTAACCCCAAAGGAGACAAAAAGAATGCTGGCTTTACTCCC
CAGGAGCGCCAGGTTTTGGGGAACTGCCTACAAGCTGTACCATTGGCTGACAGCTT
TTAGGGCATCTACCCCCAACACTGCTTACACTTACACTTTCTGGACTTACATGATG
AATGCCCGCTCTAAGAATGTTGGTTGGCGCCTTGATTACTTTTTGCTTTCCCACTC
TCTTTTTACCTGCATTGTGACAGCAAGATCCGGTCAAGGCTCTTGGCAGTACACTG
TCCCATCACCGCTACCTGTGATACCCCTCCCTGCAGTAGCTTCCTGCCTGGGAGAT
GGCTCTCTCTGCAGAAGTCTGGTGTTTTAGCCTTCAGGTGTTTGGTTTGTATGTGC
TCCCTCATTTAAACATTAAACCAAACTTCTGGTTTCCTTTAGACAATCCAAGAGAA
ATAAAAGGCCCTACTTTCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
</code></pre>
<p>One way to work around this input error problem is to get rid of <em>all</em> line breaks in the sequence of a fasta file, but then you run the risk of programs not properly being able to read all the characters in a line. A better approach is to feed the fasta file through a less restrictive data cleaning program and convert the lines back to all have a consistent length.</p>
<p>There's a good chance this is <em>not</em> the problem you are experiencing, but without more information about your input data, all we have to go on are the error messages and the sequence lengths [not line lengths] you have provided.</p>

CC BY-SA 4.0
2022-07-08T08:59:26.053Z
Thank you so much for your reply. I was able to rectify the error. I was doing some unwanted steps while zipping the fasta file.
Sowmya Pulapet
CC BY-SA 4.0
2022-07-08T06:34:44.367Z
2022-07-08T12:49:02.990Z
2022-07-08T12:49:02.990Z
gringer
<p>I am currently using VEP for variant annotation.</p>
<p>I am facing an error as below:</p>
<pre><code>[E::fai_build_core] Different line length in sequence 'Pn9'
</code></pre>
<p>I understand there is an issue with the difference in line length of Pn9 in the  fasta file. However, the sequences of fasta file all have different line length. I don't get why there is an error specifically on Pn9.</p>
<p>I have tried using both snpEff and Annovar but doesn't work. Any thoughts on this would be really appreciated.</p>
<p>I am attaching the length of sequence here :
<img src="https://i.sstatic.net/6xMuH.jpg" alt="length per chromosome" /></p>
<p>Thanks in advance.</p>

CC BY-SA 4.0
2022-07-07T12:36:50.517Z
Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
Community
<fasta><sequence-annotation><samtools>
Different line length in fasta file
# Different line length in fasta file

(Asked by: username_0 on 2022-07-07)

I am currently using VEP for variant annotation.
I am facing an error as below:
[E::fai_build_core] Different line length in sequence 'Pn9'

I understand there is an issue with the difference in line length of Pn9 in the  fasta file. However, the sequences of fasta file all have different line length. I don't get why there is an error specifically on Pn9.
I have tried using both snpEff and Annovar but doesn't work. Any thoughts on this would be really appreciated.
I am attaching the length of sequence here :

Thanks in advance.

**Tags:** fasta, sequence-annotation, samtools
> **Comments:**
> **username_1**: Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.  

---

## 1 answers

### Answer by username_2 on 2022-07-08. Score: 1

This could be a bug in the fasta file reader component of fai_build_core. The fasta file format is very relaxed, and allows some odd constructions, for example:
>cb3c6a5f-17dd-4cd6-a9ca-02124d2a32de
AAGAAATTGACCTCCGTAACCCCAAAGGAGACAAAAAGAATGCTGGCTTTACTCCC
CAGGAGCGCCAGGTTTTGGGGAACTGCCTACAAGCTGTACCATTGGCTGACAGCTT
TTAGGGCATCTACCCCCAACACTGCTTACACTTACACTTTCTGGACTTACATG
ATGAATGCCCGCTCTAAGAATGTTGGTTGGCGCCTTGATTACTTTTTGCTTTCC
CACTCTCTTTTTACCTGCATTGTGACAGCAAGATCCGGTCAAGGCTCTTG
GCAGTACACTGTCCCATCACCGCTACCTGTGATACCCCTCCCTGCAGTAGCTT
CCTGCCTGGGAGATGGCTCTCTCTGCAGAAGTCTGGTGTTTTAGCC
TTCAGGTGTTTGGTTTGTATGTGCTCCCTCATTTAAACATTAAACCAAACTT
CTGGTTTCCTTTAGACAATCCAAGAGAAATAAAAGGCCCTAC
TTTCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

A few programs will complain about fasta files that look like this, because it usually means that data has been corrupted. These programs only accept fasta files that have sequences with identical line lengths for all but the last line:
>cb3c6a5f-17dd-4cd6-a9ca-02124d2a32de
AAGAAATTGACCTCCGTAACCCCAAAGGAGACAAAAAGAATGCTGGCTTTACTCCC
CAGGAGCGCCAGGTTTTGGGGAACTGCCTACAAGCTGTACCATTGGCTGACAGCTT
TTAGGGCATCTACCCCCAACACTGCTTACACTTACACTTTCTGGACTTACATGATG
AATGCCCGCTCTAAGAATGTTGGTTGGCGCCTTGATTACTTTTTGCTTTCCCACTC
TCTTTTTACCTGCATTGTGACAGCAAGATCCGGTCAAGGCTCTTGGCAGTACACTG
TCCCATCACCGCTACCTGTGATACCCCTCCCTGCAGTAGCTTCCTGCCTGGGAGAT
GGCTCTCTCTGCAGAAGTCTGGTGTTTTAGCCTTCAGGTGTTTGGTTTGTATGTGC
TCCCTCATTTAAACATTAAACCAAACTTCTGGTTTCCTTTAGACAATCCAAGAGAA
ATAAAAGGCCCTACTTTCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

One way to work around this input error problem is to get rid of all line breaks in the sequence of a fasta file, but then you run the risk of programs not properly being able to read all the characters in a line. A better approach is to feed the fasta file through a less restrictive data cleaning program and convert the lines back to all have a consistent length.
There's a good chance this is not the problem you are experiencing, but without more information about your input data, all we have to go on are the error messages and the sequence lengths [not line lengths] you have provided.

> **Comments:**
> **username_0**: Thank you so much for your reply. I was able to rectify the error. I was doing some unwanted steps while zipping the fasta file.  

---

