Hi People,
I have a rather strange question, is there a reason why certain data(fetched from a database) is no longer passed as an parameter for another query?
I have added my script here:
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
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?
Since I have manually checked the samples that I miss is in the DB and they do hold genotype values.
Thanks for your suggestions.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.