[Bioperl-l] Auto-method caller proposal
Hilmar Lapp
hlapp at gmx.net
Thu Jan 4 16:13:43 UTC 2007
I see your point; and for the sake of reducing ambiguity/increasing
clarity demanding unambiguous parameter names rather than
disambiguating by the presence or absence of a leading dash is
preferable I guess.
Just should be clearly documented for module wrapper implementers;
also, are we going to retrofit existing wrappers?
-hilmar
On Jan 4, 2007, at 11:00 AM, Sendu Bala wrote:
> Hilmar Lapp wrote:
>> Sounds good to me, except that I'm still not sure that dashed and
>> dash-less parameters are just variations of the same. What about -
>> verbose and a verbose parameter for the tool, for example?
>
> That's an open problem. I identified it in a recent thread as one
> of the few reasons a run-wrapper module might deliberately demand
> dashless args for program args and only allow dashed args for
> Bioperl args. The consensus (and I agree) was that it is preferable
> to allow dashed args for everything regardless of this problem.
>
> For this proposal, Bio::Root::Root's verbose() would be set for
> both dashed and dashless, and then it would be up to the run-
> wrapper module author to figure out some extra way to set a verbose
> option independently for the program being wrapped. I imagine the
> author might apologise in their POD and tell the user they had to
> use 'program_verbose' or something, then handle things
> appropriately when it comes time to create the argument string for
> passing to the program.
>
> Alternatively (not something I recommend since it will causes
> confusion and mistakes), you could deliberately request problem
> cases be dashed or undashed:
>
> package Bio::Tools::Run::Confusing;
> =head2 new
> ...
> To set Bioperl verbosity use:
> -verbose => int
> To activate program verbosity use:
> verbose => 1
> =cut
> sub new {
> my ($class, @args) = @_;
> my $self = $class->SUPER::new(@args); # Bioperl verbosity set here
>
> my %args = @args;
> if (my $program_verbose = $args{verbose}) {
> delete $args{verbose};
> $args{program_verbose} = $program_verbose;
> }
>
> $self->_set_from_args(\%args,
> -methods => [id score program_verbose],
> -create => 1);
>
> return $self;
> }
> 1;
>
> # test code
> my $factory = Bio::Tools::Run::Confusing->new(-verbose => 0,
> verbose => 1);
> is $factory->verbose, 0, 'Bioperl verbosity set correctly';
> is $factory->program_verbose, 1, 'program verbosity set correctly';
>
>
>
> Any other ideas?
--
===========================================================
: Hilmar Lapp -:- Durham, NC -:- hlapp at gmx dot net :
===========================================================
More information about the Bioperl-l
mailing list