About
Contact
A problem with "Use of unintialized value" in concentrations.pl
Dear UNAFold Web Server Forum,
I am trying to study the hybridization between the two oligos, called B and tC, below:
B : tgagtgtgtggcttttttttttttttttgcgagtcagcga
tC : gccacacactcaccaaccac
By using the command "hybrid2.pl --NA=DNA --tmin=15 --tmax=30 --sodium=0.0017 --magnesium=0.005 --A0=0.000000133 --B0=0.000000133 B.seq tC.seq" and after several lines of "Calculating for ..., t = ...", I got the following message:
"Use of uninitialized value of $A0old in addition (+) at C:\Program Files\UNAFold\bin\concentrations.pl line 81.
Use of uninitialized value of $B0old in addition (+) at C:\Program Files\UNAFold\bin\concentrations.pl line 81.
Too few points for computation.
Exit status 1 from dG2Cp"
After checking B-tC.con, there is only the header in the file suggesting that the concentration calculation was not successful. I have tried the same command line with another pair of oligos below:
B : tgagtgtgtggcttttttttttttttttgcgagtcagcga
tA : tatggttggtgtggttggtcgctgactcgc
and the results turned out to be ok.
I wonder if there is anything I overlooked? Thank you very much in advance for your kind attention.
Chittanon
Using UNAFold 3.8 (the latest version), I haven't been able to reproduce the errors you mentioned. Can you verify which version you're using? Try, for example, "hybrid2.pl --version". If it's less then 3.8, hopefully the fix is as simple as upgrading to the latest version.
Dear NMarkham,
Thank you very much for your reply. The UNAFold that I'm using is the version 3.8 running on a Windows7 PC. Switching to another PC with Windows XP gave the same results. I'll try it on a different OS and will come back with the result. In a mean time, if you come up with any suggestions, please let me know.
Best regards,
Chittanon
Of course. I should have suspected an issue with different platforms/operating systems at first, but then hindsight is 20/20.
What is significant about this case is that the second sequence (tC) cannot fold according to our rules. Thus, UNAFold attempts to write (to a file on disk) a partition function of zero and a free energy of +∞. The second value is what causes a problem under Windows, as the infinite value can't be re-read by the next process in the pipeline (namely, concentration).
Background: on most (if not all) Unix systems, it's possible to write the "unusual" floating-point values +∞, -∞ and not-a-number to a text file and — the key — read them back and recover the original values. That is, printf() creates strings like "inf" and "nan", and scanf() understands those same strings. Unfortunately, either this behavior is non-standard, or Windows doesn't conform to the standard. Windows machines tend to write a string like "1.#INF", but they aren't capable of reading that same string back.
This tells me that I need to pay more attention to how I handle numbers that may not be finite, for example substituting a very large positive number for +∞ on platforms where +∞ itself isn't safe. Unfortunately, I don't know when we'll have a fix; the Windows port has always been something of a second-class citizen, and that is unlikely to change anytime soon (at least not for the better).
Fortunately, there is an easy workaround in this case: simply add
--exclude=B,-xBor whatever your preferred syntax is to the hybrid2.pl command. The naming is a bit confusing in this case — B refers to the second sequence, not to the file actually named B. Since tC cannot fold anyway, we lose nothing by excluding that species from consideration, and in fact we may save a bit of time.This is, of course, specific to this particular example; in general, any combination of the five species could be impossible, which would require their exclusion to get hybrid2.pl to run properly on Windows.
I hope this helps!