Generade-nl / TULIP

TULIP - The Uncorrected Long read Itegration Pipeline
27 stars 4 forks source link

Tulip bulb: Experimental keys on scalar is now forbidden #3

Closed gringer closed 7 years ago

gringer commented 7 years ago

More recent Perl doesn't let me do too many confusing statements joined together. I needed to make another modification to Tulip bulb to get it working:

diff --git a/tulipbulb.perl b/tulipbulb.perl
index 0834dce..f64cd26 100644
--- a/tulipbulb.perl
+++ b/tulipbulb.perl
@@ -212,9 +212,10 @@ sub graphStats { # note: modified to use a reference to %adjacency
        foreach my $k1 (keys %{$adjacency}) {
                $k1 =~ /^(.+)([io])$/;
                $seeds{$1} = 1;
-               if ($2 eq "i") { $incount{scalar keys $$adjacency{$k1}}++; $connectioncount{scalar keys $$adjacency{$k1}}++; }
-               if ($2 eq "o") { $outcount{scalar keys $$adjacency{$k1}}++; $connectioncount{scalar keys $$adjacency{$k1}}++; }
-               foreach my $k2 (keys %{$$adjacency{$k1}}) {
+                my @adjKeys = keys(%{%{$adjacency}{$k1}});
+               if ($2 eq "i") { $incount{scalar(@adjKeys)}++; $connectioncount{scalar(@adjKeys)}++; }
+               if ($2 eq "o") { $outcount{scalar(@adjKeys)}++; $connectioncount{scalar(@adjKeys)}++; }
+               foreach my $k2 (@adjKeys) {
                        $length[0] += $$adjacency{$k1}{$k2}[2];
                        $length[1] += $$adjacency{$k1}{$k2}[3];
                        $length[2] += $$adjacency{$k1}{$k2}[4];
Generade-nl commented 7 years ago

Dear David,

Once more thank you for reporting your issues. We have removed some inadequate syntax, this should make your script run better.

With that we close the issue.

Any problems, please let us know.

Kind regards, Michael