Sample,Genotypes,Plex,rsids
AWQ,A,W30123,rs123
AWQ,G,W30123,rs121
AWQ,C,W30123,rs1234
AWQ,N,W30123,rs122
AWQ,T,W30123,rs1213
AWQ,NN,W30122,rs1232
AWQ,NN,W30122,rs1222
AWQ,NN,W30122,rs1223
AWQ,NN,W30122,rs12121
AWQ,NN,W30122,rs12111
AWQ,NN,W30122,rs1
AWQ,G,W30121,rs143
AWQ,C,W30121,rs13
AWQ,C,W30121,rs125
AWQ,G,W30121,rs12453
AWQ,T,W30121,rs124763
AWQ,A,W30121,rs12343
AWP,T,W30123,rs123
AWP,C,W30123,rs121
AWP,C,W30123,rs1234
AWP,N,W30123,rs122
AWP,G,W30123,rs1213
AWP,G,W30122,rs1232
AWP,N,W30122,rs1222
AWP,A,W30122,rs1223
AWP,AG,W30122,rs12121
AWP,G,W30122,rs12111
AWP,C,W30122,rs1
AWP,T,W30121,rs143
AWP,G,W30121,rs13
AWP,T,W30121,rs125
AWP,C,W30121,rs12453
AWP,G,W30121,rs124763
AWP,C,W30121,rs12343
####
I want them in this format Which is more readable and doesn't run for too many lines.
Sample,rs123,rs121,rs1234,rs122,rs1213,rs1232,rs1222,rs1223,rs12121,rs12111,rs1,rs143,rs13,rs125,rs12453,rs124763,rs12343
AWQ,A,G,C,N,T,NN,NN,NN,NN,NN,NN,G,C,C,G,T,A
AWP,T,C,C,N,G,G,N,A,AG,G,C,T,G,T,C,G,C
####
use Getopt::Long;
4 use Benchmark;
5 use Config::Config qw(/nfs/users/nfs_a/aj6/CGP/Sequenom/perl/Sequenom.ini);
6 use Database::Conn;
7
8 my $conn;
9 my $snp_list = {};
10 my $ind_list = {};
11 my $gen_list = {};
12 eval {
13
14 $conn = Database::Conn->new('live');
15 $conn->addConnection(DBI->connect('dbi:Oracle:SNP.world','snp','snp', {RaiseError =>1 , AutoCommit=>0}),'snp');
16 my $timestarted = Benchmark->new();
17 my $snparray = $conn->executeArrRef('snp::Sequenom::getSnpsforPlex');
18
19 my $indsent = $conn->executeArrRef('snp::Sequenom::getIndForPlateSent');
20 #=cut
21 foreach my $ind( @ {$indsent} ){
22
23 foreach my $snp (@ {$snparray} ){
24
25 my $genotype = $conn->executeArrRef('snp::Sequenom::getGenotypeCalls', $ind->[0], $snp->[0]);
26
27 foreach my $geno( @ {$genotype} ){
28 #3my $i = 1;
29 if(defined $geno->[3]){
30
31
32 print "$geno->[1],$geno->[3],$geno->[2],$geno->[4]\n";
33
34 }#end of if loop to check the genotype defined
35 else{
36
37 print "$geno->[1],NO,$geno->[2],$geno->[4]\n"
38
39 }
40
41
42 }#end of @$genotype
43
44 }#end of @$snpsent
}#end of @$indsent