in reply to Re^3: perl DBI String length problem
in thread perl DBI String length problem
# .chp file parsing/db updating subroutine sub dataparse { # Extract arguments passed to sub and define input file and bg var +iables my $input = shift @_; my $background = shift @_; my $pcall=0; my $acall=0; my $mcall=0; my $pandabovecall=0; my $mandabovecall=0; my $rawdatastring=""; # Open input file or die open (INPUT, $input) or die "Cannot open infile!$!"; # Enter while loop for file parse while (<INPUT>) { # Skip header and Affray control lines next if (/^\s*$/) || (/^Gene/) || (/^AFFX/) || (/^2000/); # Split line on tabs, assign to array and chomp chomp (my @linearray = split "\t", $_); # Extract 3 required values my $name = shift @linearray; my $signal = shift @linearray; my $affraycall = shift @linearray; $rawdatastring .="$name:$signal:$affraycall:"; # Increment Present count fot sequence if above bg and present e +lse increment absent count if ($affraycall eq "P") { $pcall++; if ($signal > $background) {$pandabovecall++;} } elsif ($affraycall eq "M") { $mcall++; if ($signal > $background) {$mandabovecall++;} } elsif ($affraycall eq "A") {$acall ++;} } close INPUT; my $pmandaboves = $pandabovecall+$mandabovecall; my $inserthandle = $dbh->prepare ("INSERT INTO CHIPDATA (RawData) VALU +ES ('$rawdatastring')"); $inserthandle->execute;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: perl DBI String length problem
by ChrisR (Hermit) on Sep 06, 2005 at 17:24 UTC |