sharanyaravi has asked for the wisdom of the Perl Monks concerning the following question:
.. whichs is nothing but the occurence of that particualr letter ( A T G or C) in postion 1 2 and 3..... the code is as follows$VAR1 = { 'A' => [ 2, 1, 1 ], 'T' => [ 1, 3, 1 ], 'C' => [ 0, 0, 1 ], 'G' => [ 1, 0, 1 ] };
#!usr/bin/perl use strict; use warnings; use Data::Dumper; local our @deep; local $; = ','; # A vestige of a previous version my @data = qw(AAA ATG TTT GTC); my @d2 = map [ split // ], @data; my (%hash); for my $entry (@d2) { *deep = $entry; for my $nx (0..$#deep) { $hash{$deep[$nx]}[$nx]++; } } foreach my $entry (values %hash) { $entry = [ map defined $_ ? $_ : 0, @$entry ]; } print Dumper(\%hash);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: can this perl script be explained how and what it is going on...????
by GrandFather (Saint) on Dec 03, 2009 at 08:23 UTC | |
|
Re: can this perl script be explained how and what it is going on...????
by Utilitarian (Vicar) on Dec 03, 2009 at 08:33 UTC | |
|
Re: can this perl script be explained how and what it is going on...????
by Anonymous Monk on Dec 03, 2009 at 08:06 UTC | |
by ikegami (Patriarch) on Dec 03, 2009 at 16:56 UTC |