[Bioperl-l] comparing data between hashes

Michael Robeson popgen23 at mac.com
Sun Oct 24 23:07:59 EDT 2004


On Oct 24, 2004, at 3:16 PM, Brian Osborne wrote:

> Michael,
>
> Perhaps instead of appending to a string ($class{$position} .= "$pos" 
> . "
> ,") you could make each position a secondary key:
>
>  $class{$position}{$pos} = 1;

I am not sure I could with the way it's posted above because were you 
have a '1' would be a variable. So, I would have to rewrite my code to 
make another variable some how.  This is why I did:

$class{$position} .= "$pos" . " ,";

So, what would I enter in the place of a '1' if my $pos (a value) now 
becomes a key, as you've got posted above?

>
> Then comparing 2 species is a matter of looping over the secondary 
> keys and
> asking if a given key is defined in both species.
>
>
> Brian O.

I guess I'll keep thinking about it. :-)
-Mike



More information about the Bioperl-l mailing list