1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
for ($i = 0; $i < @blat_data; $i++) {
my @splitted_row = split /\t/, $blat_data [$i];
my $query_id = $splitted_row[9];
if ($query_id eq $query_id_alt) {
$count++;
} else {
$query_id_alt = $query_id;
$count = 0;
}
$score = (($splitted_row[0] + ($splitted_row[2]>>1)) - $splitted_row[1] - $splitted_row[4] - $splitted_row[6]); #score = (match + (repMatch>>1)) - misMatch - qGapCount - tGapCount
$hashref->{$query_id}->[$count] = $score; #reference on score
}
for (keys %$hashref) {
$query = $_;
$hashref->{$query}->[$idxMax] > $hashref->{$query}->[$_] or $idxMax = $_ for 1 .. @$#hashref->{$query}; #finds the index of the biggest array element
print "Hello World\n";
}
Guest bioinformatics[...]
syntax error at blat_input.pl line 177, near "@$#hashref->{$query};
[...]
$#{$hashref->{$query}}
$all_scores[$idxMax] > $all_scores[$_] or $idxMax = $_ for 1 .. $#all_scores;
Guest bioinformaticsdanke für deine schnelle Antwort. Wenn ich die geschweiften Klammern allerdings hinzufüge, erkennt er das Ganze nur noch als Kommentar.
$hashref->{$query}->[$idxMax] > $hashref->{$query}->[$_] or $idxMax = $_ for 1 .. @$#{hashref->{$query}};
Guest bioinformaticsCode: (dl )1
2
3
4
5
6
7
8
9for (keys %$hashref) {
$query = $_;
$hashref->{$query}->[$idxMax] > $hashref->{$query}->[$_] or $idxMax = $_ for 1 .. @$#hashref->{$query}; #finds the index of the biggest array element
print "Hello World\n";
}
1
2
3
4
for my $arrayref (values %$hashref) {
$arrayref->[$idxMax] > $arrayref->[$_] or $idxMax = $_ for 1 .. $#arrayref; #finds the index of the biggest array element
print "Hello World\n";
}