[Bioperl-l] piping to CAP3

Marc Logghe Marc.Logghe at devgen.com
Tue Jul 6 18:08:44 EDT 2004


Hi Jamie,

> -----Original Message-----
> From: James Gregory [mailto:j1gregor at biomail.ucsd.edu]
> Sent: dinsdag 6 juli 2004 23:00
> To: bioperl-l at portal.open-bio.org
> Subject: [Bioperl-l] piping to CAP3
> 
> 
> Hello,
> 
> I'm trying to write a script that receives either pasted 
> sequences or a
> file upload of FASTA format seqs for assembly using CAP3 but 
> i'm having
> some trouble.  This doesn't use bioperl but i'm guessing that this
> audience will be more familiar with what i'm trying to do.
> 
> use strict;
> use CGI qw(:standard escapeHTML);
> 
> 
> my $input = new CGI;
> my $tgicl = "/opt/CAP_update/tgicl_linux/bin/tgicl"; #path to CAP3
> 
> # for pasted seqs
> 
> my $seq = $input->param("seqs"); # retrieve seqs
> open (FILE, ">seqAssembly.txt") || die;
> my $file = <FILE>;   # printing seqs to file
> print FILE "$seq";
> close FILE;
> 
> open PIPE_TO_CAP3, "| $tgicl seqAssembly.txt" || die $!;
> 
The pipe symbol should be at the end, not the beginning. Cos you don't want to pipe anything TO cap3; you want the output from cap3:

open PIPE_TO_CAP3, "$tgicl seqAssembly.txt |" || die $!;
# slurp the result
local $/ = undef;
my ($result) = <PIPE_TO_CAP3>;
close PIPE_TO_CAP3;

In fact I have a Bio::Tools::Run::Cap3 module which does that all for you. I'll put it in attach so you can try it out.
(adjust the program dir, if needed, in the package)
Then you could do:
use Bio::Tools::Run::Cap3;
  my $p      = Bio::Tools::Run::Cap3->new;
  my $result = $p->run( \@seq_obj );
  print $result;


HTH,
Marc

***********************************************************
Marc Logghe, Ph.D.
Senior Scientist
Scientific Computing Group
Devgen nv
Technologiepark 30
B - 9052 Ghent-Zwijnaarde
Belgium
Tel: +32 9 324 24 83
Fax: +32 9 324 24 25

> **** DISCLAIMER ********************************************************** 
> "This e-mail and any attachments thereto may contain information 
> which is confidential and/or protected by intellectual property 
> rights and are intended for the sole use of the recipient(s) named above. 
> Any use of the information contained herein (including, but not limited to, 
> total or partial reproduction, communication or distribution in any form) 
> by persons other than the designated recipient(s) is prohibited. 
> If you have received this e-mail in error, please notify the sender either 
> by telephone or by e-mail and delete the material from any computer. 
> Thank you for your cooperation."




-------------- next part --------------
A non-text attachment was scrubbed...
Name: Cap3.pm
Type: application/octet-stream
Size: 3374 bytes
Desc: Cap3.pm
Url : http://portal.open-bio.org/pipermail/bioperl-l/attachments/20040707/724896e6/Cap3.obj


More information about the Bioperl-l mailing list