<p>I just copied your FASTA sequence into a file (on Mac OS) and uploaded it to Primer BLAST, the search did not give an error.</p>

<p>If the error is caused by the line endings, maybe you can fix your downloaded files with a tool like <a href="http://macappstore.org/dos2unix/" rel="nofollow noreferrer">dos2unix</a>.</p>

<h1>Update:</h1>

<p>On a whim, I tried adding a description to the FASTA header:</p>

<pre><code>&gt;test1 description
ATTAAAGGTTTATACCTTCCCAGGTAACAAACCAACCAACTTTCGATCTCTTGTAGATCTGTTCTCTAAACGAACTTTAA
AATCTGTGTGGCTGTCACTCGGCTGCATGCTTAGTGCACTCACGCAGTATAATTAATAACTAATTACTGTCGTTGACAGG
ACACGAGTAACTCGTCTATCTTCTGCAGGCTGCTTACGGTTTCGTCCGTGTTGCAGCCGATCATCAGCACATCTAGGTTT
CGTCCGGGTGTGACCGAAAGGTAAGATGGAGAGCCTTGTCCCTGGTTTCAACGAGAAAACACACGTCCAACTCAGTTTG
</code></pre>

<p>This time, there was no error.</p>

<p>Does that work for you as well?</p>

CC BY-SA 4.0
2020-04-25T17:29:36.020Z
You uploaded it both as the PCR template and as the custom database? Because it works fine when you just upload it as the template, and then set the database to something like *Refseq representative genomes*. It's only when you set the database to *custom* that it errors out.
Set
CC BY-SA 4.0
2020-04-25T17:50:06.510Z
Sorry, you're right. When uploading the sequence as database, I get the same error. -.-
mrhd
CC BY-SA 4.0
2020-04-25T17:53:01.293Z
The error does not appear when pasting the sequence into the text box under "Custom", though. Strange...
mrhd
CC BY-SA 4.0
2020-04-25T17:56:31.260Z
Ok, for some crazy reason, I'm able to get it to work when I copy-paste the template but upload the custom database. But it doesn't work when you upload both the template and the custom database, even though it does work if you upload the template but don't use the custom database option.
Set
CC BY-SA 4.0
2020-04-25T17:58:48.150Z
Very odd indeed..
mrhd
CC BY-SA 4.0
2020-04-25T17:24:37.067Z
2020-04-25T17:57:45.047Z
2020-04-25T17:57:45.047Z
mrhd
<p>I did it by copy and paste. Here's the top line of the output:</p>

<pre><code>    Primer pair 1
Sequence (5'-&gt;3')   Template strand Length  Start   Stop    Tm  GC% Self complementarity    Self 3' complementarity
Forward primer  TGTCGTTGACAGGACACGAG    Plus    20  148 167 59.97   55.00   5.00    2.00
Reverse primer  TTACCTTTCGGTCACACCCG    Minus   20  264 245 59.97   55.00   3.00    2.00
Product length  117
Primer pair 2
Sequence (5'-&gt;3')   Template strand Length  Start   Stop    Tm  GC% Self complementarity    Self 3' complementarity
Forward primer  ATCTGTGTGGCTGTCACTCG    Plus    20  82  101 60.04   55.00   5.00    3.00
Reverse primer  ACTCGTGTCCTGTCAACGAC    Minus   20  168 149 59.97   55.00   4.00    3.00
Product length  87
Primer pair 3
Sequence (5'-&gt;3')   Template strand Length  Start   Stop    Tm  GC% Self complementarity    Self 3' complementarity
Forward primer  TACTGTCGTTGACAGGACACG   Plus    21  145 165 60.00   52.38   7.00    3.00
Reverse primer  ACACCCGGACGAAACCTAGA    Minus   20  251 232 60.54   55.00   4.00    2.00
Product length  107
Primer pair 4
Sequence (5'-&gt;3')   Template strand Length  Start   Stop    Tm  GC% Self complementarity    Self 3' complementarity
Forward primer  GCTTACGGTTTCGTCCGTGT    Plus    20  192 211 60.94   55.00   4.00    0.00
Reverse primer  GTTGAAACCAGGGACAAGGC    Minus   20  292 273 59.33   55.00   4.00    2.00
Product length  101
</code></pre>

<p>A command line solution would work, based on the bug reported by the OP. However there's nothing in NCBIs e-utilities and Biopython doesn't do Primer-Blast, but will do Blast. You could do it Perl via the LWP Agent, e.g. <a href="http://www.bioinformatics-made-simple.com/2012/02/perl-script-4-how-to-blast-multiple.html" rel="nofollow noreferrer">here</a>.</p>

CC BY-SA 4.0
2020-04-25T18:05:38.843Z
2020-04-25T18:31:29.817Z
2020-04-25T18:31:29.817Z
M__
<p>I'm using <a href="https://www.ncbi.nlm.nih.gov/tools/primer-blast/" rel="nofollow noreferrer">Primer-Blast</a> to compare a PCR template against a custom database of reference sequences, using Primer-Blast's <em>Custom</em> database functionality.</p>

<p>However whenever I try to upload a FASTA file as the custom database and then run Primer-Blast, I get the following error:</p>

<p><code>Exception error: Fasta Reader: sequence id ends with 80 valid nucleotide characters. Was the sequence accidentally placed in the definition line?</code></p>

<p>No matter how I try to format my FASTA file, I get this error.</p>

<p>Does anyone know how to properly format a FASTA file to have it accepted as a custom database of reference sequences to compare against the PCR template? Or is this a bug in the software?</p>

<p>Here's an example FASTA file, to upload both for the template and the custom database.</p>

<pre><code>&gt;test1
ATTAAAGGTTTATACCTTCCCAGGTAACAAACCAACCAACTTTCGATCTCTTGTAGATCTGTTCTCTAAACGAACTTTAA
AATCTGTGTGGCTGTCACTCGGCTGCATGCTTAGTGCACTCACGCAGTATAATTAATAACTAATTACTGTCGTTGACAGG
ACACGAGTAACTCGTCTATCTTCTGCAGGCTGCTTACGGTTTCGTCCGTGTTGCAGCCGATCATCAGCACATCTAGGTTT
CGTCCGGGTGTGACCGAAAGGTAAGATGGAGAGCCTTGTCCCTGGTTTCAACGAGAAAACACACGTCCAACTCAGTTTGC
</code></pre>

CC BY-SA 4.0
2020-04-25T17:01:43.170Z
@mrhd just added
Set
CC BY-SA 4.0
2020-04-25T17:05:11.543Z
@mrhd It's almost like it's not recognizing the newline escape character at the end of the sequence ID.
Set
CC BY-SA 4.0
2020-04-25T17:07:08.710Z
That might actually be the cause of the error. Did you create the FASTA on Windows or Linux/Mac?
mrhd
CC BY-SA 4.0
2020-04-25T17:10:06.887Z
@mrhd The actual FASTAs I want to use were downloaded from GISAID. However I am on a Mac.
Set
CC BY-SA 4.0
2020-04-25T18:06:32.940Z
Ok so it looks like the workaround for this is to copy-paste the template into the text box, and then upload your custom database. If you upload both the template *and* the custom database, you will get the error.
Set
CC BY-SA 4.0
2020-04-25T16:56:58.837Z
Could you provide a sample of your FASTA file, pls?
mrhd
<blast><phylogenetics><primer>
Primer-Blast Custom Database [error]
# Primer-Blast Custom Database [error]

(Asked by: username_0 on 2020-04-25)

I'm using Primer-Blast to compare a PCR template against a custom database of reference sequences, using Primer-Blast's Custom database functionality.
However whenever I try to upload a FASTA file as the custom database and then run Primer-Blast, I get the following error:
Exception error: Fasta Reader: sequence id ends with 80 valid nucleotide characters. Was the sequence accidentally placed in the definition line?
No matter how I try to format my FASTA file, I get this error.
Does anyone know how to properly format a FASTA file to have it accepted as a custom database of reference sequences to compare against the PCR template? Or is this a bug in the software?
Here's an example FASTA file, to upload both for the template and the custom database.
>test1
ATTAAAGGTTTATACCTTCCCAGGTAACAAACCAACCAACTTTCGATCTCTTGTAGATCTGTTCTCTAAACGAACTTTAA
AATCTGTGTGGCTGTCACTCGGCTGCATGCTTAGTGCACTCACGCAGTATAATTAATAACTAATTACTGTCGTTGACAGG
ACACGAGTAACTCGTCTATCTTCTGCAGGCTGCTTACGGTTTCGTCCGTGTTGCAGCCGATCATCAGCACATCTAGGTTT
CGTCCGGGTGTGACCGAAAGGTAAGATGGAGAGCCTTGTCCCTGGTTTCAACGAGAAAACACACGTCCAACTCAGTTTGC

**Tags:** blast, phylogenetics, primer
> **Comments:**
> **username_1**: Could you provide a sample of your FASTA file, pls?  
> **username_0**: @mrhd just added  
> **username_0**: @mrhd It's almost like it's not recognizing the newline escape character at the end of the sequence ID.  
> **username_1**: That might actually be the cause of the error. Did you create the FASTA on Windows or Linux/Mac?  
> **username_0**: @mrhd The actual FASTAs I want to use were downloaded from GISAID. However I am on a Mac.  
> **username_0**: Ok so it looks like the workaround for this is to copy-paste the template into the text box, and then upload your custom database. If you upload both the template *and* the custom database, you will get the error.  

---

## 2 answers

### Answer by username_1 on 2020-04-25. Score: 1

I just copied your FASTA sequence into a file (on Mac OS) and uploaded it to Primer BLAST, the search did not give an error.
If the error is caused by the line endings, maybe you can fix your downloaded files with a tool like dos2unix.
Update:
On a whim, I tried adding a description to the FASTA header:
>test1 description
ATTAAAGGTTTATACCTTCCCAGGTAACAAACCAACCAACTTTCGATCTCTTGTAGATCTGTTCTCTAAACGAACTTTAA
AATCTGTGTGGCTGTCACTCGGCTGCATGCTTAGTGCACTCACGCAGTATAATTAATAACTAATTACTGTCGTTGACAGG
ACACGAGTAACTCGTCTATCTTCTGCAGGCTGCTTACGGTTTCGTCCGTGTTGCAGCCGATCATCAGCACATCTAGGTTT
CGTCCGGGTGTGACCGAAAGGTAAGATGGAGAGCCTTGTCCCTGGTTTCAACGAGAAAACACACGTCCAACTCAGTTTG

This time, there was no error.
Does that work for you as well?

> **Comments:**
> **username_0**: You uploaded it both as the PCR template and as the custom database? Because it works fine when you just upload it as the template, and then set the database to something like *Refseq representative genomes*. It's only when you set the database to *custom* that it errors out.  
> **username_1**: Sorry, you're right. When uploading the sequence as database, I get the same error. -.-  
> **username_1**: The error does not appear when pasting the sequence into the text box under "Custom", though. Strange...  
> **username_0**: Ok, for some crazy reason, I'm able to get it to work when I copy-paste the template but upload the custom database. But it doesn't work when you upload both the template and the custom database, even though it does work if you upload the template but don't use the custom database option.  
> **username_1**: Very odd indeed..  

---

### Answer by username_2 on 2020-04-25. Score: 0

I did it by copy and paste. Here's the top line of the output:
    Primer pair 1
Sequence (5'->3')   Template strand Length  Start   Stop    Tm  GC% Self complementarity    Self 3' complementarity
Forward primer  TGTCGTTGACAGGACACGAG    Plus    20  148 167 59.97   55.00   5.00    2.00
Reverse primer  TTACCTTTCGGTCACACCCG    Minus   20  264 245 59.97   55.00   3.00    2.00
Product length  117
Primer pair 2
Sequence (5'->3')   Template strand Length  Start   Stop    Tm  GC% Self complementarity    Self 3' complementarity
Forward primer  ATCTGTGTGGCTGTCACTCG    Plus    20  82  101 60.04   55.00   5.00    3.00
Reverse primer  ACTCGTGTCCTGTCAACGAC    Minus   20  168 149 59.97   55.00   4.00    3.00
Product length  87
Primer pair 3
Sequence (5'->3')   Template strand Length  Start   Stop    Tm  GC% Self complementarity    Self 3' complementarity
Forward primer  TACTGTCGTTGACAGGACACG   Plus    21  145 165 60.00   52.38   7.00    3.00
Reverse primer  ACACCCGGACGAAACCTAGA    Minus   20  251 232 60.54   55.00   4.00    2.00
Product length  107
Primer pair 4
Sequence (5'->3')   Template strand Length  Start   Stop    Tm  GC% Self complementarity    Self 3' complementarity
Forward primer  GCTTACGGTTTCGTCCGTGT    Plus    20  192 211 60.94   55.00   4.00    0.00
Reverse primer  GTTGAAACCAGGGACAAGGC    Minus   20  292 273 59.33   55.00   4.00    2.00
Product length  101

A command line solution would work, based on the bug reported by the OP. However there's nothing in NCBIs e-utilities and Biopython doesn't do Primer-Blast, but will do Blast. You could do it Perl via the LWP Agent, e.g. here.


---

