Hello! I have a question.

After use MAFFT to aligne a multifasta file, I generated a consensus sequence using seqinr::consensus in R like this:

">seq1
ACCATTCA-AAT--GAAACAAAAATTT-GACCACA-CGTGTG-TGTTCACACACTGGAC-CCAAACAACCC-GAAC"

I would like to design a pair of primers targeting this sequence. How I am afraid the gaps can interfere in this process.

Can I design primers for sequences containing gaps in the middle of it? If yes, there a maximum percentage of gaps the sequence can have?

Thank you in advance.
You can do this using degenerate primers.  At each gap, you would indicate a mixed base (i.e. more than one nt; see link below).  The result will be a mix of primers, each with a different nt at that position.  It's best to use as few mixed bases as possible in order to minimize the number of primers in the tube.  More primers mean more potential unwanted products, as well as less of the correct primer in your tube.  If you know the amino acid sequence, you can possibly deduce what the gap could be using a codon table.  This could help you add a mixed base of 2 or 3 (e.g. A/G or A/C/T) instead of all 4.  The second and third links below give guidelines for designing degenerate primers.

[Mixed Bases][1]

[Degenerate Primer Design][2]

[Degenerate Primer Guidelines][3]


  [1]: https://www.idtdna.com/pages/products/custom-dna-rna/mixed-bases
  [2]: https://bitesizebio.com/18992/a-primer-for-designing-degenerate-primers/
  [3]: https://www.qiagen.com/us/knowledge-and-support/knowledge-hub/bench-guide/pcr/introduction/guidelines-for-degenerate-primer-design-and-use