Skip to content

genomicislands cal_dinuc bug #8

@JFsanchezherrero

Description

@JFsanchezherrero

Dear developers,

I have been checking the code as I wonder if there would be a possibility to generate the same analysis if provided a draft genome or assembly into multiple contigs, in genbank format too.

I am working on this new implementation and I would let you know when I have a working version if you might be interested in pulling the request.

Meanwhile, I found a bug in your code. It is in the genomicisland module, cal_dinuc function at the end of the function. Number line: 349-378.

if ($output_file) {
print OUTFILE "ORFs_dinucleotide_analysis_for $fasta_name\n";
my $bias2;
my $count = 0;
foreach $bias2 (@biases) {
$count++;
$bias2 = $bias2 * 1000;
printf OUTFILE
"ORF%5d-ORF%5d($ORF_ids[$count]-$ORF_ids[$count+5])=%5.2f\n",
$count, ( $count + 5 ), $bias2;
}
close OUTFILE;
return;
}
else {
my $bias2;
my $count = 0;
my $range = 5;
my @results;
my $key_string;
foreach $bias2 (@biases) {
$count++;
$bias2 = $bias2 * 1000;
$key_string =
"ORF" . $count . "("
. $ORF_ids[$count] . ")-ORF"
. ( $count + $range ) . "("
. $ORF_ids[ $count + $range ] . ")";
push @results, { ORF_label => $key_string, DINUC_bias => $bias2 };
}
return \@results;
}

It affects so many lines because is in both sides of the if clause. Basically, the bug is related to the $count. If you add to $count before the first iteration you will never get the value for $ORF_ids[0], it would start in $ORF_ids[1].

To my point of view, this is not an intented behaviour and it should be addressed by adding to $count after the iteration.

Thank you very much

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions