Answers.Body: <p>If you really insisted on using Primer3 you could perform a 36bp sliding window analysis. You would submit your primers in 36bp 'chunks' with a step size of say 3 bp. You would need to "circularise" your primer within the sliding window to assess the "beginning" and the "end" and remove "artifactual" hairpins. Its doable via a script and you would automate the web upload and data extraction via a "digger/spider" or else just use a download equivalent (I've used a standalone). There would be a "blindspot" using this approach, which you could overcome if you wanted. </p>
  
  <p>So summary, its complicated and I think your suggestion of using UNAFold is a better idea.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-27T16:43:44.170Z
Answers.Text: I'm not insisting on primer3, but that's a really interesting solution. I came up with a different workaround after I posted this question - now incorporated in an edit to in my original. I'm going to test that against the answer I would have gotten from UNAFold (manually via UNAFold's browser interface) to see if I would have made the same choice with UNAFold data. I think that will tell me whether I need to invest the time into implementing UNAFold.
Answers.UserDisplayName: mRotten
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-27T11:08:56.360Z
Answers.LastActivityDate: 2019-02-27T11:08:56.360Z
Answers.UserDisplayName: M__
Body: <p>I'm writing a tool to automate Sanger sequencing primer design for a production lab that uses a universal-tail chemistry Sanger sequencing to verify NGS results. Essentially, the template DNA is amplification using primers with universal 5' tails (M13F/R), and then the "BigDye" reaction is performed with an M13F and M13R primers in separate wells.</p>
  
  <p>I'm able to design logical primers for each region in a request using Primer3 (v2.5.0), but then I'd like to calculate folding thermodynamics for the M13-appended primers to determine the best primer partner for the 5' M13 appendages.</p>
  
  <p>In other words, in the last step, I would like to know if I should use:</p>
  
  <blockquote>
    <p>M13F-forward_primer + M13R-reverse_primer</p>
  </blockquote>
  
  <p>or</p>
  
  <blockquote>
    <p>M13R-forward_primer + M13F-reverse_primer</p>
  </blockquote>
  
  <p>The problem is that Primer3 won't fold an oligo > 36 nt, since the algorithm for Tm is diminishingly accurate for longer oligos. However, I believe thermodynamic predictions are valuable, even if only relatively, i.e. comparing one 5' appendage to another 5' appendage on the same allele-specific sequence, so I'd like the most painless answer, even if it isn't accurate in absolute terms.</p>
  
  <p>I'm aware that UNAFold will do this, but it seems like extreme overkill for what I need to do.</p>
  
  <p>For lack of a better solution, I've implemented a workaround wherein I pair each allele-specific primer with either M13F or M13R and submit the pair as a <code>check_primer</code> task. In other words, the left primer is one of the allele-specific primers that primer3 designed, and the right primer is either M13F, or M13R. I then choose the M13 appendage orientation based on the <code>PRIMER_PAIR_0_COMPL_ANY_TH</code> output values for the two possible orientations.</p>
  
  <p>I would like to know: Is there a better solution? Primer3 docs say that the Tm calculation (and not necessarily folding thermodynamic calculations) is inaccurate for 37+ mers. Is there a way to force Primer3 to fold a sequence > 36 nt? If not, is there a simple tool for folding >36-mers?</p>
  
  <p><strong>Follow-Up:</strong> The workaround described in my OP was inadequate and UNAFold would cost $9k (which would take months for my employer to approve - don't get me started), so I tried @MichaelG's solution below. It turned out to work quite well. I'm computing the maximum Tm value for all fragments from every oligo, and that number agrees quite well with the browser-based UNAFold output.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-27T08:32:53.963Z
Comments.Text: Welcome to the site. Do you want to have a script or another program to calculate it or force somehow Primer3 to calculate it? I doubt we can force Primer3 to do this calculation but it would be easier to help you with your script for thermodynamic predictions... If you could clarify why UNAFold is an overkill it will be helpful too (from my point of view if it does what you want and it easy and reliable I would use it).
Comments.UserDisplayName: llrs
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-27T10:41:27.830Z
Comments.Text: I agree with @llrs Primer3 is great but if the error limit of the algorithm has been reached there is no point pushing it any further. If you really wanted to down that path you could just obtain the source code and remove the restriction.
Comments.UserDisplayName: M__
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-27T16:33:39.087Z
Comments.Text: @llrs - I'm looking for a solution I can implement in Python or Bash - I only know those, and I'm only really adept at Python. TBH, my question is partially to confirm that primer3 REALLY won't do a >36-mer, because it seems like a significant limitation for an otherwise great tool. If that's the case, you're right that UNAFold isn't overkill. See my description of a workaround in Primer3 - I think that's the route I'll take for now - I'll implement UNAFold if we can't get sequence data from our test set.
Comments.UserDisplayName: mRotten
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-27T17:45:50.870Z
Comments.Text: @MichaelG. I understand your point, but I just want to clarify: the p3 documentation says Tm calculations are inaccurate for long oligos, but I want the results from folding thermodynamic calculations.
Comments.UserDisplayName: mRotten
Tags: <phylogenetics><phylogeny><software-recommendation><primer>
Title: programmatic secondary structure prediction for >36-mer DNA oligonucleotides
ThreadText: # programmatic secondary structure prediction for >36-mer DNA oligonucleotides
  
  (Asked by: username_0 on 2019-02-26)
  
  I'm writing a tool to automate Sanger sequencing primer design for a production lab that uses a universal-tail chemistry Sanger sequencing to verify NGS results. Essentially, the template DNA is amplification using primers with universal 5' tails (M13F/R), and then the "BigDye" reaction is performed with an M13F and M13R primers in separate wells.
  
  I'm able to design logical primers for each region in a request using Primer3 (v2.5.0), but then I'd like to calculate folding thermodynamics for the M13-appended primers to determine the best primer partner for the 5' M13 appendages.
  
  In other words, in the last step, I would like to know if I should use:
  
  > M13F-forward\_primer + M13R-reverse\_primer
  
  or
  
  > M13R-forward\_primer + M13F-reverse\_primer
  
  The problem is that Primer3 won't fold an oligo > 36 nt, since the algorithm for Tm is diminishingly accurate for longer oligos. However, I believe thermodynamic predictions are valuable, even if only relatively, i.e. comparing one 5' appendage to another 5' appendage on the same allele-specific sequence, so I'd like the most painless answer, even if it isn't accurate in absolute terms.
  
  I'm aware that UNAFold will do this, but it seems like extreme overkill for what I need to do.
  
  For lack of a better solution, I've implemented a workaround wherein I pair each allele-specific primer with either M13F or M13R and submit the pair as a `check_primer` task. In other words, the left primer is one of the allele-specific primers that primer3 designed, and the right primer is either M13F, or M13R. I then choose the M13 appendage orientation based on the `PRIMER_PAIR_0_COMPL_ANY_TH` output values for the two possible orientations.
  
  I would like to know: Is there a better solution? Primer3 docs say that the Tm calculation (and not necessarily folding thermodynamic calculations) is inaccurate for 37+ mers. Is there a way to force Primer3 to fold a sequence > 36 nt? If not, is there a simple tool for folding >36-mers?
  
  **Follow-Up:** The workaround described in my OP was inadequate and UNAFold would cost $9k (which would take months for my employer to approve - don't get me started), so I tried @MichaelG's solution below. It turned out to work quite well. I'm computing the maximum Tm value for all fragments from every oligo, and that number agrees quite well with the browser-based UNAFold output.
  
  **Tags:** phylogenetics, phylogeny, software-recommendation, primer
  
  > **Comments:**
  > **username_1**: Welcome to the site. Do you want to have a script or another program to calculate it or force somehow Primer3 to calculate it? I doubt we can force Primer3 to do this calculation but it would be easier to help you with your script for thermodynamic predictions... If you could clarify why UNAFold is an overkill it will be helpful too (from my point of view if it does what you want and it easy and reliable I would use it).  
  > **username_2**: I agree with @username_1 Primer3 is great but if the error limit of the algorithm has been reached there is no point pushing it any further. If you really wanted to down that path you could just obtain the source code and remove the restriction.  
  > **username_0**: @username_1 - I'm looking for a solution I can implement in Python or Bash - I only know those, and I'm only really adept at Python. TBH, my question is partially to confirm that primer3 REALLY won't do a >36-mer, because it seems like a significant limitation for an otherwise great tool. If that's the case, you're right that UNAFold isn't overkill. See my description of a workaround in Primer3 - I think that's the route I'll take for now - I'll implement UNAFold if we can't get sequence data from our test set.  
  > **username_0**: @MichaelG. I understand your point, but I just want to clarify: the p3 documentation says Tm calculations are inaccurate for long oligos, but I want the results from folding thermodynamic calculations.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2019-02-27. Score: 2 | Accepted answer
  
  If you really insisted on using Primer3 you could perform a 36bp sliding window analysis. You would submit your primers in 36bp 'chunks' with a step size of say 3 bp. You would need to "circularise" your primer within the sliding window to assess the "beginning" and the "end" and remove "artifactual" hairpins. Its doable via a script and you would automate the web upload and data extraction via a "digger/spider" or else just use a download equivalent (I've used a standalone). There would be a "blindspot" using this approach, which you could overcome if you wanted.
  
  So summary, its complicated and I think your suggestion of using UNAFold is a better idea.
  
  > **Comments:**
  > **username_0**: I'm not insisting on primer3, but that's a really interesting solution. I came up with a different workaround after I posted this question - now incorporated in an edit to in my original. I'm going to test that against the answer I would have gotten from UNAFold (manually via UNAFold's browser interface) to see if I would have made the same choice with UNAFold data. I think that will tell me whether I need to invest the time into implementing UNAFold.  
  
  ---
  
  