[EMBOSS] eprimer32 question

Ivaylo Stoimenov ivaylo.stoimenov at gmail.com
Tue Aug 28 15:10:30 UTC 2012


Your are extremely helpful again! Thank you. Just a last detail. How to
rescue the output from stdout and put it back to the EMBOSS parser. If I
feed one sequence at a time, I assume I have to use primer3 module read
function. Could you please write one or two lines of code, which will
hijack the output from Primer3 into some sort of Primer3.Record object.
This might look easy, but I was not able to figure out how to do it.
Hopefully this will be my last question.

Kind regards,

2012/8/27 Peter Rice <ricepeterm at yahoo.co.uk>

> Dear Ivaylo and Peter,
>  On Mon, Aug 27, 2012 at 11:16 AM, Ivaylo Stoimenov
>> <ivaylo.stoimenov at gmail.com> wrote:
>>> Hi Peter and Peter,
>>> Many thanks to both of you for the valuable help. It is very important
>>> for
>>> me to have as less file-related operations as possible, and passing a
>>> string helps to reduce the input from files.
>>> I wondered if it is possible to hijack the output of Primer3 to some sort
>>> of object directly to eprimer32 without writing to a file and thus making
>>> Primer3 sort of a function to an external program. I am aiming of
>>> running a
>>> validation cycle for the primers suggested by Primer3 and if necessary to
>>> change the input to Primer3 until certain criteria are fulfilled.
>>> Therefore
>>> I would like to skip a file-write-read operation until everything is
>>> optimal. Do you know if that is still possible, or I always need to read
>>> from Primer3 output files.
> Interesting suggestion, but already done! That is how eprimer32 works. The
> primer3 program is started, its input is sent to standard input, and its
> results are read from standard output.
> So all you should need to do is to request EMBOSS primer32 output goes to
> standard output.
> You can either use 'stdout' as the output file name, or use the -filter
> command line option which also defaults the first input file to standard
> input (but is happy with the asis:: sequence string as input), writes by
> default to standard output as the first output file, and also adds -auto to
> default all other unspecified options. -filter is intended to allow EMBOSS
> applications to be run as part of a pipe series.
> On 27/08/2012 14:43, Peter Cock wrote:
>> I think what you're asking for would require compiling the EMBOSS
>> or underlying Primer3 function into your program. That may not be
>> possible due to licensing restrictions (e.g. EMBOSS is GPL, what
>> does your tool use?).
> Fortunately not a problem. The way EMBOSS works it passes input and reads
> output through a pipe between processes (so, in GPL terms, primer3 and
> eprimer32 are not in the same binary file).
>  However, you should be able to avoid a file-write-read by asking
>> EMBOSS to write the output to stdout, and reading that from your
>> program.
> Exactly as above.
>  (This is related to the other suggestion I made for passing the
>> sequence to EMBOSS without using an input file: You can do
>> this in the command line using the "asis" trick, or use stdin.)
> Indeed. This is how the -filter pipe works.
> regards,
> Peter Rice

More information about the EMBOSS mailing list