text: user149: I have a FASTA file which I would like to convert into FASTQ format as the tool I want to use my data in requires it in FASTQ format. So dummy quality scores are fine.
  Note: I am not using any functionality of the tool that will require the quality score.
  
  user292: I think the python package bioconvert does what you want if you don't provide qualities: https://github.com/bioconvert/bioconvert/blob/master/bioconvert/fasta2fastq.py
  The following outputs lots of warnings for me, but does generate a fastq file test.fq from an existing fasta file test.fa (using dummy quality "I", and adding "None" to sequence headers that do not have a comment part in the original fasta):
  bioconvert fasta2fastq test.fa test.fq
  
  (This requires installing bioconvert using pip beforehand: pip install bioconvert.)
  
  user96: Here's a quick one-liner with no dependencies other than the UNIX core utils and Perl.
  cat seqs.fasta | paste - - | perl -ne 'chomp; s/^>/@/; @v = split /\t/; printf("%s\n%s\n+\n%s\n", $v[0], $v[1], "B"x length($v[1]))' > seqs.fastq
  
  Caveat: assumes your Fasta sequences are not wrapped, i.e. two lines per record.
  
  user149: One way of doing this is with two subcommands from the pyfastaq suite.
  fastaq to_fake_qual in.fasta - | fastaq fasta_to_fastq in.fasta - out.fastq
  
  The first tool, to_fake_qual, creates fake quality scores (default 40) for each base and the - sends that file (.qual) to stdout. The second tool, fasta_to_fastq, consumes both the original fasta and the quality scores coming from stdin and turns these into a fastq file.
  
  user104: A simple Biopython solution:
  from Bio import SeqIO
  
  for r in SeqIO.parse("myfile.fa", "fasta"):
      r.letter_annotations["solexa_quality"] = [40] * len(r)
      print(r.format("fastq"), end='')
  
  Example:
  $ cat << EOF > myfile.fa 
  >1
  ATG
  >2
  ATGTAGA
  EOF
  $ python3 myscript.py 
  @1
  ATG
  +
  III
  @2
  ATGTAGA
  +
  IIIIIII
  
  
original_text: 149: <p>I have a FASTA file which I would like to convert into FASTQ format as the tool I want to use my data in requires it in FASTQ format. So dummy quality scores are fine.</p>
  
  <p>Note: I am not using any functionality of the tool that will require the quality score.</p>
   292: <p>I think the python package <a href="https://bioconvert.readthedocs.io/en/master/user_guide.html#explicit-conversion" rel="nofollow noreferrer">bioconvert</a> does what you want if you don't provide qualities: <a href="https://github.com/bioconvert/bioconvert/blob/master/bioconvert/fasta2fastq.py" rel="nofollow noreferrer">https://github.com/bioconvert/bioconvert/blob/master/bioconvert/fasta2fastq.py</a></p>
  
  <p>The following outputs lots of warnings for me, but does generate a fastq file <code>test.fq</code> from an existing fasta file <code>test.fa</code> (using dummy quality "I", and adding "None" to sequence headers that do not have a comment part in the original fasta):</p>
  
  <pre><code>bioconvert fasta2fastq test.fa test.fq
  </code></pre>
  
  <p>(This requires installing bioconvert using <code>pip</code> beforehand: <code>pip install bioconvert</code>.)</p>
   96: <p>Here's a quick one-liner with no dependencies other than the UNIX core utils and Perl.</p>
  
  <pre><code>cat seqs.fasta | paste - - | perl -ne 'chomp; s/^&gt;/@/; @v = split /\t/; printf("%s\n%s\n+\n%s\n", $v[0], $v[1], "B"x length($v[1]))' &gt; seqs.fastq
  </code></pre>
  
  <p>Caveat: assumes your Fasta sequences are not wrapped, i.e. two lines per record.</p>
   149: <p>One way of doing this is with two subcommands from the <a href="https://github.com/sanger-pathogens/Fastaq" rel="nofollow noreferrer"><code>pyfastaq</code></a> suite.</p>
  
  <pre class="lang-sh prettyprint-override"><code>fastaq to_fake_qual in.fasta - | fastaq fasta_to_fastq in.fasta - out.fastq
  </code></pre>
  
  <p>The first tool, <code>to_fake_qual</code>, creates fake quality scores (default 40) for each base and the <code>-</code> sends that file (<code>.qual</code>) to stdout. The second tool, <code>fasta_to_fastq</code>, consumes both the original fasta and the quality scores coming from stdin and turns these into a fastq file.</p>
   104: <p>A simple Biopython solution:</p>
  <pre><code>from Bio import SeqIO
  
  for r in SeqIO.parse(&quot;myfile.fa&quot;, &quot;fasta&quot;):
      r.letter_annotations[&quot;solexa_quality&quot;] = [40] * len(r)
      print(r.format(&quot;fastq&quot;), end='')
  </code></pre>
  <p>Example:</p>
  <pre><code><span class="math-container">$ cat &lt;&lt; EOF &gt; myfile.fa 
  &gt;1
  ATG
  &gt;2
  ATGTAGA
  EOF
  $</span> python3 myscript.py 
  @1
  ATG
  +
  III
  @2
  ATGTAGA
  +
  IIIIIII
  </code></pre>
  