[Bioperl-l] Bio::Tools::Run::Cap3 - Parameters

Jonathan Crabtree jonathancrabtree at gmail.com
Thu May 7 10:20:08 EDT 2009


No problem.  With respect to the location of cap3, I was a bit quick to pass
judgment and didn't look at exactly what WrapperBase does: it first tries
the hard-coded directory location from the Cap3 module, and then falls back
to Bio::Root:IO::exists_exe, which searches your PATH for the executable,
provided that File::Spec can be loaded.

Jonathan

On Thu, May 7, 2009 at 3:53 AM, Michael Stubbington <
Michael.Stubbington at hpa.org.uk> wrote:

>  Jonathan,
>
>
>
> Thanks a lot for this advice. It now all works for me.
>
>
>
> Strangely my cap3 installation is not in /usr/local/bin but everything
> works fine without me having to change $PROGRAMDIR in cap3.pm
>
>
>
> Thanks to everyone else involved in this thread for their efforts in
> improving Bio::Tools::Run::Cap3.
>
>
>
> Best wishes,
>
>
>
> Mike
>
>
>  ------------------------------
>
> *From:* Jonathan Crabtree [mailto:jonathancrabtree at gmail.com]
> *Sent:* 06 May 2009 16:46
> *To:* Kevin Brown
> *Cc:* Michael Stubbington; bioperl-l at lists.open-bio.org
> *Subject:* Re: [Bioperl-l] Bio::Tools::Run::Cap3 - Parameters
>
>
>
>
> The "new" argument to Cap3 expects an array, not a string.  So I think you
> need to do this:
>
> my $cap3Factory = Bio::Tools::Run::Cap3->new('y',  '150');
>
> rather than this:
>
> my $cap3Factory = Bio::Tools::Run::Cap3->new('y 150');
>
> Otherwise it will silently ignore the parameter.  There are also several
> problems with the Cap3 module itself, at least the version shown here:
>
>
> http://cpansearch.perl.org/src/CJFIELDS/BioPerl-run-1.6.1/Bio/Tools/Run/Cap3.pm
>
> Those problems are:
>
> 1. "y" is not in the PARAMS array, as Brian and Kevin have noted
> 2. $PROGRAMDIR appears to be hard-coded to /usr/local/bin (OK if that's
> where your cap3 is installed)
> 3. The run() method does this:
>
> my $commandstring = $exe . $param_string . " $infilename1";
>
> but at least for the version of cap3 I'm using, you need to put the
> $param_string _after_ the $infilename1 for it to work.  Once all these
> things are corrected it worked for me and correctly passed the -y 150 to
> cap3 when new() was called as shown above.
>
> Jonathan
>
>  On Wed, May 6, 2009 at 11:23 AM, Kevin Brown <Kevin.M.Brown at asu.edu>
> wrote:
>
> BEGIN {
>
>    @PARAMS     = qw(a b c d e f g m n o p s u v x);
>    $PROGRAMDIR = '/usr/local/bin';
>
>    # Authorize attribute fields
>    foreach my $attr (@PARAMS) { $OK_FIELD{$attr}++;
>
> }
>
> That is the list of params that Cap3 will accept in the BioPerl module.
> I'm guessing if you add the y to that list that it might work.
>
>
> > -----Original Message-----
> > From: bioperl-l-bounces at lists.open-bio.org
> > [mailto:bioperl-l-bounces at lists.open-bio.org] On Behalf Of
> > Michael Stubbington
> > Sent: Wednesday, May 06, 2009 7:39 AM
> > To: bioperl-l at lists.open-bio.org
> > Subject: [Bioperl-l] Bio::Tools::Run::Cap3 - Parameters
> >
> > Dear all,
> >
> >
> >
> > I am using the Bio::Tools::Run::Cap3 wrapper to the Cap3 assembly
> > program. I have some reads that will only assemble if cap3 is
> > used with
> > the '-y 150' option. This is fine from the command line but I
> > can't work
> > out how to pass this option to the Cap3 factory object in my script.
> >
> >
> >
> > If I do the following
> >
> >
> >
> > my $params =  "y 150" ;
> >
> > my $cap3Factory = Bio::Tools::Run::Cap3->new($params);
> >
> > my $assembly = $cap3Factory->run($file);
> >
> >
> >
> > Then I get an exception as follows:
> >
> >
> >
> > ------------- EXCEPTION: Bio::Root::Exception -------------
> >
> > MSG: Unallowed parameter: y !
> >
> > STACK: Error::throw
> >
> > STACK: Bio::Root::Root::throw
> > /Users/mike/lib/perl5/site_perl/5.8.9/Bio/Root/Root.pm:357
> >
> > STACK: Bio::Tools::Run::Cap3::AUTOLOAD
> > /Users/mike/lib/perl5/site_perl/5.8.9/Bio/Tools/Run/Cap3.pm:116
> >
> > STACK: Bio::Tools::Run::Cap3::new
> > /Users/mike/lib/perl5/site_perl/5.8.9/Bio/Tools/Run/Cap3.pm:101
> >
> > STACK: /Users/mike/perlScripts/QGenotype.pl:150
> >
> >
> >
> > If I don't try to pass any parameters to Cap3 it runs fine but just
> > fails to assemble the reads that need the -y 150 flag.
> >
> >
> >
> > I'd very much appreciate any help with this. I'm pretty new
> > to bioperl,
> > hope I haven't missed anything obvious!
> >
> >
> >
> > Thanks in advance,
> >
> >
> >
> > Mike
> >
> >
> >
> > --------------------------------------------------------------
> > ----------
> > ----
> >
> > Mike Stubbington
> >
> > Novel and Dangerous Pathogens
> >
> > Health Protection Agency
> >
> > Centre for Emergency Preparedness and Response
> >
> > Porton Down
> >
> > Salisbury
> >
> > SP4 0JG
> >
> >
> >
> > Tel: +44 1980 619812
> >
> >
> >
> >
> >
> > -----------------------------------------
> > **************************************************************
> > ************
> > The information contained in the EMail and any attachments is
> > confidential and intended solely and for the attention and use of
> > the named addressee(s). It may not be disclosed to any other person
> > without the express authority of the HPA, or the intended
> > recipient, or both. If you are not the intended recipient, you must
> > not disclose, copy, distribute or retain this message or any part
> > of it. This footnote also confirms that this EMail has been swept
> > for computer viruses, but please re-sweep any attachments before
> > opening or saving. HTTP://www.HPA.org.uk
> > **************************************************************
> > ************
> > _______________________________________________
> > Bioperl-l mailing list
> > Bioperl-l at lists.open-bio.org
> > http://lists.open-bio.org/mailman/listinfo/bioperl-l
> >
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>
>
>



More information about the Bioperl-l mailing list