Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Population of HoAoA based on file contents

by state-o-dis-array (Hermit)
on May 09, 2012 at 20:57 UTC ( #969707=note: print w/ replies, xml ) Need Help??


in reply to Population of HoAoA based on file contents

So, if I understand correctly, you want your results to look something like:

$data{"HG00553"}[162][16287215] = "0 0" $data{"HG00553"}[162][16287226] = "0 0" ... $data{"HG00638"}[162][16287851] = "1 1" ...
First, I'd suggest you do a little debug work to understand what your code is doing. Specifically:
while (<$in_file>) { print "$_"; chomp; my @snp_bins; if (/^SAMPLE/) { my ( $placeholder, @coords ) = split /,/; foreach my $coord (@coords) { push @snp_bins, int( $coord / 100_000 ); } } else { my ( $id, @snps ) = split /,/; push @individuals, $id; foreach my $individual (@individuals) { print "working on $individual\n"; foreach my $snp (@snps) { my $snp_bin = shift @snp_bins; print "snp_bin $snp_bin\n"; $data{$individual}[ [ $snp_bin ] ] = $snp; } } print "snp_bins: @snp_bins\n"; } }
I think that you'll find some things which you didn't expect. Also, I think that you might be better off using HoHoH instead. I believe that doing:
$data{$individual}[162] = "something"
will result in:
$data{$individual}[0..162]
even though you are only concerned with the former. So it would probably be better to:
$data{$individual}{162}{16287215} = "0 0"


Comment on Re: Population of HoAoA based on file contents
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://969707]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (10)
As of 2015-07-30 09:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (270 votes), past polls