thankyou. My problem is that I am incorporating this in a loop so that I do not know how many Hashes of arrays (ie. how many taxids) I will have each time
here I have tried to illustrate a bit better what I want (although I know its not correct). Or is there some way of pushing or pasting the arrays into a list that I then pass to List::Compare
my %HoAncestors;my @intersection; foreach my $qu (keys %HoTxHits) { my $array_list;my $numb_taxids; # go through each taxid, get ancestors, then find the intersec +tion foreach my $taxid (@{$HoTxHits{$qu}}){ $numb_taxids=scalar(@{$HoTxHits{$qu}}); my $queryTaxid=$taxid; while ((exists $HoPar{$queryTaxid}) && ($HoPar{$queryT +axid} != 1)) { my $parent=$HoPar{$queryTaxid}; push (@{$HoAncestors{$taxid}},$parent); $queryTaxid=$parent; } } my $lcm=List::Compare->new($HoAncestors{$taxid}[0]..$HoAncesto +rs{$taxid}[$numb_taxids-1]); @intersection=$lcm->get_intersection; }
In reply to Re^2: Passing List::Compare a list of arrays
by AWallBuilder
in thread Passing List::Compare a list of arrays
by AWallBuilder
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |