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 sequenom. 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 samples(as expected) if I don't have the next ine to get the genotype from DB #my $genotype = $conn->executeHashRef('snp::Sequenom::getGenotypeCalls', $id_ind , $snp_list->{$snpname}); #print "$snpname|$id_ind|$ind_list->{$id_ind}|" , join "|", values %$genotype, "\n" if (defined $genotype) ; #I get only 288 samples with or without genotyp calls. #print "$snpname|$id_ind|$ind_list->{$id_ind}\n" if (!$genotype); }# end of foreach %$snp_list }# end of foreach %$ind_list }; #end of eval block