[MOBY-dev] Possible Bug spotted

Volker Rössler volker.roessler at googlemail.com
Tue Dec 7 08:15:53 UTC 2010


Hi,

thanks for your reply.

When I run the script as you proposed, I get this:

$VAR1 = bless( {
                'primitive' => '1',
                'namespace' => '',
                'value' => '1',
                'id' => '',
                'xrefs' => []
              }, 'MOSES::MOBY::Data::Boolean' );

$VAR1 = bless( {
                'primitive' => '1',
                'namespace' => '',
                'value' => '0',
                'id' => '',
                'xrefs' => []
              }, 'MOSES::MOBY::Data::Boolean' );

Which seems fine. When I dump the results in $data with the Data::Dumper in
my webservice, I get the same results.

However, If I use the same construct in my moby webservice, and pass $data
in the "output object", the strange
behaviour is showing, which I've described earlier.

 my $output_annotated_CodingSNP = new MOSES::MOBY::Data::AnnotatedCodingSNP
                   (
                       wt_aa_seq => $pep_obj->get_field('wt_pep'),
                       mut_aa_seq => $pep_obj->get_field('mutant_pep'),
                       ext_database_refs => \@extDatabaseRefsList,
                       codon_ref => $pep_obj->get_field('codon_reference'),
                       aa_ref => $pep_obj->get_field('aa_reference'),
                       codon_var => $pep_obj->get_field('codon_genotype'),
                       aa_var => $pep_obj->get_field('aa_genotype'),
                       aa_pos => $aa_pos,
                       a*a_change => $data,*
                       Position => $position,
                       Strain => $Strain,
                       reference_allele => $reference_allele,
                       genotype_allele => $genetype_allele
                   );

 $response->add_output_annotated_CodingSNP($output_annotated_CodingSNP);


If I set $data->value("true"), the xml output will be:
<moby:Boolean moby:id="" moby:namespace="" moby:articleName="aa_change"
value="true">

And if I set $data->value("false"), the xml output will be:
<moby:Boolean moby:id="" moby:namespace="" moby:articleName="aa_change"/>

I guess, it should rather be:
 <moby:Boolean moby:id="" moby:namespace="" moby:articleName="aa_change"
value="false">


The same thing seems to happen with the Integer Datatype in Moby. If it is
set to 0, it will also produce
 <moby:Integer moby:id="" moby:namespace="" moby:articleName="myinteger"/>

--
Volker



On Mon, Dec 6, 2010 at 6:41 PM, Edward Kawas <edward.kawas at gmail.com> wrote:
> What do you get when you run a script like:
>
> #!/usr/bin/perl -w
>
> use strict;
>
> use MOSES::MOBY::Data::Boolean;
> use Data::Dumper;
>
> # create a Moby Boolean with initial value of true
>  my $data = MOSES::MOBY::Data::Boolean->new ( value=>'true' );
>
>  print Dumper($data), "\n";
>
>  # change the value to false
>  $data->value ('false');
>
>  # get the value
>  print Dumper($data), "\n";
>
>
>
> -----Original Message-----
> From: moby-dev-bounces at lists.open-bio.org
> [mailto:moby-dev-bounces at lists.open-bio.org] On Behalf Of Volker Rössler
> Sent: Monday, December 06, 2010 3:34 AM
> To: moby-dev at lists.open-bio.org
> Subject: [MOBY-dev] Possible Bug spotted
>
> Hi everyone,
>
> I'm trying to set a variable of type boolean in the Moby output object to
> 'false'. The strange thing is, that I can't seem to set it to the value
> 'false'.
> If I try to set it to false, it will produce something like this in the
xml
> output:
>
> <moby:Boolean moby:id="" moby:namespace="" moby:articleName="aa_change"/>
>
> I have tried different approaches like this:
> MOSES::MOBY::Data::Boolean->new(value => 'false');
>
> Is this a bug in Moby?
>
> Does anyone have a clue?
> Thanks in advance!
>
> --
> Volker
> _______________________________________________
> MOBY-dev mailing list
> MOBY-dev at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/moby-dev
>
>
> _______________________________________________
> MOBY-dev mailing list
> MOBY-dev at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/moby-dev
>




More information about the MOBY-dev mailing list