[MOBY-dev] Strange problems with nested moby objects

Volker Rössler volker.roessler at googlemail.com
Tue Nov 16 08:12:00 UTC 2010


Hi Eddie,

thank you so much for your fast and helpful response!
Now the code finally works for me.
I was already pretty frustrated, because I had taken every single bit
of the code apart, searching for the error, but the error messages
from the moses-service-testing script were not really helpful.
But somehow I couldn't not see the forest for the trees... ;-)


Volker


On Mon, Nov 15, 2010 at 7:35 PM, Edward Kawas <edward.kawas at gmail.com> wrote:
> Hi,
>
> The problem is with your line
>
> my $newTranscript => new MOSES::MOBY::Data::SNPTranscript
>
> that should actually read
>
> my $newTranscript = new MOSES::MOBY::Data::SNPTranscript
>
> an equal sign not a =>
>
> Eddie
>
> -----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, November 15, 2010 3:32 AM
> To: moby-dev at lists.open-bio.org
> Subject: [MOBY-dev] Strange problems with nested moby objects
>
> Hi everyone,
>
> I'm experiencing a rather strange problem when trying to build the response
> object. What I'd like to achieve is building an
> 'AnnotatedSNPAndTranscriptLocation' object which contains an array of
> 'SNPTranscript' objects.
>
> My code for building the response object looks like this, but this causes
> some strange problems:
>
>
> @SNP_list = mymethod($some_user_input);
>
> foreach my $SNP (@SNP_list) {
>
>        my @listOfBiomobyTranscriptObjects;
>
>        my $transcriptList = $SNP->get_transcript_list();
>
>        foreach my $trans (@$transcriptList) {
>
>            my $snp_type = $trans->get_field('snp_type');
>            my $database_references = new MOSES::MOBY::Data::Object
>                (
>                    id => $trans->get_field('name'),
>                    namespace => 'Ensembl'
>                );
>            my $strand = $trans->get_field('strand');
>            my $description = $trans->get_field('description');
>            my $name = $trans->get_field('name');
>            my $start = $trans->get_field('start');
>            my $stop = $trans->get_field('stop');
>
>
>            my $newTranscript => new MOSES::MOBY::Data::SNPTranscript
>                (
>                    snp_type => $snp_type,
>                    #database_references => $database_references,
>                    strand => $strand,
>                    description => $description,
>                    name => $name,
>                    start => $start,
>                    stop => $stop
>                );
>            push (@listOfBiomobyTranscriptObjects, $newTranscript);
>        }
>
>        my $output_snp_transcripts = new
> MOSES::MOBY::Data::AnnotatedSNPAndTranscriptLocation
>            (
>
>                snp_transcripts => \@listOfBiomobyTranscriptObjects,
>                coverage_all => $SNP->get_snp_coverage_all(),
>                coverage_new_allele => $SNP->get_snp_coverage_new_allele(),
>                genetype_allele => $SNP->get_snp_genotype_allele(),
>                reference_allele => $SNP->get_snp_reference_allele(),
>                confidence => $SNP->get_snp_score(),
>                Position => new MOSES::MOBY::Data::Position
>                    (
>                        end => $SNP->get_snp_position(),
>                        start => $SNP->get_snp_position(),
>                        chromosome => $SNP->get_snp_chromosome()
>                    ),
>                Strain => $strain
>            );
>        $response->add_output_snp_transcripts($output_snp_transcripts);
>    }
>
>
>
> When I'm trying to run this, I get the following error message:
> 2010/11/15 12:26:02 (71764) FATAL> [13065] (eval 1068):155 -
> ------------- EXCEPTION: MOSES::MOBY::Data::SNPTranscript -------------
> MSG: No such method: MOSES::MOBY::Data::SNPTranscript::value
>
> I suspect, that this error happens, because I am trying to use an array of
> MOSES::MOBY::Data::Object (stored in @listOfBiomobyTranscriptObjects), but
> I'm not quite sure.
>
> Any help or suggestions are greaty appreciated!
>
> Yours,
> 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