Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Allo,
I've been going crazy with a program I'm writing using the BioPerl library. Problem could be my code, or the public data, or the library. I want to rule out myself before looking at others. I do not want anyone to go learn the library to help with this, just to see if I am doing something syntax incorrect of some sort.
I have not yet found a "minimal test-case" because each run of program on just two chromosomes is 6 hours on my PC! I removed most "excess" already though.
# includes use strict; use Bio::ClusterIO; # locals my $dir = $ARGV[0]; my %data; # directory handling if (-d !$dir) { print "Directory does not exist!\n", "Program Terminating....\n"; exit(); } opendir(DIR, $dir) || die "$dir: $!\n"; chdir($dir); $dir =~ s/\\$//; while (my $infile = readdir(DIR)) { if ((-T $infile) && ($infile =~ /^ds_ch(.{1,2})\.xml$/i)) { my %data; my $chromosome = $1; print "Processing $chromosome\n"; my $parser = Bio::ClusterIO->new( -file => $infile, -format => 'dbSNP' ); while (my $record = $parser->next_cluster()) { if (my $class = $record->functional_class) { $class =~ s/^\s+//; $class =~ s/\s+$//; $data{$class}{$record->observed()}++; } } open(OUT, '>>', 'Results.txt'); foreach my $class (keys(%data)) { foreach my $snp (keys(%{$data{$class}})) { print OUT "$chromosome\t$class\t$snp\t$data{$class}{$s +np}\n"; } } close(OUT); } }
Problem is: even if directory of 20 files is processed, file only contains output from one file, or sometimes none? Tried subsets of data-files (each 1GB) but no differences so far. Any help please!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sanity Check: Debugging Help Needed!
by VSarkiss (Monsignor) on Aug 27, 2003 at 01:03 UTC | |
by Anonymous Monk on Aug 27, 2003 at 17:57 UTC | |
|
Re: Sanity Check: Debugging Help Needed!
by CombatSquirrel (Hermit) on Aug 27, 2003 at 00:44 UTC | |
by Anonymous Monk on Aug 27, 2003 at 17:50 UTC | |
by CombatSquirrel (Hermit) on Aug 27, 2003 at 19:03 UTC | |
|
Re: Sanity Check: Debugging Help Needed!
by BrowserUk (Patriarch) on Aug 27, 2003 at 01:00 UTC | |
by Anonymous Monk on Aug 27, 2003 at 17:56 UTC | |
by BrowserUk (Patriarch) on Aug 27, 2003 at 18:36 UTC | |
|
Re: Sanity Check: Debugging Help Needed! (Solved: Thank you!)
by Anonymous Monk on Aug 31, 2003 at 01:46 UTC |