Hi monks,

I am here with a new query. Hope to get a quick reply.
I am try to search for the number of occurrence of 10 hexamer word in a big file of fasta sequence.
I want to get the number of occurrence of each hexamer at each position till 5000, which is the longest sequence.
the code i wrote is given below

#!/usr/bin/perl use Data::Dumper; open $f,$ARGV[0]; while(<$f>) { chomp; $id = $_; #eat up the header line chomp($s = <$f>); if($s !~ /^>/) { push @seq,$s; } } open $fa, "top_10_hexamers.txt"; while(<$fa>) { chomp; $hx{$_}++; #hash of 10 hexamer } @words = sort keys %hx; for($i = 1;$i < 5000;$i++) { for($j = 0;$j <= $#words;$j++) { $result[$i][$j] = 0; # array of 5000 columns of positi +on and words as columns } } foreach $x(@seq) { for($j = 0; $j < (length($x) - 6);$j++) { $wrd = substr $x,$j,6; #getting the hexamer c +ombinations foreach $w(@words) { if($w eq $wrd) # comparing with the w +ord { $result->{$j}->{$wrd}++; # try +ing to get position, word and frequency } } } $wrd = ""; } print Dumper $result;

It worked for me when my sequences where 50 bases long. I used to get a hash named $VAR1. But Now I am working with 5000, and it prints $VAR1 = undef;
Can any one help me with this problem.
Thank you in advance,

Best regards,
Deepak


In reply to Dumb problem with dumper. by oxydeepu

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.