Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
So I get all the sample being printed if I dont have the $genotype line. But If I have them the previous print statement wouldn't print all the samples expected. Is there a reason for this oddness?use strict; use warnings ; use Getopt::Long; use Database::Conn #Its a private module my $conn; my $snp_list = {}; my $ind_list = {}; eval { $conn = Sanger::CGP::Database::Conn->new('live'); $conn->addConnection(DBI->connect('dbi:Oracle:SNP.world','snp','snp', + {RaiseError =>1 , AutoCommit=>0}),'snp'); my $snparray = $conn->executeArrRef('snp::Sequenom::getSnpsforPlex'); #get the list of snps and ids id for the plexes foreach my $snp (@ {$snparray} ) { $snp_list->{$snp->[0]} = $snp->[1]; } #fetch all the sample fer the study 6637 CGPP that has gone through se +quenom. my $indsent = $conn->executeArrRef('snp::Sequenom::getIndForPlateSent +'); foreach my $ind ( @ { $indsent } ) { $ind_list->{$ind->[1]} = $ind->[0]; } foreach my $id_ind ( sort keys % { $ind_list } ) { foreach my $snpname ( sort keys % { $snp_list } ) { print "$snpname|$id_ind|$ind_list->{$id_ind}\n"; #I get 3072 s +amples(as expected) if I don't have the next ine to get the genotype + from DB #my $genotype = $conn->executeHashRef('snp::Sequenom::getGenot +ypeCalls', $id_ind , $snp_list->{$snpname}); #print "$snpname|$id_ind|$ind_list->{$id_ind}|" , join "|", va +lues %$genotype, "\n" if (defined $genotype) ; #I get only 288 sample +s with or without genotyp calls. #print "$snpname|$id_ind|$ind_list->{$id_ind}\n" if (!$genotyp +e); }# end of foreach %$snp_list }# end of foreach %$ind_list }; #end of eval block
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: reason for not getting the data when passed to a query
by jethro (Monsignor) on May 20, 2011 at 09:12 UTC |