[Biopython] Primer3Commandline rookie question

Jukka-Pekka Verta jp.verta at gmail.com
Wed Nov 3 20:30:19 UTC 2010



Thanks Brad, 

calling 

test()

results in error


Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.6/site-packages/biopython-1.55-py2.6-macosx-10.6-universal.egg/Bio/Application/__init__.py", line 487, in __call__
    % (str(self), return_code))
RuntimeError: Command eprimer3 -auto -outfile=output.pr3 -sequence=sequence -hybridprobe=True -psizeopt=200 -oligosize=20 -explainflag=True returned non-zero exit status 127

as does calling 

import subprocess
subprocess.check_call(str(test))


Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 499, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 486, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__
    errread, errwrite)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1201, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Ummm.... ?

JP





On 2010-11-03, at 3:38 PM, Brad Chapman wrote:

> JP;
> 
>> Thanks Peter for the response.
>> 
>> Though doing
>> 
>> test = Primer3Commandline(sequence="sequence", auto=True, hybridprobe=True)
>> 
>> doesn't fix the problem (no output is created). Other suggestions?
> 
> In addition to what Peter mentioned, your code here creates a
> commandline object, but never actually runs it:
> 
>> test = Primer3Commandline(sequence = sequence_handle, auto=True, hybridprobe=True)
>> test.explainflag = True
>> test.oligosize=20
>> test.psizeopt=200
>> test.outfile = "output.pr3"
>> print test
> 
> This is probably why you weren't seeing any error messages from passing in
> a file handle, and explains why there is no output file. You can
> either call your command line directly:
> 
> test()
> 
> or use the Python subprocess module:
> 
> subprocess.check_call(str(test))
> 
> [As an aside, it's good practice to use meaningful variable names.
> At least a 'cl' for commandline would be nice here and may help
> you spot these types of issues.]
> 
> Hope this helps,
> Brad





More information about the Biopython mailing list