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!


In reply to Sanity Check: Debugging Help Needed! by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.